Expm1

Revision as of 23:08, 27 October 2022 by Lchrisman (talk | contribs) (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(...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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


You are not allowed to post comments.