diff options
author | 2015-07-16 13:29:11 +0000 | |
---|---|---|
committer | 2015-07-16 13:29:11 +0000 | |
commit | bbd647e6a3b95d13fe73ae9d2afe81311675daef (patch) | |
tree | be02757c11f857b99bcc5011838f13665fb55a23 /lib/libm/src | |
parent | Move grab/release of the kernel_lock for softintrs from the ASM stubs to (diff) | |
download | wireguard-openbsd-bbd647e6a3b95d13fe73ae9d2afe81311675daef.tar.xz wireguard-openbsd-bbd647e6a3b95d13fe73ae9d2afe81311675daef.zip |
Signs of cacosh/cacoshf were not always correct (e.g., -1.1 -1.1i),
as found by fortran regression tests. Also added some complex
regression tests for cacosh, casinh, catanh.
Reported by John Marino @ DragonFlyBSD.
Diffstat (limited to 'lib/libm/src')
-rw-r--r-- | lib/libm/src/s_cacosh.c | 4 | ||||
-rw-r--r-- | lib/libm/src/s_cacoshf.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libm/src/s_cacosh.c b/lib/libm/src/s_cacosh.c index 75af1a35c08..6ed364fdcdb 100644 --- a/lib/libm/src/s_cacosh.c +++ b/lib/libm/src/s_cacosh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cacosh.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */ +/* $OpenBSD: s_cacosh.c,v 1.7 2015/07/16 13:29:11 martynas Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -51,7 +51,7 @@ cacosh(double complex z) { double complex w; - w = I * cacos (z); + w = clog(z + csqrt(z + 1) * csqrt(z - 1)); return (w); } diff --git a/lib/libm/src/s_cacoshf.c b/lib/libm/src/s_cacoshf.c index d81f7843c91..16016be3b33 100644 --- a/lib/libm/src/s_cacoshf.c +++ b/lib/libm/src/s_cacoshf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cacoshf.c,v 1.1 2008/09/07 20:36:09 martynas Exp $ */ +/* $OpenBSD: s_cacoshf.c,v 1.2 2015/07/16 13:29:11 martynas Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> * @@ -50,6 +50,6 @@ cacoshf(float complex z) { float complex w; - w = I * cacosf (z); + w = clogf(z + csqrtf(z + 1) * csqrtf(z - 1)); return (w); } |