[libc-commits] [libc] 8c9d685 - [libc][math] Fix broken atan function.

Kirill Okhotnikov via libc-commits libc-commits at lists.llvm.org
Tue Aug 30 14:04:25 PDT 2022


Author: Kirill Okhotnikov
Date: 2022-08-30T23:04:00+02:00
New Revision: 8c9d685fa80e4602f6e63c1b460c793ce52aba6e

URL: https://github.com/llvm/llvm-project/commit/8c9d685fa80e4602f6e63c1b460c793ce52aba6e
DIFF: https://github.com/llvm/llvm-project/commit/8c9d685fa80e4602f6e63c1b460c793ce52aba6e.diff

LOG: [libc][math] Fix broken atan function.

Added: 
    

Modified: 
    libc/src/math/generic/inv_trigf_utils.h

Removed: 
    


################################################################################
diff  --git a/libc/src/math/generic/inv_trigf_utils.h b/libc/src/math/generic/inv_trigf_utils.h
index 350d6be58d87..32f0ba77d000 100644
--- a/libc/src/math/generic/inv_trigf_utils.h
+++ b/libc/src/math/generic/inv_trigf_utils.h
@@ -83,7 +83,7 @@ inline static double atan_eval(double x) {
                                             ATAN_K[3], ATAN_K[4]);
   double result;
   if (one_over_x)
-    result = M_PI_2 - fputil::multiply_add(pe, v, ATAN_T[val - 1]);
+    result = M_MATH_PI_2 - fputil::multiply_add(pe, v, ATAN_T[val - 1]);
   else
     result = fputil::multiply_add(pe, v, ATAN_T[val - 1]);
   return sign ? -result : result;


        


More information about the libc-commits mailing list