\frac{2}{e^{x} + e^{-x}}\sqrt[3]{0.5 \cdot \frac{2}{{\cosh x}^{3}}}(FPCore (x) :precision binary64 (/ 2.0 (+ (exp x) (exp (- x)))))
(FPCore (x) :precision binary64 (cbrt (* 0.5 (/ 2.0 (pow (cosh x) 3.0)))))
double code(double x) {
return 2.0 / (exp(x) + exp(-x));
}
double code(double x) {
return cbrt(0.5 * (2.0 / pow(cosh(x), 3.0)));
}



Bits error versus x
Results
Initial program 0.0
rmApplied add-cbrt-cube_binary640.1
Simplified0.1
rmApplied cosh-undef_binary640.1
Applied add-cube-cbrt_binary641.0
Applied times-frac_binary641.0
Applied unpow-prod-down_binary640.8
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021175
(FPCore (x)
:name "Hyperbolic secant"
:precision binary64
(/ 2.0 (+ (exp x) (exp (- x)))))