\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\begin{array}{l}
\mathbf{if}\;x \le 5.249326471263704397071782830437244871113 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{-1}{3} \cdot x\right) \cdot x, x, \mathsf{fma}\left(\frac{2}{15}, {x}^{5}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\tanh x \cdot \left(\tanh x \cdot \tanh x\right)}\\
\end{array}double f(double x) {
double r2990941 = x;
double r2990942 = exp(r2990941);
double r2990943 = -r2990941;
double r2990944 = exp(r2990943);
double r2990945 = r2990942 - r2990944;
double r2990946 = r2990942 + r2990944;
double r2990947 = r2990945 / r2990946;
return r2990947;
}
double f(double x) {
double r2990948 = x;
double r2990949 = 5.249326471263704e-09;
bool r2990950 = r2990948 <= r2990949;
double r2990951 = -0.3333333333333333;
double r2990952 = r2990951 * r2990948;
double r2990953 = r2990952 * r2990948;
double r2990954 = 0.13333333333333333;
double r2990955 = 5.0;
double r2990956 = pow(r2990948, r2990955);
double r2990957 = fma(r2990954, r2990956, r2990948);
double r2990958 = fma(r2990953, r2990948, r2990957);
double r2990959 = tanh(r2990948);
double r2990960 = r2990959 * r2990959;
double r2990961 = r2990959 * r2990960;
double r2990962 = cbrt(r2990961);
double r2990963 = r2990950 ? r2990958 : r2990962;
return r2990963;
}



Bits error versus x
if x < 5.249326471263704e-09Initial program 59.0
rmApplied tanh-undef0.0
Taylor expanded around 0 1.0
Simplified1.0
if 5.249326471263704e-09 < x Initial program 28.3
rmApplied tanh-undef0.1
rmApplied add-cbrt-cube0.4
Final simplification1.0
herbie shell --seed 2019169 +o rules:numerics
(FPCore (x)
:name "Hyperbolic tangent"
(/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))