DEBSOURCES
Skip Quicknav
sources / micropython / 1.25.0%2Bds-1 / lib / libm_dbl / tanh.c
123456789101112
#include <math.h> double tanh(double x) { int sign = 0; if (x < 0) { sign = 1; x = -x; } x = expm1(-2 * x); x = x / (x + 2); return sign ? x : -x; }