\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\right)
\end{array}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \log \log \left(e^{t_0}\right)\\
e^{\frac{t_3 \cdot t_3 - x \cdot x}{x + t_3}}
\end{array}\\
\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.0))))
t_1
(let* ((t_3 (log (log (exp t_0)))))
(exp (/ (- (* t_3 t_3) (* x x)) (+ x t_3)))))))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.0)) {
tmp = t_1;
} else {
double t_3 = log(log(exp(t_0)));
tmp = exp(((t_3 * t_3) - (x * x)) / (x + t_3));
}
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.8
Simplified61.8
Applied add-exp-log_binary6461.8
Applied div-exp_binary6461.8
Taylor expanded in x around inf 24.2
Simplified24.2
if 0.0 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 1Initial program 11.4
Simplified11.2
Applied add-exp-log_binary6411.2
Applied div-exp_binary6411.2
Applied add-log-exp_binary6413.0
Applied flip--_binary6413.1
Final simplification23.7
herbie shell --seed 2021344
(FPCore (x)
:name "expfmod"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))