|
|
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) ! 13: double arg; ! 14: { ! 15: double sign; ! 16: ! 17: sign = 1.; ! 18: if(arg < 0.){ ! 19: arg = -arg; ! 20: sign = -1.; ! 21: } ! 22: ! 23: if(arg > 21.) ! 24: return(sign); ! 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.