|
|
1.1 root 1: /*
2: tanh(arg) computes the hyperbolic tangent of its floating
3: point argument.
4:
5: sinh and cosh are called except for large arguments, which
6: would cause overflow improperly.
7: */
8:
9: double sinh(), cosh();
10:
11: double
12: tanh(arg) double arg; {
13:
14: double sign;
15:
16: sign = 1.;
17: if(arg < 0.){
18: arg = -arg;
19: sign = -1.;
20: }
21:
22: if(arg > 21.){
23: return(sign);
24: }
25:
26: return(sign*sinh(arg)/cosh(arg));
27: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.