| delorie.com/archives/browse.cgi | search |
| From: | gpk AT physics DOT att DOT com |
| Date: | Fri, 12 Mar 93 11:29:09 EST |
| Original-From: | physics!gpk (Greg Kochanski) |
| To: | djgpp AT sun DOT soe DOT clarkson DOT edu |
| Subject: | Correct tanh() |
#include <math.h>
double tanh(double x)
{
const double ebig = exp(x);
const double esmall = 1.0/ebig;
return (ebig - esmall) / (ebig + esmall);
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |