summaryrefslogtreecommitdiff
path: root/Python/pytime.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-05-31 20:01:05 +0200
committerStefan Krah <skrah@bytereef.org>2012-05-31 20:01:05 +0200
commit4d3e0a695aec69b6c3f6638a65bd7469cd4fd568 (patch)
tree6ec0be80830470b2a510ab8434f856a26219d50a /Python/pytime.c
parentd3487be8768bc763cdd931e0de73e2e7d3d3e0a0 (diff)
downloadcpython-git-4d3e0a695aec69b6c3f6638a65bd7469cd4fd568.tar.gz
Improve Underflow handling in the correct-rounding loop. The case for
Underflow to zero hasn't changed: _mpd_qexp() internally uses MIN_EMIN, so the result would also underflow to zero for all emin > MIN_EMIN. In case digits are left, the informal argument is as follows: Underflow can occur only once in the last multiplication of the power stage (in the Horner stage Underflow provably cannot occur, and if Underflow occurred twice in the power stage, the result would underflow to zero on the second occasion). Since there is no double rounding during Underflow, the effective work precision is now 1 <= result->digits < prec. It can be shown by a somewhat tedious argument that abs(result - e**x) < ulp(result, result->digits). Therefore the correct rounding loop now uses ulp(result, result->digits) to generate the bounds for e**x in case of Underflow.
Diffstat (limited to 'Python/pytime.c')
0 files changed, 0 insertions, 0 deletions