AngouriMath

Navigation

← Back to list of members

NaturalLogarithm​(PeterO.​Numbers.​EDecimal,​PeterO.​Numbers.​EContext)

 Method (no overloads)

Summary

The natural logarithm of x to the precision of
context: the argument written as a mantissa times a power of ten
and of two, the mantissa brought between 1/sqrt(2) and sqrt(2), and
the mantissa divided by the nearest t = 1 + j/64, whose logarithm the
constant cache holds, and 2 artanh((q - 1)/(q + 1)) for the quotient, a
series in a square below 1/65536 -- twenty-five terms at a hundred digits
where the series straight from [1/sqrt(2), sqrt(2)] was eighty -- in fixed
point. PeterO's Log(PeterO.Numbers.EContext) is seven hundred microseconds
at a hundred digits; this is under ten. An argument within
[1/sqrt(2), sqrt(2)] goes to the reduction as it is, and one within 1/128 of
1 to the series as it is, so a value near 1 keeps every digit rather than losing
them to ln 10 - 3 ln 2 - ... cancelling. Zero, a negative, an infinity and
NaN are PeterO's answers.
https://github.com/asc-community/AngouriMath/issues/1338

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online