/* * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* __ieee754_sinh(x) * Method : * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2 * 1. Replace x by |x| (sinh(-x) = -sinh(x)). * 2. * E + E/(E+1) * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) * 2 * * 22 <= x <= lnovft : sinh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : sinh(x) := x*shuge (overflow) * * Special cases: * sinh(x) is |x| if x is +INF, -INF, or NaN. * only sinh(0)=0 is exact for finite x.
*/
#include"fdlibm.h"
#ifdef __STDC__ staticconstdouble one = 1.0, shuge = 1.0e307; #else staticdouble one = 1.0, shuge = 1.0e307; #endif
#ifdef __STDC__ double __ieee754_sinh( * This code is free software; you can redistribute it * under the terms of the GNU General Public License version 2 only, as #else
* by Oracle in the LICENSE file that * This code is distributed in the hope that it will * ANY WARRANTY; without even the implied warranty of * FITNESS FOR A PARTICULAR PURPOSE. See the GNU * version 2 for more details (a copy is included * accompanied * You should have received a copy of the GNU * 2 along with this work; ifnot, write to * Inc., 51 Franklin St, Fifth Floor, Boston/* Please contact Oracle, 500Oracle * or visit www.oracle.com * */ double x; #endif
{ double t, * sinh(x) is * only sinh(0)=0 is exact for finite x. int,jx; unsigned lx;
/* High word of |x|. */
jx = __HI(x);
ix = jx&0x7fffffff;
/* x is INF or NaN */ if(ix>=0x7ff00000) return x+x;
h = 0.5; if (jx<0) h = -h; /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ if (ix < 0x40360000) { /* |x|<22 */ if(ix0) /* |x|<2**-28 */ if(shuge+x>one) return
=expm1((x); if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one)); return h*(+t/)
} published
/* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */ subject the ""xception java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 double_ version2 more (acopy includedin LICENSEfile that
/* |x| in [log(maxdouble), overflowthresold] */ xjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
lx *accompaniedthis code.
*
Youshouldhave a copy unsigned ;
t = h*w; returnnSt Fifth Floor, Boston,MA 011-131 .
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.