Log1p

Revision as of 23:34, 27 October 2022 by Lchrisman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

New to Analytica 6.3

_Log1p(x, base)

This is an internal function that is used to evaluate calls having the following syntactic forms:

When the parser sees one of these syntactic forms (with a literal constant 1), it replaces the addition and call with a call to _Log1p. When x is very small, 1+x loses precision -- in fact, when abs(x)<1e-16 all precision from x is lost and 1+x evaluates to exactly 1, such that the logarithm is 0. However, the true answer is approximately x. By using _Log1p instead, it avoids this loss of precision.

This function is usually not called directly (but can be). It is automatically selected.

Examples

Local c := 1 + 1e-20 Do Ln(c) → 0 { Did not substitute _Log1p, lost precision }
Ln( 1 + 1e-20 ) → 1e-20
_Log1p(1e-20) → 1e-20

See also

Comments


You are not allowed to post comments.