J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 3 | * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 5 | * |
| 6 | * This code is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License version 2 only, as |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 8 | * published by the Free Software Foundation. Oracle designates this |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 9 | * particular file as subject to the "Classpath" exception as provided |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 10 | * by Oracle in the LICENSE file that accompanied this code. |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 15 | * version 2 for more details (a copy is included in the LICENSE file that |
| 16 | * accompanied this code). |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License version |
| 19 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 20 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 | * |
Kelly O'Hair | fe008ae | 2010-05-25 15:58:33 -0700 | [diff] [blame] | 22 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 23 | * or visit www.oracle.com if you need additional information or have any |
| 24 | * questions. |
J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | /* |
| 28 | * wrapper cosh(x) |
| 29 | */ |
| 30 | |
| 31 | #include "fdlibm.h" |
| 32 | |
| 33 | #ifdef __STDC__ |
| 34 | double cosh(double x) /* wrapper cosh */ |
| 35 | #else |
| 36 | double cosh(x) /* wrapper cosh */ |
| 37 | double x; |
| 38 | #endif |
| 39 | { |
| 40 | #ifdef _IEEE_LIBM |
| 41 | return __ieee754_cosh(x); |
| 42 | #else |
| 43 | double z; |
| 44 | z = __ieee754_cosh(x); |
| 45 | if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; |
| 46 | if(fabs(x)>7.10475860073943863426e+02) { |
| 47 | return __kernel_standard(x,x,5); /* cosh overflow */ |
| 48 | } else |
| 49 | return z; |
| 50 | #endif |
| 51 | } |