mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-math: use log1p(x) instead of log(1.0+x)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user