From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9344 invoked by alias); 19 Apr 2010 17:43:11 -0000 Received: (qmail 7880 invoked by uid 48); 19 Apr 2010 17:42:53 -0000 Date: Mon, 19 Apr 2010 17:43:00 -0000 From: "tomdean at speakeasy dot org" To: glibc-bugs@sources.redhat.com Message-ID: <20100419174251.11521.tomdean@speakeasy.org> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug math/11521] New: Ctanh Returns Incorrect Values X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00147.txt.bz2 ctanh returns incorrect values. Code below. Build test-tanh: gcc test-tanh.c -o test-tanh -lm ./test-tanh-c 711 libc version 2.10.1 libc release stable arg = 7.110000e+02 + 7.110000e+02 * i sinh (arg) = inf + inf * i cosh (arg) = inf + inf * i s/c = nan + nan * i (should be 1 + 0 * i) tanh (arg) = 0.000000e+00 + 0.000000e+00 * i (should be 1 + 0 * i) ==== test-tanh.c ======================================== #include #include #include #define _GNU_SOURCE #include int main (int argc, char **argv) { long double complex arg = 1 + _Complex_I; long double complex s, c, r, t; long mult; if (argc == 2) { mult = atol(argv[1]); } else { mult = 50000L; } arg *= mult; s = csinh (arg); c = ccosh (arg); r = s / c; t = ctanh (arg); printf ("libc version %s\n", gnu_get_libc_version ()); printf ("libc release %s\n", gnu_get_libc_release ()); printf ("arg = %e + %e * i\n", creal (arg), cimag (arg)); printf ("sinh (arg) = %e + %e * i\n", creal (s), cimag (s)); printf ("cosh (arg) = %e + %e * i\n", creal (c), cimag (c)); printf("s/c = %e + %e * i (should be 1 + 0 * i)\n", creal (r), cimag (r)); printf ("tanh (arg) = %e + %e * i (should be 1 + 0 * i)\n", creal (t), cimag (t)); return 0; } -- Summary: Ctanh Returns Incorrect Values Product: glibc Version: 2.10 Status: NEW Severity: normal Priority: P2 Component: math AssignedTo: aj at suse dot de ReportedBy: tomdean at speakeasy dot org CC: glibc-bugs at sources dot redhat dot com,tomdean at speakeasy dot org GCC host triplet: ubuntu 9.10 GCC target triplet: ubuntu 9.10 http://sourceware.org/bugzilla/show_bug.cgi?id=11521 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.