UNPKG
@sgratzl/science
Version:
latest (2.0.0)
2.0.0
Scientific and statistical computing in JavaScript.
github.com/sgratzl/science.js
sgratzl/science.js
@sgratzl/science
/
src
/
core
/
expm1.js
7 lines
(6 loc)
•
164 B
JavaScript
View Raw
1
2
3
4
5
6
7
/** Compute exp(x) - 1 accurately for small x. */
export default function expm1(
x
) { return (
x
<
1
e-
5
&&
x
> -
1
e-
5
) ?
x
+ .
5
*
x
*
x
: Math.
exp
(x) -
1
; };