\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\begin{array}{l}
t_0 := \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right)\\
t_1 := e^{-x}\\
\mathbf{if}\;\begin{array}{l}
t_2 := t_0 \cdot t_1\\
t_2 \leq 0 \lor \neg \left(t_2 \leq 1.0000000000000002\right)
\end{array}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;e^{\sqrt[3]{{\left(\log t_0 - x\right)}^{3}}}\\
\end{array}
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (fmod (exp x) (sqrt (cos x)))) (t_1 (exp (- x))))
(if (let* ((t_2 (* t_0 t_1)))
(or (<= t_2 0.0) (not (<= t_2 1.0000000000000002))))
t_1
(exp (cbrt (pow (- (log t_0) x) 3.0))))))double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
double code(double x) {
double t_0 = fmod(exp(x), sqrt(cos(x)));
double t_1 = exp(-x);
double t_2 = t_0 * t_1;
double tmp;
if ((t_2 <= 0.0) || !(t_2 <= 1.0000000000000002)) {
tmp = t_1;
} else {
tmp = exp(cbrt(pow((log(t_0) - x), 3.0)));
}
return tmp;
}



Bits error versus x
if (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 0.0 or 1.00000000000000022 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) Initial program 61.8
Simplified61.8
Applied add-exp-log_binary6461.8
Applied div-exp_binary6461.8
Taylor expanded in x around inf 23.9
if 0.0 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 1.00000000000000022Initial program 12.3
Simplified12.1
Applied add-exp-log_binary6412.1
Applied div-exp_binary6412.1
Applied add-cbrt-cube_binary6412.1
Simplified12.1
Final simplification23.4
herbie shell --seed 2022081
(FPCore (x)
:name "expfmod"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))