amd64/144448: sin() broken in libm on amd64

Eugene M. Zheganin emz at
Wed Mar 3 13:40:03 UTC 2010

>Number:         144448
>Category:       amd64
>Synopsis:       sin() broken in libm on amd64
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-amd64
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 03 13:40:02 UTC 2010
>Originator:     Eugene M. Zheganin
>Release:        7.2-RELEASE
Norma JSC.
FreeBSD 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root at  amd64
The following code, being compiled, is printing different results on i386 and amd64 platforms. The result on amd64 is invalid.

#include <stdio.h>
#include <math.h>

main (int argc, char **argv) {
    int i;
    double curval, prevval;

    prevval = 734;
    curval = sin(734);
    printf("%.15f %.15f\n", prevval, curval);
    for (i = 0; i < 19; i++) {
       curval = 16 * curval;
       prevval = curval;
       curval = sin(curval);
       printf("%.15f %.15f\n", prevval, curval);
Get sample code from , compile it, and run. Compare results from running the code on different architectures.


More information about the freebsd-amd64 mailing list