sinl (and probably other functions) is not computed correctly

Bug #540771 reported by Eli Osherovich
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

sinl fails to return a correct result for large arguments.

Consider the following file:
$ cat sintest.c
#include <stdio.h>
#include <math.h>

int
main (void) {
  double arg = 1e22;
  long double larg = 1e22L;

  printf("double precision: sin(1e22) = %.16lf\n", sin(arg));
  printf("quad precison: sin(1e22)=%.16Lf\n", sinl(larg));

  return 0;
}

when compiled by gcc
$ gcc sintest.c -lm

it produces wrong results
$ ./a.out
double precision: sin(1e22) = -0.8522008497671888
quad precison: sin(1e22)=0.4626130407646018

This problem is probably due to the use of 'fsin' function which does not support such a big number. However, from the description of 'sinl' one would expect full support for long double arguments.

P.S.
The same code compiled by the Intel C compiler produces good results.

ProblemType: Bug
Architecture: amd64
Date: Thu Mar 18 11:01:02 2010
DistroRelease: Ubuntu 9.10
Package: libc6 2.11.1-0ubuntu4
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-16.25-generic
SourcePackage: eglibc
Uname: Linux 2.6.32-16-generic x86_64

Revision history for this message
Eli Osherovich (eli-osherovich) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.