Remove FastMath.exp

FastMath.exp was neither continuous nor strictly monotonically increasing for x < -1 and therefore inappropriate for the intended purpose.
This commit is contained in:
quaelnix 2023-01-27 18:01:56 +01:00 committed by ulteq
parent 2eb47300cf
commit f5f3a7a6d6
3 changed files with 3 additions and 29 deletions

View file

@ -1,21 +0,0 @@
package btools.util;
/**
* Some fast approximations to mathematical functions
*
* @author ab
*/
public class FastMath {
/**
* Approximation to Math.exp for small negative arguments
*/
public static double exp(double e) {
double x = e;
double f = 1.;
while (e < -1.) {
e += 1.;
f *= 0.367879;
}
return f * (1. + x * (1. + x * (0.5 + x * (0.166667 + 0.0416667 * x))));
}
}