\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\begin{array}{l}
t_0 := \sqrt{\mathsf{log1p}\left(\sqrt{\cos x}\right)}\\
t_1 := \sqrt[3]{\mathsf{expm1}\left(t_0 \cdot t_0\right)}\\
\frac{\left(\left(e^{x}\right) \bmod \left(t_1 \cdot \left(t_1 \cdot t_1\right)\right)\right)}{e^{x}}
\end{array}
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
(FPCore (x) :precision binary64 (let* ((t_0 (sqrt (log1p (sqrt (cos x))))) (t_1 (cbrt (expm1 (* t_0 t_0))))) (/ (fmod (exp x) (* t_1 (* t_1 t_1))) (exp x))))
double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
double code(double x) {
double t_0 = sqrt(log1p(sqrt(cos(x))));
double t_1 = cbrt(expm1(t_0 * t_0));
return fmod(exp(x), (t_1 * (t_1 * t_1))) / exp(x);
}



Bits error versus x
Initial program 59.5
Simplified59.5
Applied expm1-log1p-u_binary6459.5
Applied add-sqr-sqrt_binary6457.9
Applied add-cube-cbrt_binary6435.6
Final simplification35.6
herbie shell --seed 2022024
(FPCore (x)
:name "expfmod"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))