Initial revision

This commit is contained in:
eck
1989-05-10 16:08:14 +00:00
parent f0cec58cf9
commit d2f7f252b2
20 changed files with 905 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/*
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*
* Author: Ceriel J.H. Jacobs
*/
/* $Header$ */
#include <errno.h>
#include <math.h>
#include "localmath.h"
double
sinh(double x)
{
int negx = x < 0;
if (negx) {
x = -x;
}
if (x > M_LN_MAX_D) {
/* exp(x) would overflow */
if (x >= M_LN_MAX_D + M_LN2) {
/* not representable */
x = HUGE_VAL;
errno = ERANGE;
}
else x = exp (x - M_LN2);
}
else {
double expx = exp(x);
x = 0.5 * (expx - 1.0/expx);
}
if (negx) {
return -x;
}
return x;
}