math: use sqrtl if FLT_EVAL_METHOD==2 in acosh and acoshf
authorSzabolcs Nagy <nsz@port70.net>
Mon, 7 Oct 2013 18:41:03 +0000 (18:41 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Mon, 7 Oct 2013 18:41:03 +0000 (18:41 +0000)
this makes acosh slightly more precise around 1.0 on i386

src/math/acosh.c
src/math/acoshf.c

index 4ce9b3d..badbf90 100644 (file)
@@ -1,5 +1,10 @@
 #include "libm.h"
 
+#if FLT_EVAL_METHOD==2
+#undef sqrt
+#define sqrt sqrtl
+#endif
+
 /* acosh(x) = log(x + sqrt(x*x-1)) */
 double acosh(double x)
 {
index 16550f1..8a4ec4d 100644 (file)
@@ -1,5 +1,13 @@
 #include "libm.h"
 
+#if FLT_EVAL_METHOD==2
+#undef sqrtf
+#define sqrtf sqrtl
+#elif FLT_EVAL_METHOD==1
+#undef sqrtf
+#define sqrtf sqrt
+#endif
+
 /* acosh(x) = log(x + sqrt(x*x-1)) */
 float acoshf(float x)
 {