X-Git-Url: http://nsz.repo.hu/git/?p=libm;a=blobdiff_plain;f=src%2Fcmath%2Fcacosh.c;fp=src%2Fcmath%2Fcacosh.c;h=c2dfc1baff766d49d7873d1d037e4709a92eaaf7;hp=89cbb1f172f7908edce146fdeee756ae4936884d;hb=5718e964d8a5c273a91b4d86d16926f54151c58f;hpb=1305df184d9d04274ce170864c92af8cbeae23e2 diff --git a/src/cmath/cacosh.c b/src/cmath/cacosh.c index 89cbb1f..c2dfc1b 100644 --- a/src/cmath/cacosh.c +++ b/src/cmath/cacosh.c @@ -1,48 +1,9 @@ -/* origin: OpenBSD /usr/src/lib/libm/src/s_cacosh.c */ -/* - * Copyright (c) 2008 Stephen L. Moshier - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* - * Complex inverse hyperbolic cosine - * - * - * SYNOPSIS: - * - * double complex cacosh(); - * double complex z, w; - * - * w = cacosh (z); - * - * - * DESCRIPTION: - * - * acosh z = i acos z . - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -10,+10 30000 1.6e-14 2.1e-15 - * - */ - -// FIXME: reeval - #include "libm.h" +/* acosh(z) = i acos(z) */ + double complex cacosh(double complex z) { - return I * cacos(z); + z = cacos(z); + return cpack(-cimag(z), creal(z)); }