diff --git a/module.cpp b/module.cpp index 8ad728b5..42c03fbe 100644 --- a/module.cpp +++ b/module.cpp @@ -184,7 +184,7 @@ Module::CompileFile() { FATAL("Need to implement code to run the preprocessor for windows"); #else // ISPC_IS_WINDOWS char *cmd = NULL; - if (asprintf(&cmd, "/usr/bin/cpp -DISPC=1 -DPI=3.1415936535 %s %s", + if (asprintf(&cmd, "/usr/bin/cpp -DISPC=1 -DPI=3.1415926536 %s %s", cppDefs.c_str(), filename ? filename : "-") == -1) { fprintf(stderr, "Unable to allocate memory in asprintf()?!\n"); exit(1); diff --git a/stdlib.ispc b/stdlib.ispc index 629cdcd3..05abfd1a 100644 --- a/stdlib.ispc +++ b/stdlib.ispc @@ -1087,8 +1087,8 @@ static inline float atan2(float y, float x) { } else if (__math_lib == __math_lib_ispc || __math_lib == __math_lib_ispc_fast) { - const float pi_vec = 3.1415927410125732421875; - const float pi_over_two_vec = 1.57079637050628662109375; + const float pi_vec = 3.1415926536; + const float pi_over_two_vec = 1.5707963267; // atan2(y, x) = // // atan2(y > 0, x = +-0) -> Pi/2