Bug 5490

Summary: cimagf gives incorrect results
Product: glibc Reporter: Ismail "cartman" Donmez <null>
Component: mathAssignee: Andreas Jaeger <aj>
Status: RESOLVED INVALID    
Severity: normal CC: glibc-bugs
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: i686-gnu-linux Target:
Build: Last reconfirmed:

Description Ismail "cartman" Donmez 2007-12-17 00:26:17 UTC
This is a stripped down testcase from gfortran testcases converted to C :

#include <complex.h>
#include <stdio.h>

int main() {
  float complex volatile z, one;
  z   = 5.0;
  one = 1.0;
  z   = cpowf (z, one);
  printf("%f\n", (double)cimagf(z));
  return 0;
}

prints -0.000141 with libc 2.7 where as it prins 0.000000 with libc 2.3.6 and
libc 2.4.11 on i686 host.
Comment 1 Ismail "cartman" Donmez 2007-12-17 00:41:11 UTC
Possibly a related problem:

#include <complex.h>
#include <stdio.h>

int main() {
  float complex volatile z;
  z   = 1.2 - 4.0*I;
  z   = clogf(z);
  printf("%lf\n", cimagf(z));
  return 0;
}

prints -0.000029 instead of -1.2793396 .
Comment 2 Ismail "cartman" Donmez 2007-12-17 19:21:56 UTC
-> Assign to math component
Comment 3 Ismail "cartman" Donmez 2007-12-18 14:47:44 UTC
math regression tests fail hence this is likely a gcc 4.3 problem instead.
Closing as Invalid.