mingw-w64-crt/math/arm-common/acosh.c
raw| 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | * This file is part of the mingw-w64 runtime package. |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | */ |
| 6 | |
| 7 | #include <math.h> |
| 8 | |
| 9 | double acosh(double x) |
| 10 | { |
| 11 | if (x < 1.0) |
| 12 | return NAN; |
| 13 | if (isinf(x*x)) |
| 14 | return log(2) + log(x); |
| 15 | return log(x + sqrt(x*x - 1)); |
| 16 | } |