April 13, 2017
https://issues.dlang.org/show_bug.cgi?id=17324

          Issue ID: 17324
           Summary: Floating point 1/(1/x) > 0 if x > 0 not generally true
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: qs.il.paperinik@gmail.com

In https://dlang.org/d-floating-point.html it is claimed:
"[...] in order to preserve identities such as: if x>0, then 1/(1/x) > 0."

But this is wrong, the identity doesn't hold anyway! Compile the following with DMD v2.074.0.

void main()
{
    import std.math : nextafter;
    double x = nextafter(0.0, 1.0); // produce smallest denormal number > 0.
    assert(x > 0);
    double y = 1/x;
    assert(y > 0);
    assert(1/y > 0); // fails
    assert(1/(1/x) > 0); // passes due to wrong optimuzation
}

--