1: /*
   2:  *	"@(#)tanh.c	1.1"
   3:  */
   4: 
   5: /*
   6: 	tanh(arg) computes the hyperbolic tangent of its floating
   7: 	point argument.
   8: 
   9: 	sinh and cosh are called except for large arguments, which
  10: 	would cause overflow improperly.
  11: */
  12: 
  13: double sinh(), cosh();
  14: 
  15: double
  16: tanh(arg)
  17: double arg;
  18: {
  19:     double sign;
  20: 
  21:     sign = 1.;
  22:     if(arg < 0.){
  23:         arg = -arg;
  24:         sign = -1.;
  25:     }
  26: 
  27:     if(arg > 21.)
  28:         return(sign);
  29: 
  30:     return(sign*sinh(arg)/cosh(arg));
  31: }

Defined functions

tanh defined in line 15; used 5 times
Last modified: 1983-05-20
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 596
Valid CSS Valid XHTML 1.0 Strict