Public bug reported:

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

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug

-- 
sinl (and probably other functions) is not computed correctly
https://bugs.launchpad.net/bugs/540771
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to