mruby-math: use log1p(x) instead of log(1.0+x)

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-01-09 07:59:42 +09:00
parent 8a2e88390b
commit 51c4c4716a
+1 -1
View File
@@ -74,7 +74,7 @@ atanh(double x)
}
else {
/* Basic formula for atanh */
y = 0.5 * (log(1.0+x) - log(1.0-x));
y = 0.5 * (log1p(x) - log1p(-x));
}
return y;