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:
parent
2eb47300cf
commit
f5f3a7a6d6
3 changed files with 3 additions and 29 deletions
|
|
@ -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))));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue