
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
def code(x): return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
function code(x) return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* (fmod (exp x) (sqrt (cos x))) (exp (- x))))
double code(double x) {
return fmod(exp(x), sqrt(cos(x))) * exp(-x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod(exp(x), sqrt(cos(x))) * exp(-x)
end function
def code(x): return math.fmod(math.exp(x), math.sqrt(math.cos(x))) * math.exp(-x)
function code(x) return Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) end
code[x_] := N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x}
\end{array}
(FPCore (x) :precision binary64 (if (<= (* (fmod (exp x) (sqrt (cos x))) (exp (- x))) 2.0) (/ (fmod (exp x) (* 3.0 (log (cbrt E)))) (exp x)) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if ((fmod(exp(x), sqrt(cos(x))) * exp(-x)) <= 2.0) {
tmp = fmod(exp(x), (3.0 * log(cbrt(((double) M_E))))) / exp(x);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(rem(exp(x), sqrt(cos(x))) * exp(Float64(-x))) <= 2.0) tmp = Float64(rem(exp(x), Float64(3.0 * log(cbrt(exp(1))))) / exp(x)); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision], 2.0], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(3.0 * N[Log[N[Power[E, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(e^{x}\right) \bmod \left(\sqrt{\cos x}\right)\right) \cdot e^{-x} \leq 2:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(3 \cdot \log \left(\sqrt[3]{e}\right)\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) < 2Initial program 8.4%
exp-neg8.5%
associate-*r/8.5%
*-rgt-identity8.5%
Simplified8.5%
add-log-exp8.5%
add-cube-cbrt56.6%
log-prod56.7%
Applied egg-rr56.1%
log-pow56.1%
distribute-lft1-in56.1%
metadata-eval56.1%
cos-056.1%
metadata-eval56.1%
exp-1-e56.1%
Simplified56.1%
if 2 < (*.f64 (fmod.f64 (exp.f64 x) (sqrt.f64 (cos.f64 x))) (exp.f64 (neg.f64 x))) Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr98.1%
+-lft-identity98.1%
cos-098.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in x around 0 98.2%
Final simplification65.0%
(FPCore (x) :precision binary64 (if (<= x 1.0) (* (fmod (exp x) (* 3.0 (log (cbrt E)))) (- 1.0 x)) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = fmod(exp(x), (3.0 * log(cbrt(((double) M_E))))) * (1.0 - x);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.0) tmp = Float64(rem(exp(x), Float64(3.0 * log(cbrt(exp(1))))) * Float64(1.0 - x)); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 1.0], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(3.0 * N[Log[N[Power[E, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(3 \cdot \log \left(\sqrt[3]{e}\right)\right)\right) \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 1Initial program 8.4%
Taylor expanded in x around 0 7.3%
associate-*r*7.3%
neg-mul-17.3%
distribute-lft1-in7.3%
Simplified7.3%
add-log-exp8.4%
add-cube-cbrt56.3%
log-prod56.4%
Applied egg-rr55.1%
log-pow55.8%
distribute-lft1-in55.8%
metadata-eval55.8%
cos-055.8%
metadata-eval55.8%
exp-1-e55.8%
Simplified55.1%
if 1 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification64.4%
(FPCore (x) :precision binary64 (if (<= x 200.0) (fmod (exp x) (* 3.0 (log (cbrt E)))) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 200.0) {
tmp = fmod(exp(x), (3.0 * log(cbrt(((double) M_E)))));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 200.0) tmp = rem(exp(x), Float64(3.0 * log(cbrt(exp(1))))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 200.0], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(3.0 * N[Log[N[Power[E, 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 200:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(3 \cdot \log \left(\sqrt[3]{e}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 200Initial program 8.4%
Taylor expanded in x around 0 7.3%
associate-*r*7.3%
neg-mul-17.3%
distribute-lft1-in7.3%
Simplified7.3%
add-log-exp8.4%
add-cube-cbrt56.3%
log-prod56.4%
Applied egg-rr55.1%
log-pow55.8%
distribute-lft1-in55.8%
metadata-eval55.8%
cos-055.8%
metadata-eval55.8%
exp-1-e55.8%
Simplified55.1%
Taylor expanded in x around 0 6.6%
unpow1/354.6%
Simplified54.6%
if 200 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification64.0%
(FPCore (x) :precision binary64 (if (<= x 500.0) (/ (fmod (exp x) (+ 1.0 (* (pow x 2.0) -0.25))) (exp x)) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 500.0) {
tmp = fmod(exp(x), (1.0 + (pow(x, 2.0) * -0.25))) / exp(x);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 500.0d0) then
tmp = mod(exp(x), (1.0d0 + ((x ** 2.0d0) * (-0.25d0)))) / exp(x)
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= 500.0: tmp = math.fmod(math.exp(x), (1.0 + (math.pow(x, 2.0) * -0.25))) / math.exp(x) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= 500.0) tmp = Float64(rem(exp(x), Float64(1.0 + Float64((x ^ 2.0) * -0.25))) / exp(x)); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 500.0], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(1.0 + N[(N[Power[x, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 500:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(1 + {x}^{2} \cdot -0.25\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 500Initial program 8.4%
exp-neg8.4%
associate-*r/8.4%
*-rgt-identity8.4%
Simplified8.4%
Taylor expanded in x around 0 8.2%
*-commutative8.2%
Simplified8.2%
if 500 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification27.2%
(FPCore (x) :precision binary64 (if (<= x 20.0) (/ 1.0 (/ (exp x) (fmod (exp x) 1.0))) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 20.0) {
tmp = 1.0 / (exp(x) / fmod(exp(x), 1.0));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 20.0d0) then
tmp = 1.0d0 / (exp(x) / mod(exp(x), 1.0d0))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= 20.0: tmp = 1.0 / (math.exp(x) / math.fmod(math.exp(x), 1.0)) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= 20.0) tmp = Float64(1.0 / Float64(exp(x) / rem(exp(x), 1.0))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 20.0], N[(1.0 / N[(N[Exp[x], $MachinePrecision] / N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 20:\\
\;\;\;\;\frac{1}{\frac{e^{x}}{\left(\left(e^{x}\right) \bmod 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 20Initial program 8.4%
exp-neg8.4%
associate-*r/8.4%
*-rgt-identity8.4%
Simplified8.4%
add-log-exp8.4%
add-cube-cbrt56.3%
log-prod56.4%
Applied egg-rr55.8%
log-pow55.8%
distribute-lft1-in55.8%
metadata-eval55.8%
cos-055.8%
metadata-eval55.8%
exp-1-e55.8%
Simplified55.8%
*-commutative55.8%
add-log-exp55.8%
exp-to-pow55.8%
pow355.8%
add-cube-cbrt7.9%
log-E7.9%
frac-2neg7.9%
div-inv7.9%
Applied egg-rr7.9%
un-div-inv7.9%
clear-num7.9%
add-sqr-sqrt4.0%
sqrt-unprod4.1%
sqr-neg4.1%
sqrt-unprod4.1%
add-sqr-sqrt4.1%
add-sqr-sqrt0.0%
sqrt-unprod7.9%
sqr-neg7.9%
sqrt-unprod7.9%
add-sqr-sqrt7.9%
Applied egg-rr7.9%
if 20 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification27.0%
(FPCore (x) :precision binary64 (if (<= x 20.0) (/ (fmod (exp x) 1.0) (exp x)) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 20.0) {
tmp = fmod(exp(x), 1.0) / exp(x);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 20.0d0) then
tmp = mod(exp(x), 1.0d0) / exp(x)
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= 20.0: tmp = math.fmod(math.exp(x), 1.0) / math.exp(x) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= 20.0) tmp = Float64(rem(exp(x), 1.0) / exp(x)); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 20.0], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 20:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod 1\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 20Initial program 8.4%
exp-neg8.4%
associate-*r/8.4%
*-rgt-identity8.4%
Simplified8.4%
Taylor expanded in x around 0 7.9%
if 20 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification27.0%
(FPCore (x) :precision binary64 (if (<= x 1.0) (* (- 1.0 x) (fmod (exp x) 1.0)) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = (1.0 - x) * fmod(exp(x), 1.0);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (1.0d0 - x) * mod(exp(x), 1.0d0)
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= 1.0: tmp = (1.0 - x) * math.fmod(math.exp(x), 1.0) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(1.0 - x) * rem(exp(x), 1.0)); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 1.0], N[(N[(1.0 - x), $MachinePrecision] * N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(1 - x\right) \cdot \left(\left(e^{x}\right) \bmod 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 1Initial program 8.4%
exp-neg8.4%
associate-*r/8.4%
*-rgt-identity8.4%
Simplified8.4%
add-log-exp8.4%
add-cube-cbrt56.3%
log-prod56.4%
Applied egg-rr55.8%
log-pow55.8%
distribute-lft1-in55.8%
metadata-eval55.8%
cos-055.8%
metadata-eval55.8%
exp-1-e55.8%
Simplified55.8%
Taylor expanded in x around 0 7.2%
associate-*r*7.2%
distribute-lft1-in7.1%
log-pow7.1%
log-E7.1%
metadata-eval7.1%
metadata-eval7.1%
distribute-rgt1-in7.2%
*-lft-identity7.2%
distribute-rgt-out7.1%
mul-1-neg7.1%
unsub-neg7.1%
Simplified7.1%
if 1 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification26.4%
(FPCore (x) :precision binary64 (if (<= x 20.0) (fmod (exp x) 1.0) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= 20.0) {
tmp = fmod(exp(x), 1.0);
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 20.0d0) then
tmp = mod(exp(x), 1.0d0)
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= 20.0: tmp = math.fmod(math.exp(x), 1.0) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= 20.0) tmp = rem(exp(x), 1.0); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, 20.0], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 20:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 20Initial program 8.4%
Taylor expanded in x around 0 7.3%
associate-*r*7.3%
neg-mul-17.3%
distribute-lft1-in7.3%
Simplified7.3%
add-log-exp8.4%
add-cube-cbrt56.3%
log-prod56.4%
Applied egg-rr55.1%
log-pow55.8%
distribute-lft1-in55.8%
metadata-eval55.8%
cos-055.8%
metadata-eval55.8%
exp-1-e55.8%
Simplified55.1%
Taylor expanded in x around 0 6.6%
log-pow6.6%
log-E6.6%
metadata-eval6.6%
metadata-eval6.6%
Simplified6.6%
if 20 < x Initial program 0.0%
exp-neg0.0%
associate-*r/0.0%
*-rgt-identity0.0%
Simplified0.0%
Applied egg-rr100.0%
+-lft-identity100.0%
cos-0100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification26.0%
(FPCore (x) :precision binary64 (fmod 1.0 1.0))
double code(double x) {
return fmod(1.0, 1.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod(1.0d0, 1.0d0)
end function
def code(x): return math.fmod(1.0, 1.0)
function code(x) return rem(1.0, 1.0) end
code[x_] := N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]
\begin{array}{l}
\\
\left(1 \bmod 1\right)
\end{array}
Initial program 6.7%
exp-neg6.7%
associate-*r/6.7%
*-rgt-identity6.7%
Simplified6.7%
Applied egg-rr24.0%
+-lft-identity24.0%
cos-024.0%
metadata-eval24.0%
Simplified24.0%
Taylor expanded in x around 0 24.0%
Final simplification24.0%
herbie shell --seed 2023310
(FPCore (x)
:name "expfmod (used to be hard to sample)"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))