Difference between revisions of "Expm1"
(Created page with "''New to Analytica 6.3'' == _Expm1(x) == This is an internal function that is used to evaluate an expression of the form: :<code>Exp(x)-1</code> or :<code>1-Exp(...") |
|||
Line 1: | Line 1: | ||
+ | [[category:Math Functions]] | ||
''New to [[Analytica 6.3]]'' | ''New to [[Analytica 6.3]]'' | ||
Revision as of 23:35, 27 October 2022
New to Analytica 6.3
_Expm1(x)
This is an internal function that is used to evaluate an expression of the form:
Exp(x)-1
or
1-Exp(x)
In the second case, the result is the negation of _Expm1(x)
.
The result of evaluating _Expm1(x)
is Exp(x)-1
. Direct evaluation of Exp(x)-1
loses precision when x
is small (i.e., abs(x)<<1
), so by using _Expm1(x)
instead it avoids numeric round-off problems.
When the parser sees an expression in either of the above forms, it replaces the expression with a direct call to _Expm1(x)
.
Note: For very small x, Exp(x)-1
≈1.
Examples
Exp(1e-20)-1 → 1e-20
Local ex:=Exp(1-20) Do ex-1
→ 0 { This one does not use _Expm1, and hence looses all precision }
See also
Comments
Enable comment auto-refresher