AngouriMath

Navigation

← Back to list of members

MayBeASmallRational​(PeterO.​Numbers.​EDecimal,​System.​Int32,​System.​Double)

 Method (no overloads)

Summary

Whether num may be within the exact search's tolerance of a
rational with a numerator and a denominator within
MaxAbsNumeratorOrDenominatorValue, decided by the
same continued fraction in Double and, where the double cannot
tell, in a double-double. A false is reliable; a
true is only a reason to run the exact search.

Remarks

The exact search accepts a level whose remainder is below the integer part
times PrecisionErrorZeroRange, ten to the minus
sixteen. In a double the remainder at a level carries an error of the value's
representation error, two to the minus fifty-two, times the square of that
level's convergent denominator; the tolerance here is the exact one widened by
that bound, so a value the exact search would accept is never refused, and
where the bound has grown past a tenth the double can no longer tell. A
double-double -- a pair of doubles, a hundred and six bits -- starts from an
error of ten to the minus twenty-eight, which the square of any denominator
within the bound leaves below ten to the minus twelve, so it decides every
value the double could not. A false yes costs the exact search, which then
refuses; it was what every value paid.
Both are read off the mantissa's leading bits and the exponent directly:
PeterO's own conversions to a double or a decimal round the whole
hundred-digit mantissa and cost two to three microseconds, as much as the
arithmetic they were meant to spare. The decimal ran fifteen divisions of
Decimal where the double-double runs fifteen of a few
floating-point operations each, and a value near a short decimal -- a
polynomial at 0.37000000000001234 is near one at every node -- paid two
microseconds in it.

























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