Last change
on this file since 503 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.5 KB
|
Line | |
---|
1 | |
---|
2 | /* @(#)z_cosh.c 1.0 98/08/13 */ |
---|
3 | |
---|
4 | /* |
---|
5 | |
---|
6 | FUNCTION |
---|
7 | <<cosh>>, <<coshf>>---hyperbolic cosine |
---|
8 | |
---|
9 | SYNOPSIS |
---|
10 | #include <math.h> |
---|
11 | double cosh(double <[x]>); |
---|
12 | float coshf(float <[x]>); |
---|
13 | |
---|
14 | DESCRIPTION |
---|
15 | |
---|
16 | <<cosh>> computes the hyperbolic cosine of the argument <[x]>. |
---|
17 | <<cosh(<[x]>)>> is defined as |
---|
18 | @ifnottex |
---|
19 | . (exp(x) + exp(-x))/2 |
---|
20 | @end ifnottex |
---|
21 | @tex |
---|
22 | $${(e^x + e^{-x})} \over 2$$ |
---|
23 | @end tex |
---|
24 | |
---|
25 | Angles are specified in radians. |
---|
26 | |
---|
27 | <<coshf>> is identical, save that it takes and returns <<float>>. |
---|
28 | |
---|
29 | RETURNS |
---|
30 | The computed value is returned. When the correct value would create |
---|
31 | an overflow, <<cosh>> returns the value <<HUGE_VAL>> with the |
---|
32 | appropriate sign, and the global value <<errno>> is set to <<ERANGE>>. |
---|
33 | |
---|
34 | You can modify error handling for these functions using the |
---|
35 | function <<matherr>>. |
---|
36 | |
---|
37 | PORTABILITY |
---|
38 | <<cosh>> is ANSI. |
---|
39 | <<coshf>> is an extension. |
---|
40 | |
---|
41 | QUICKREF |
---|
42 | cosh ansi pure |
---|
43 | coshf - pure |
---|
44 | */ |
---|
45 | |
---|
46 | /****************************************************************** |
---|
47 | * Hyperbolic Cosine |
---|
48 | * |
---|
49 | * Input: |
---|
50 | * x - floating point value |
---|
51 | * |
---|
52 | * Output: |
---|
53 | * hyperbolic cosine of x |
---|
54 | * |
---|
55 | * Description: |
---|
56 | * This routine returns the hyperbolic cosine of x. |
---|
57 | * |
---|
58 | *****************************************************************/ |
---|
59 | |
---|
60 | #include "fdlibm.h" |
---|
61 | #include "zmath.h" |
---|
62 | |
---|
63 | #ifndef _DOUBLE_IS_32BITS |
---|
64 | |
---|
65 | double |
---|
66 | cosh (double x) |
---|
67 | { |
---|
68 | return (sineh (x, 1)); |
---|
69 | } |
---|
70 | |
---|
71 | #endif /* _DOUBLE_IS_32BITS */ |
---|
Note: See
TracBrowser
for help on using the repository browser.