http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47062

           Summary: -mfpmath=sse,387 causes pow() to produce incorrect
                    results
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: b...@arklinux.org
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu
             Build: x86_64-pc-linux-gnu


If (e)glibc is compiled with -mfpmath=sse,387, the pow() (and __builtin_pow())
function provides incorrect [beyond expectable inaccuracies] results.

#include <math.h>
#include <stdio.h>
int main(int argc, char **argv) {
    double n = 0.703167;
    printf("%f %f %f\n", pow(n, 1.0/2.2), __builtin_pow(n, 1.0/2.2),
pow(0.703167, 1.0/2.2));
}

(correctly) results in

0.852081 0.852081 0.852081

without -mfpmath=sse,387.
With -mfpmath=sse,387, the result is

1.000014 1.000014 0.852081

Reply via email to