/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* INDENT OFF */
/*
* dcomplex ccosh(dcomplex z);
*
* z -z x -x
* e + e e (cos(y)+i*sin(y)) + e (cos(-y)+i*sin(-y))
* cosh z = -------------- = ---------------------------------------------
* 2 2
* x -x x -x
* cos(y) ( e + e ) + i*sin(y) (e - e )
* = --------------------------------------------
* 2
*
* = cos(y) cosh(x) + i sin(y) sinh(x)
*
* Implementation Note
* -------------------
*
* |x| -|x| |x| -2|x| -2|x| -P-4
* Note that e +- e = e ( 1 +- e ). If e < 2 , where
*
* P stands for the number of significant bits of the machine precision,
* |x|
* then the result will be rounded to e . Therefore, we have
*
* z
* e
* cosh z = ----- if |x| >= (P/2 + 2)*ln2
* 2
*
* ccosh(0,0)=(1,0)
* ccosh(0,inf)=(NaN,+-0)
* ccosh(0,NaN)=(NaN,+-0)
* ccosh(x,inf) = (NaN,NaN) for finite non-zero x
* ccosh(x,NaN) = (NaN,NaN) for finite non-zero x
* ccosh(inf,0) = (inf, 0)
* ccosh(inf,y) = (inf*cos(y),inf*sin(y)) for finite non-zero y
* ccosh(inf,inf) = (+-inf,NaN)
* ccosh(inf,NaN) = (+inf,NaN)
* ccosh(NaN,0) = (NaN,+-0)
* ccosh(NaN,y) = (NaN,NaN) for non-zero y
* ccosh(NaN,NaN) = (NaN,NaN)
*/
/* INDENT ON */
#include "complex_wrapper.h"
double t, x, y, S, C;
x = D_RE(z);
y = D_IM(z);
x = fabs(x);
y = fabs(y);
(void) sincos(y, &S, &C);
} else if (iy >= 0x7ff00000) {
} else {
}
} else {
t = __k_cexp(x, &n);
/* return exp(x)=t*2**n */
}
} else {
t = exp(x) * 0.5;
}
} else {
} else {
}
}
return (ans);
}