Changes between Version 11 and Version 24 of Ticket #19797


Ignore:
Timestamp:
12/31/15 09:01:04 (5 years ago)
Author:
jdemeyer
Comment:

Replying to rws:

second, even power of abs(x) is rewritten as x*x.conj() to the half power.

It's really this second part which is problematic.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19797

    • Property Summary changed from Build GSL in IEEE 754 compliant mode to Disallow automatic abs() simplifications resulting non-real expressions
  • Ticket #19797 – Description

    v11 v24  
    1 The following can happen on some hardware architectures due to fused multiply-add instructions:
     1Calling `abs()` on certain expressions can yield something which is not guaranteed to be evaluated as a real number:
    22{{{
    3 sage: x = CDF(0.99, 0.2)
    4 sage: x * x.conj()
    5 1.0201 + 1.1102230246251575e-19*I
     3sage: abs(x^2)
     4x*conjugate(x)
    65}}}
    76
    8 It's annoying because it causes doctest failures, for example
     7In the presence of numerical noise, the expression `x*conjugate(x)` can actually a non-zero imaginary part. And even if there is no noise, the type would be wrong: complex instead of real.
     8
     9This causes the following doctest failure:
    910{{{
    1011sage -t --long --warn-long 62.3 src/sage/symbolic/expression.pyx
     
    1920**********************************************************************
    2021}}}
     22
    2123See https://github.com/pynac/pynac/issues/117