1 2 3 4 5 6 7
#include <math.h> double tanh ( double x ) { long double y = exp (x + x); return (y - 1.) / (y + 1.); }