\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;\begin{array}{l}
t_1 := \left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot t_0\\
t_1 \leq 0 \lor \neg \left(t_1 \leq 1\right)
\end{array}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt[3]{\cos x}\\
e^{\log \left(\left(e^{x}\right) \bmod \left(\left|t_2\right| \cdot \sqrt{t_2}\right)\right) - x}
\end{array}\\
\end{array}
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (- x))))
(if (let* ((t_1 (* (fmod (exp x) (sqrt (cos x))) t_0)))
(or (<= t_1 0.0) (not (<= t_1 1.0))))
t_0
(let* ((t_2 (cbrt (cos x))))
(exp (- (log (fmod (exp x) (* (fabs t_2) (sqrt t_2)))) x))))))double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
double code(double x) {
double t_0 = exp(-x);
double t_1 = fmod(exp(x), sqrt(cos(x))) * t_0;
double tmp;
if ((t_1 <= 0.0) || !(t_1 <= 1.0)) {
tmp = t_0;
} else {
double t_2 = cbrt(cos(x));
tmp = exp(log(fmod(exp(x), (fabs(t_2) * sqrt(t_2)))) - x);
}
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 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) Initial program 61.7
Simplified61.7
Applied add-cube-cbrt_binary6461.7
Applied sqrt-prod_binary6461.7
Simplified61.7
Applied add-exp-log_binary6461.7
Applied div-exp_binary6461.7
Taylor expanded in x around inf 24.8
Simplified24.8
if 0.0 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 1Initial program 13.4
Simplified13.3
Applied add-cube-cbrt_binary6413.6
Applied sqrt-prod_binary6413.6
Simplified13.6
Applied add-exp-log_binary6413.5
Applied div-exp_binary6413.5
Final simplification24.3
herbie shell --seed 2021215
(FPCore (x)
:name "expfmod"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))