1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ 2 #include <math.h> 3 4 #ifdef _MSC_VER 5 #pragma function(sinh) 6 #endif 7 8 /* 9 * @implemented 10 */ 11 double sinh(double x) 12 { 13 if(x >= 0.0) 14 { 15 const double epos = exp(x); 16 return (epos - 1.0/epos) / 2.0; 17 } 18 else 19 { 20 const double eneg = exp(-x); 21 return (1.0/eneg - eneg) / 2.0; 22 } 23 } 24