www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/03/12/12:29:13

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);
}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019