Difference between revisions of "Log1p"
(Created page with "''New to Analytica 6.3'' == _Log1p(x'', base) == This is an internal function that is used to evaluate calls having the following syntactic forms: * <code>Ln( x + 1...") |
|||
Line 1: | Line 1: | ||
+ | [[category:Math Functions]] | ||
''New to [[Analytica 6.3]]'' | ''New to [[Analytica 6.3]]'' | ||
Latest revision as of 23:34, 27 October 2022
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
Enable comment auto-refresher