branch update for HEAD-2003021201
[reactos.git] / lib / crtdll / math / tanh.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2
3 #include <msvcrt/math.h>
4
5 double tanh(double x)
6 {
7   if (x > 50)
8     return 1;
9   else if (x < -50)
10     return -1;
11   else
12   {
13     const double ebig = exp(x);
14     const double esmall = 1.0/ebig;
15     return (ebig - esmall) / (ebig + esmall);
16   }
17 }