public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13629] New: clog() returns wrong values around z=1
@ 2012-01-27 14:12 fxcoudert at gcc dot gnu.org
  2012-01-27 15:57 ` [Bug math/13629] " tprince at computer dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2012-01-27 14:12 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13629

             Bug #: 13629
           Summary: clog() returns wrong values around z=1
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: fxcoudert@gcc.gnu.org
    Classification: Unclassified


On the example below, clog() is called on value 1+epsilon*I. The result (first
output line) is pretty different from the expected result, calculated in the
second output line as a second-order series expansion.

I could reproduce it with glibc versions 2.5, 2.11.2, and 2.13, on both i686
and x86_64 systems (and many compilers).


$ cat a.c                            
#include <math.h>
#include <complex.h>
#include <stdio.h>

int main ()
{
  complex double z, fz,gz;
  z = 1.0f + 0.00000001f*I;
  fz = clog(z);
  gz = (z-1) - (z-1)*(z-1)/2;
  printf (" %.15e + %.15ei\n", creal(fz), cimag(fz));
  printf (" %.15e + %.15ei\n", creal(gz), cimag(gz));
  return 0;
}
$ gcc a.c -lm -O0 -W -Wall -std=c99 && ./a.out
 0.000000000000000e+00 + 1.000000000000000e-08i
 5.000000000000001e-17 + 1.000000000000000e-08i

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-06-27 10:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 14:12 [Bug math/13629] New: clog() returns wrong values around z=1 fxcoudert at gcc dot gnu.org
2012-01-27 15:57 ` [Bug math/13629] " tprince at computer dot org
2012-01-27 15:58 ` tprince at computer dot org
2012-01-27 16:00 ` tprince at computer dot org
2012-03-03 21:28 ` jsm28 at gcc dot gnu.org
2012-03-20  0:39 ` jsm28 at gcc dot gnu.org
2012-07-26 11:36 ` jsm28 at gcc dot gnu.org
2012-07-31 14:26 ` jsm28 at gcc dot gnu.org
2012-09-25 19:49 ` jsm28 at gcc dot gnu.org
2014-06-27 10:03 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).