#12557: RDF(1e-17).log() gives NaN
------------------------------------+---------------------------------------
Reporter: mariah | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-5.1
Component: basic arithmetic | Resolution:
Keywords: sd40.5 | Work issues:
Report Upstream: N/A | Reviewers: Volker Braun
Authors: | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Comment (by vbraun):
I tried `CDF(x).log().real()` for fun but of course want to test
`RDF(x).log()`, thats my fault.
The whole branch calling `gsl_sf_log_1plusx(self._value - 1)` for values
close to 1 nonsense. Sure the `gsl_sf_log_1plusx` function is more
accurate, but now all the error comes from the numerically unstable
`self._value - 1`.
Also the doctests fail for me, and I need to set the bound at 2*ulp for it
to pass.
Finally, you must doctest `check_error(x)` and not `check_error(RDF(x))`.
Otherwise, the exact log value (for the comparison) is computed at the
wrong value:
{{{
sage: x = 0.999
sage: x.parent()
Real Field with 53 bits of precision
sage: x.n(100) # as expected
0.99900000000000000000000000000
sage: RDF(x).n(100) # not the intended value of x.n(100)
0.99899999999999999911182158030
}}}
Updated patch follows...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12557#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.