---
The value 30 is a blind guesstimate of what's sensible; with that, I
get log() returning values close to the real values (differing only in
the third digit or so).
I'm not sure exactly how the original logic for the number of rounds
is supposed to work; with any value over 16, it will currently
run 0 rounds and return 0.
---
mingw-w64-crt/math/softmath/softmath_private.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mingw-w64-crt/math/softmath/softmath_private.h
b/mingw-w64-crt/math/softmath/softmath_private.h
index 72df747..401f7c6 100644
--- a/mingw-w64-crt/math/softmath/softmath_private.h
+++ b/mingw-w64-crt/math/softmath/softmath_private.h
@@ -61,6 +61,9 @@ static inline double softmath_log(double x)
else if (x < 0.0001)
aprox = 32768;
+ if (aprox < 30)
+ aprox = 30;
+
for(n = 0; n < aprox; n++)
{
result += bsd__ieee754_pow((x - 1.0) / (x + 1.0), 2 * n + 1) * (1.0 /
(2.0 * n + 1.0));
@@ -82,6 +85,9 @@ static inline float softmath_logf(float x)
else if (x < 0.0001)
aprox = 32768;
+ if (aprox < 30)
+ aprox = 30;
+
for(n = 0; n < aprox; n++)
{
result += bsd__ieee754_powf((x - 1.0) / (x + 1.0), 2 * n + 1) * (1.0 /
(2.0 * n + 1.0));
--
2.7.4
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public