
(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 10 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 (<= x -2e-310) (/ (fmod (exp x) (/ -0.25 (sqrt 0.041666666666666664))) (exp x)) (/ (fmod 1.0 (sqrt (cos x))) (exp x))))
double code(double x) {
double tmp;
if (x <= -2e-310) {
tmp = fmod(exp(x), (-0.25 / sqrt(0.041666666666666664))) / exp(x);
} else {
tmp = fmod(1.0, sqrt(cos(x))) / exp(x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-2d-310)) then
tmp = mod(exp(x), ((-0.25d0) / sqrt(0.041666666666666664d0))) / exp(x)
else
tmp = mod(1.0d0, sqrt(cos(x))) / exp(x)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= -2e-310: tmp = math.fmod(math.exp(x), (-0.25 / math.sqrt(0.041666666666666664))) / math.exp(x) else: tmp = math.fmod(1.0, math.sqrt(math.cos(x))) / math.exp(x) return tmp
function code(x) tmp = 0.0 if (x <= -2e-310) tmp = Float64(rem(exp(x), Float64(-0.25 / sqrt(0.041666666666666664))) / exp(x)); else tmp = Float64(rem(1.0, sqrt(cos(x))) / exp(x)); end return tmp end
code[x_] := If[LessEqual[x, -2e-310], N[(N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(-0.25 / N[Sqrt[0.041666666666666664], $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[With[{TMP1 = 1.0, TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(\left(e^{x}\right) \bmod \left(\frac{-0.25}{\sqrt{0.041666666666666664}}\right)\right)}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}\\
\end{array}
\end{array}
if x < -1.999999999999994e-310Initial program 5.7%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.7%
Simplified5.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f645.7%
Simplified5.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6498.2%
Simplified98.2%
if -1.999999999999994e-310 < x Initial program 6.8%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f646.8%
Simplified6.8%
Taylor expanded in x around 0
Simplified27.3%
(FPCore (x) :precision binary64 (if (<= x -2e-310) (fmod (exp x) (/ -0.25 (sqrt 0.041666666666666664))) (/ (fmod 1.0 (sqrt (cos x))) (exp x))))
double code(double x) {
double tmp;
if (x <= -2e-310) {
tmp = fmod(exp(x), (-0.25 / sqrt(0.041666666666666664)));
} else {
tmp = fmod(1.0, sqrt(cos(x))) / exp(x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-2d-310)) then
tmp = mod(exp(x), ((-0.25d0) / sqrt(0.041666666666666664d0)))
else
tmp = mod(1.0d0, sqrt(cos(x))) / exp(x)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= -2e-310: tmp = math.fmod(math.exp(x), (-0.25 / math.sqrt(0.041666666666666664))) else: tmp = math.fmod(1.0, math.sqrt(math.cos(x))) / math.exp(x) return tmp
function code(x) tmp = 0.0 if (x <= -2e-310) tmp = rem(exp(x), Float64(-0.25 / sqrt(0.041666666666666664))); else tmp = Float64(rem(1.0, sqrt(cos(x))) / exp(x)); end return tmp end
code[x_] := If[LessEqual[x, -2e-310], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(-0.25 / N[Sqrt[0.041666666666666664], $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], N[(N[With[{TMP1 = 1.0, TMP2 = N[Sqrt[N[Cos[x], $MachinePrecision]], $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\frac{-0.25}{\sqrt{0.041666666666666664}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 \bmod \left(\sqrt{\cos x}\right)\right)}{e^{x}}\\
\end{array}
\end{array}
if x < -1.999999999999994e-310Initial program 5.7%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.7%
Simplified5.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f645.7%
Simplified5.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6498.2%
Simplified98.2%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6497.4%
Simplified97.4%
if -1.999999999999994e-310 < x Initial program 6.8%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f646.8%
Simplified6.8%
Taylor expanded in x around 0
Simplified27.3%
(FPCore (x) :precision binary64 (if (<= x -2e-310) (fmod (exp x) (/ -0.25 (sqrt 0.041666666666666664))) (fmod 1.0 1.0)))
double code(double x) {
double tmp;
if (x <= -2e-310) {
tmp = fmod(exp(x), (-0.25 / sqrt(0.041666666666666664)));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-2d-310)) then
tmp = mod(exp(x), ((-0.25d0) / sqrt(0.041666666666666664d0)))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): tmp = 0 if x <= -2e-310: tmp = math.fmod(math.exp(x), (-0.25 / math.sqrt(0.041666666666666664))) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) tmp = 0.0 if (x <= -2e-310) tmp = rem(exp(x), Float64(-0.25 / sqrt(0.041666666666666664))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := If[LessEqual[x, -2e-310], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(-0.25 / N[Sqrt[0.041666666666666664], $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 -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\frac{-0.25}{\sqrt{0.041666666666666664}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < -1.999999999999994e-310Initial program 5.7%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.7%
Simplified5.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f645.7%
Simplified5.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6498.2%
Simplified98.2%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6497.4%
Simplified97.4%
if -1.999999999999994e-310 < x Initial program 6.8%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f646.8%
Simplified6.8%
Taylor expanded in x around 0
Simplified5.6%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f645.6%
Simplified5.6%
Taylor expanded in x around 0
Simplified27.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (/ 0.25 (* x x)) 0.010416666666666666))
(t_1 (* x (* x x)))
(t_2 (* x t_1))
(t_3 (+ 1.0 (* x (+ 1.0 (* x 0.5)))))
(t_4 (+ (/ 0.010416666666666666 (* x x)) (/ 0.25 t_2)))
(t_5 (* (* x x) (* (* x x) (* x x))))
(t_6 (/ t_0 (* x x))))
(if (<= x -5.6e-17)
(/
1.0
(/
t_3
(fmod
t_3
(+ 1.0 (* x (* x (+ -0.25 (* (* x x) -0.010416666666666666))))))))
(if (<= x -2.1e-39)
(fmod
(exp x)
(/
(*
t_5
(+
-3.589164409454304e-8
(/
(* (+ -0.010416666666666666 (/ -0.25 (* x x))) (* t_0 t_0))
t_5)))
(+ 1.0880835262345679e-5 (* t_6 (+ t_6 -0.003298611111111111)))))
(if (<= x -1.16e-54)
(fmod
(exp x)
(/
(* (- 1.0880835262345679e-5 (* t_4 t_4)) (* (* x x) t_2))
(+ -0.003298611111111111 t_4)))
(if (<= x -1.35e-108)
(fmod (exp x) (* t_1 (* t_1 (- -0.003298611111111111 t_4))))
(fmod 1.0 1.0)))))))
double code(double x) {
double t_0 = (0.25 / (x * x)) + 0.010416666666666666;
double t_1 = x * (x * x);
double t_2 = x * t_1;
double t_3 = 1.0 + (x * (1.0 + (x * 0.5)));
double t_4 = (0.010416666666666666 / (x * x)) + (0.25 / t_2);
double t_5 = (x * x) * ((x * x) * (x * x));
double t_6 = t_0 / (x * x);
double tmp;
if (x <= -5.6e-17) {
tmp = 1.0 / (t_3 / fmod(t_3, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666)))))));
} else if (x <= -2.1e-39) {
tmp = fmod(exp(x), ((t_5 * (-3.589164409454304e-8 + (((-0.010416666666666666 + (-0.25 / (x * x))) * (t_0 * t_0)) / t_5))) / (1.0880835262345679e-5 + (t_6 * (t_6 + -0.003298611111111111)))));
} else if (x <= -1.16e-54) {
tmp = fmod(exp(x), (((1.0880835262345679e-5 - (t_4 * t_4)) * ((x * x) * t_2)) / (-0.003298611111111111 + t_4)));
} else if (x <= -1.35e-108) {
tmp = fmod(exp(x), (t_1 * (t_1 * (-0.003298611111111111 - t_4))));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (0.25d0 / (x * x)) + 0.010416666666666666d0
t_1 = x * (x * x)
t_2 = x * t_1
t_3 = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
t_4 = (0.010416666666666666d0 / (x * x)) + (0.25d0 / t_2)
t_5 = (x * x) * ((x * x) * (x * x))
t_6 = t_0 / (x * x)
if (x <= (-5.6d-17)) then
tmp = 1.0d0 / (t_3 / mod(t_3, (1.0d0 + (x * (x * ((-0.25d0) + ((x * x) * (-0.010416666666666666d0))))))))
else if (x <= (-2.1d-39)) then
tmp = mod(exp(x), ((t_5 * ((-3.589164409454304d-8) + ((((-0.010416666666666666d0) + ((-0.25d0) / (x * x))) * (t_0 * t_0)) / t_5))) / (1.0880835262345679d-5 + (t_6 * (t_6 + (-0.003298611111111111d0))))))
else if (x <= (-1.16d-54)) then
tmp = mod(exp(x), (((1.0880835262345679d-5 - (t_4 * t_4)) * ((x * x) * t_2)) / ((-0.003298611111111111d0) + t_4)))
else if (x <= (-1.35d-108)) then
tmp = mod(exp(x), (t_1 * (t_1 * ((-0.003298611111111111d0) - t_4))))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): t_0 = (0.25 / (x * x)) + 0.010416666666666666 t_1 = x * (x * x) t_2 = x * t_1 t_3 = 1.0 + (x * (1.0 + (x * 0.5))) t_4 = (0.010416666666666666 / (x * x)) + (0.25 / t_2) t_5 = (x * x) * ((x * x) * (x * x)) t_6 = t_0 / (x * x) tmp = 0 if x <= -5.6e-17: tmp = 1.0 / (t_3 / math.fmod(t_3, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666))))))) elif x <= -2.1e-39: tmp = math.fmod(math.exp(x), ((t_5 * (-3.589164409454304e-8 + (((-0.010416666666666666 + (-0.25 / (x * x))) * (t_0 * t_0)) / t_5))) / (1.0880835262345679e-5 + (t_6 * (t_6 + -0.003298611111111111))))) elif x <= -1.16e-54: tmp = math.fmod(math.exp(x), (((1.0880835262345679e-5 - (t_4 * t_4)) * ((x * x) * t_2)) / (-0.003298611111111111 + t_4))) elif x <= -1.35e-108: tmp = math.fmod(math.exp(x), (t_1 * (t_1 * (-0.003298611111111111 - t_4)))) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) t_0 = Float64(Float64(0.25 / Float64(x * x)) + 0.010416666666666666) t_1 = Float64(x * Float64(x * x)) t_2 = Float64(x * t_1) t_3 = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))) t_4 = Float64(Float64(0.010416666666666666 / Float64(x * x)) + Float64(0.25 / t_2)) t_5 = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(x * x))) t_6 = Float64(t_0 / Float64(x * x)) tmp = 0.0 if (x <= -5.6e-17) tmp = Float64(1.0 / Float64(t_3 / rem(t_3, Float64(1.0 + Float64(x * Float64(x * Float64(-0.25 + Float64(Float64(x * x) * -0.010416666666666666)))))))); elseif (x <= -2.1e-39) tmp = rem(exp(x), Float64(Float64(t_5 * Float64(-3.589164409454304e-8 + Float64(Float64(Float64(-0.010416666666666666 + Float64(-0.25 / Float64(x * x))) * Float64(t_0 * t_0)) / t_5))) / Float64(1.0880835262345679e-5 + Float64(t_6 * Float64(t_6 + -0.003298611111111111))))); elseif (x <= -1.16e-54) tmp = rem(exp(x), Float64(Float64(Float64(1.0880835262345679e-5 - Float64(t_4 * t_4)) * Float64(Float64(x * x) * t_2)) / Float64(-0.003298611111111111 + t_4))); elseif (x <= -1.35e-108) tmp = rem(exp(x), Float64(t_1 * Float64(t_1 * Float64(-0.003298611111111111 - t_4)))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[(0.25 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 0.010416666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(0.010416666666666666 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(0.25 / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$0 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e-17], N[(1.0 / N[(t$95$3 / N[With[{TMP1 = t$95$3, TMP2 = N[(1.0 + N[(x * N[(x * N[(-0.25 + N[(N[(x * x), $MachinePrecision] * -0.010416666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-39], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(N[(t$95$5 * N[(-3.589164409454304e-8 + N[(N[(N[(-0.010416666666666666 + N[(-0.25 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0880835262345679e-5 + N[(t$95$6 * N[(t$95$6 + -0.003298611111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], If[LessEqual[x, -1.16e-54], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(N[(N[(1.0880835262345679e-5 - N[(t$95$4 * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(-0.003298611111111111 + t$95$4), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], If[LessEqual[x, -1.35e-108], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(t$95$1 * N[(t$95$1 * N[(-0.003298611111111111 - t$95$4), $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}
t_0 := \frac{0.25}{x \cdot x} + 0.010416666666666666\\
t_1 := x \cdot \left(x \cdot x\right)\\
t_2 := x \cdot t\_1\\
t_3 := 1 + x \cdot \left(1 + x \cdot 0.5\right)\\
t_4 := \frac{0.010416666666666666}{x \cdot x} + \frac{0.25}{t\_2}\\
t_5 := \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\\
t_6 := \frac{t\_0}{x \cdot x}\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{\frac{t\_3}{\left(t\_3 \bmod \left(1 + x \cdot \left(x \cdot \left(-0.25 + \left(x \cdot x\right) \cdot -0.010416666666666666\right)\right)\right)\right)}}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\frac{t\_5 \cdot \left(-3.589164409454304 \cdot 10^{-8} + \frac{\left(-0.010416666666666666 + \frac{-0.25}{x \cdot x}\right) \cdot \left(t\_0 \cdot t\_0\right)}{t\_5}\right)}{1.0880835262345679 \cdot 10^{-5} + t\_6 \cdot \left(t\_6 + -0.003298611111111111\right)}\right)\right)\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-54}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\frac{\left(1.0880835262345679 \cdot 10^{-5} - t\_4 \cdot t\_4\right) \cdot \left(\left(x \cdot x\right) \cdot t\_2\right)}{-0.003298611111111111 + t\_4}\right)\right)\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-108}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(t\_1 \cdot \left(t\_1 \cdot \left(-0.003298611111111111 - t\_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < -5.5999999999999998e-17Initial program 60.0%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f6460.0%
Simplified60.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f6460.0%
Applied egg-rr60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.0%
Simplified60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6448.4%
Simplified48.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
rgt-mult-inverseN/A
distribute-lft-inN/A
associate-*l*N/A
unpow2N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-commutativeN/A
rgt-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -5.5999999999999998e-17 < x < -2.09999999999999993e-39Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f646.8%
Simplified6.8%
Applied egg-rr76.9%
Taylor expanded in x around 0
Simplified76.9%
if -2.09999999999999993e-39 < x < -1.16e-54Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.7%
Simplified5.7%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
Simplified5.7%
*-commutativeN/A
flip--N/A
metadata-evalN/A
pow-powN/A
pow2N/A
cube-unmultN/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if -1.16e-54 < x < -1.35000000000000002e-108Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f640.0%
Simplified0.0%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
Simplified0.0%
*-commutativeN/A
sqr-powN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr52.5%
if -1.35000000000000002e-108 < x Initial program 5.5%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.5%
Simplified5.5%
Taylor expanded in x around 0
Simplified4.8%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f644.7%
Simplified4.7%
Taylor expanded in x around 0
Simplified19.0%
Final simplification26.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x)))
(t_1 (* x t_0))
(t_2 (+ (/ 0.010416666666666666 (* x x)) (/ 0.25 t_1)))
(t_3 (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
(if (<= x -5.6e-17)
(/
1.0
(/
t_3
(fmod
t_3
(+ 1.0 (* x (* x (+ -0.25 (* (* x x) -0.010416666666666666))))))))
(if (<= x -1.16e-54)
(fmod
(exp x)
(/
(* (- 1.0880835262345679e-5 (* t_2 t_2)) (* (* x x) t_1))
(+ -0.003298611111111111 t_2)))
(if (<= x -1.35e-108)
(fmod (exp x) (* t_0 (* t_0 (- -0.003298611111111111 t_2))))
(fmod 1.0 1.0))))))
double code(double x) {
double t_0 = x * (x * x);
double t_1 = x * t_0;
double t_2 = (0.010416666666666666 / (x * x)) + (0.25 / t_1);
double t_3 = 1.0 + (x * (1.0 + (x * 0.5)));
double tmp;
if (x <= -5.6e-17) {
tmp = 1.0 / (t_3 / fmod(t_3, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666)))))));
} else if (x <= -1.16e-54) {
tmp = fmod(exp(x), (((1.0880835262345679e-5 - (t_2 * t_2)) * ((x * x) * t_1)) / (-0.003298611111111111 + t_2)));
} else if (x <= -1.35e-108) {
tmp = fmod(exp(x), (t_0 * (t_0 * (-0.003298611111111111 - t_2))));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x * (x * x)
t_1 = x * t_0
t_2 = (0.010416666666666666d0 / (x * x)) + (0.25d0 / t_1)
t_3 = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
if (x <= (-5.6d-17)) then
tmp = 1.0d0 / (t_3 / mod(t_3, (1.0d0 + (x * (x * ((-0.25d0) + ((x * x) * (-0.010416666666666666d0))))))))
else if (x <= (-1.16d-54)) then
tmp = mod(exp(x), (((1.0880835262345679d-5 - (t_2 * t_2)) * ((x * x) * t_1)) / ((-0.003298611111111111d0) + t_2)))
else if (x <= (-1.35d-108)) then
tmp = mod(exp(x), (t_0 * (t_0 * ((-0.003298611111111111d0) - t_2))))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): t_0 = x * (x * x) t_1 = x * t_0 t_2 = (0.010416666666666666 / (x * x)) + (0.25 / t_1) t_3 = 1.0 + (x * (1.0 + (x * 0.5))) tmp = 0 if x <= -5.6e-17: tmp = 1.0 / (t_3 / math.fmod(t_3, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666))))))) elif x <= -1.16e-54: tmp = math.fmod(math.exp(x), (((1.0880835262345679e-5 - (t_2 * t_2)) * ((x * x) * t_1)) / (-0.003298611111111111 + t_2))) elif x <= -1.35e-108: tmp = math.fmod(math.exp(x), (t_0 * (t_0 * (-0.003298611111111111 - t_2)))) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(x * t_0) t_2 = Float64(Float64(0.010416666666666666 / Float64(x * x)) + Float64(0.25 / t_1)) t_3 = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))) tmp = 0.0 if (x <= -5.6e-17) tmp = Float64(1.0 / Float64(t_3 / rem(t_3, Float64(1.0 + Float64(x * Float64(x * Float64(-0.25 + Float64(Float64(x * x) * -0.010416666666666666)))))))); elseif (x <= -1.16e-54) tmp = rem(exp(x), Float64(Float64(Float64(1.0880835262345679e-5 - Float64(t_2 * t_2)) * Float64(Float64(x * x) * t_1)) / Float64(-0.003298611111111111 + t_2))); elseif (x <= -1.35e-108) tmp = rem(exp(x), Float64(t_0 * Float64(t_0 * Float64(-0.003298611111111111 - t_2)))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.010416666666666666 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(0.25 / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e-17], N[(1.0 / N[(t$95$3 / N[With[{TMP1 = t$95$3, TMP2 = N[(1.0 + N[(x * N[(x * N[(-0.25 + N[(N[(x * x), $MachinePrecision] * -0.010416666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.16e-54], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(N[(N[(1.0880835262345679e-5 - N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(-0.003298611111111111 + t$95$2), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision], If[LessEqual[x, -1.35e-108], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(t$95$0 * N[(t$95$0 * N[(-0.003298611111111111 - t$95$2), $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}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := x \cdot t\_0\\
t_2 := \frac{0.010416666666666666}{x \cdot x} + \frac{0.25}{t\_1}\\
t_3 := 1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{\frac{t\_3}{\left(t\_3 \bmod \left(1 + x \cdot \left(x \cdot \left(-0.25 + \left(x \cdot x\right) \cdot -0.010416666666666666\right)\right)\right)\right)}}\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-54}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(\frac{\left(1.0880835262345679 \cdot 10^{-5} - t\_2 \cdot t\_2\right) \cdot \left(\left(x \cdot x\right) \cdot t\_1\right)}{-0.003298611111111111 + t\_2}\right)\right)\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-108}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(t\_0 \cdot \left(t\_0 \cdot \left(-0.003298611111111111 - t\_2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < -5.5999999999999998e-17Initial program 60.0%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f6460.0%
Simplified60.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f6460.0%
Applied egg-rr60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.0%
Simplified60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6448.4%
Simplified48.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
rgt-mult-inverseN/A
distribute-lft-inN/A
associate-*l*N/A
unpow2N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-commutativeN/A
rgt-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -5.5999999999999998e-17 < x < -1.16e-54Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f646.3%
Simplified6.3%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
Simplified6.3%
*-commutativeN/A
flip--N/A
metadata-evalN/A
pow-powN/A
pow2N/A
cube-unmultN/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr46.7%
if -1.16e-54 < x < -1.35000000000000002e-108Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f640.0%
Simplified0.0%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
Simplified0.0%
*-commutativeN/A
sqr-powN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr52.5%
if -1.35000000000000002e-108 < x Initial program 5.5%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.5%
Simplified5.5%
Taylor expanded in x around 0
Simplified4.8%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f644.7%
Simplified4.7%
Taylor expanded in x around 0
Simplified19.0%
Final simplification24.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* x (+ 1.0 (* x 0.5))))) (t_1 (* x (* x x))))
(if (<= x -5.6e-17)
(/
1.0
(/
t_0
(fmod
t_0
(+ 1.0 (* x (* x (+ -0.25 (* (* x x) -0.010416666666666666))))))))
(if (<= x -1.35e-108)
(fmod
(exp x)
(*
t_1
(*
t_1
(-
-0.003298611111111111
(+ (/ 0.010416666666666666 (* x x)) (/ 0.25 (* x t_1)))))))
(fmod 1.0 1.0)))))
double code(double x) {
double t_0 = 1.0 + (x * (1.0 + (x * 0.5)));
double t_1 = x * (x * x);
double tmp;
if (x <= -5.6e-17) {
tmp = 1.0 / (t_0 / fmod(t_0, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666)))))));
} else if (x <= -1.35e-108) {
tmp = fmod(exp(x), (t_1 * (t_1 * (-0.003298611111111111 - ((0.010416666666666666 / (x * x)) + (0.25 / (x * t_1)))))));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
t_1 = x * (x * x)
if (x <= (-5.6d-17)) then
tmp = 1.0d0 / (t_0 / mod(t_0, (1.0d0 + (x * (x * ((-0.25d0) + ((x * x) * (-0.010416666666666666d0))))))))
else if (x <= (-1.35d-108)) then
tmp = mod(exp(x), (t_1 * (t_1 * ((-0.003298611111111111d0) - ((0.010416666666666666d0 / (x * x)) + (0.25d0 / (x * t_1)))))))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): t_0 = 1.0 + (x * (1.0 + (x * 0.5))) t_1 = x * (x * x) tmp = 0 if x <= -5.6e-17: tmp = 1.0 / (t_0 / math.fmod(t_0, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666))))))) elif x <= -1.35e-108: tmp = math.fmod(math.exp(x), (t_1 * (t_1 * (-0.003298611111111111 - ((0.010416666666666666 / (x * x)) + (0.25 / (x * t_1))))))) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) t_0 = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))) t_1 = Float64(x * Float64(x * x)) tmp = 0.0 if (x <= -5.6e-17) tmp = Float64(1.0 / Float64(t_0 / rem(t_0, Float64(1.0 + Float64(x * Float64(x * Float64(-0.25 + Float64(Float64(x * x) * -0.010416666666666666)))))))); elseif (x <= -1.35e-108) tmp = rem(exp(x), Float64(t_1 * Float64(t_1 * Float64(-0.003298611111111111 - Float64(Float64(0.010416666666666666 / Float64(x * x)) + Float64(0.25 / Float64(x * t_1))))))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.6e-17], N[(1.0 / N[(t$95$0 / N[With[{TMP1 = t$95$0, TMP2 = N[(1.0 + N[(x * N[(x * N[(-0.25 + N[(N[(x * x), $MachinePrecision] * -0.010416666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-108], N[With[{TMP1 = N[Exp[x], $MachinePrecision], TMP2 = N[(t$95$1 * N[(t$95$1 * N[(-0.003298611111111111 - N[(N[(0.010416666666666666 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(0.25 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
t_0 := 1 + x \cdot \left(1 + x \cdot 0.5\right)\\
t_1 := x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -5.6 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{\left(t\_0 \bmod \left(1 + x \cdot \left(x \cdot \left(-0.25 + \left(x \cdot x\right) \cdot -0.010416666666666666\right)\right)\right)\right)}}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-108}:\\
\;\;\;\;\left(\left(e^{x}\right) \bmod \left(t\_1 \cdot \left(t\_1 \cdot \left(-0.003298611111111111 - \left(\frac{0.010416666666666666}{x \cdot x} + \frac{0.25}{x \cdot t\_1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < -5.5999999999999998e-17Initial program 60.0%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f6460.0%
Simplified60.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f6460.0%
Applied egg-rr60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6460.0%
Simplified60.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6448.4%
Simplified48.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
rgt-mult-inverseN/A
distribute-lft-inN/A
associate-*l*N/A
unpow2N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-commutativeN/A
rgt-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -5.5999999999999998e-17 < x < -1.35000000000000002e-108Initial program 3.1%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f643.1%
Simplified3.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.1%
Simplified3.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f642.6%
Simplified2.6%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
Simplified2.6%
*-commutativeN/A
sqr-powN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr33.5%
if -1.35000000000000002e-108 < x Initial program 5.5%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f645.5%
Simplified5.5%
Taylor expanded in x around 0
Simplified4.8%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f644.7%
Simplified4.7%
Taylor expanded in x around 0
Simplified19.0%
Final simplification22.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
(if (<= x 0.2)
(/
(fmod
t_0
(+
1.0
(*
(* x x)
(+
-0.25
(*
x
(*
x
(+ -0.010416666666666666 (* (* x x) -0.003298611111111111))))))))
t_0)
(fmod 1.0 1.0))))
double code(double x) {
double t_0 = 1.0 + (x * (1.0 + (x * 0.5)));
double tmp;
if (x <= 0.2) {
tmp = fmod(t_0, (1.0 + ((x * x) * (-0.25 + (x * (x * (-0.010416666666666666 + ((x * x) * -0.003298611111111111)))))))) / t_0;
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
if (x <= 0.2d0) then
tmp = mod(t_0, (1.0d0 + ((x * x) * ((-0.25d0) + (x * (x * ((-0.010416666666666666d0) + ((x * x) * (-0.003298611111111111d0))))))))) / t_0
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): t_0 = 1.0 + (x * (1.0 + (x * 0.5))) tmp = 0 if x <= 0.2: tmp = math.fmod(t_0, (1.0 + ((x * x) * (-0.25 + (x * (x * (-0.010416666666666666 + ((x * x) * -0.003298611111111111)))))))) / t_0 else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) t_0 = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))) tmp = 0.0 if (x <= 0.2) tmp = Float64(rem(t_0, Float64(1.0 + Float64(Float64(x * x) * Float64(-0.25 + Float64(x * Float64(x * Float64(-0.010416666666666666 + Float64(Float64(x * x) * -0.003298611111111111)))))))) / t_0); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.2], N[(N[With[{TMP1 = t$95$0, TMP2 = N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(-0.25 + N[(x * N[(x * N[(-0.010416666666666666 + N[(N[(x * x), $MachinePrecision] * -0.003298611111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision] / t$95$0), $MachinePrecision], N[With[{TMP1 = 1.0, TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\mathbf{if}\;x \leq 0.2:\\
\;\;\;\;\frac{\left(t\_0 \bmod \left(1 + \left(x \cdot x\right) \cdot \left(-0.25 + x \cdot \left(x \cdot \left(-0.010416666666666666 + \left(x \cdot x\right) \cdot -0.003298611111111111\right)\right)\right)\right)\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 0.20000000000000001Initial program 7.2%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f647.2%
Simplified7.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f647.1%
Simplified7.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f646.6%
Simplified6.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f647.6%
Simplified7.6%
if 0.20000000000000001 < x Initial program 0.0%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f640.0%
Simplified0.0%
Taylor expanded in x around 0
Simplified0.0%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f640.0%
Simplified0.0%
Taylor expanded in x around 0
Simplified100.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
(if (<= x 0.2)
(/
1.0
(/
t_0
(fmod
t_0
(+ 1.0 (* x (* x (+ -0.25 (* (* x x) -0.010416666666666666))))))))
(fmod 1.0 1.0))))
double code(double x) {
double t_0 = 1.0 + (x * (1.0 + (x * 0.5)));
double tmp;
if (x <= 0.2) {
tmp = 1.0 / (t_0 / fmod(t_0, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666)))))));
} else {
tmp = fmod(1.0, 1.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
if (x <= 0.2d0) then
tmp = 1.0d0 / (t_0 / mod(t_0, (1.0d0 + (x * (x * ((-0.25d0) + ((x * x) * (-0.010416666666666666d0))))))))
else
tmp = mod(1.0d0, 1.0d0)
end if
code = tmp
end function
def code(x): t_0 = 1.0 + (x * (1.0 + (x * 0.5))) tmp = 0 if x <= 0.2: tmp = 1.0 / (t_0 / math.fmod(t_0, (1.0 + (x * (x * (-0.25 + ((x * x) * -0.010416666666666666))))))) else: tmp = math.fmod(1.0, 1.0) return tmp
function code(x) t_0 = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))) tmp = 0.0 if (x <= 0.2) tmp = Float64(1.0 / Float64(t_0 / rem(t_0, Float64(1.0 + Float64(x * Float64(x * Float64(-0.25 + Float64(Float64(x * x) * -0.010416666666666666)))))))); else tmp = rem(1.0, 1.0); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.2], N[(1.0 / N[(t$95$0 / N[With[{TMP1 = t$95$0, TMP2 = N[(1.0 + N[(x * N[(x * N[(-0.25 + N[(N[(x * x), $MachinePrecision] * -0.010416666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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}
t_0 := 1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\mathbf{if}\;x \leq 0.2:\\
\;\;\;\;\frac{1}{\frac{t\_0}{\left(t\_0 \bmod \left(1 + x \cdot \left(x \cdot \left(-0.25 + \left(x \cdot x\right) \cdot -0.010416666666666666\right)\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \bmod 1\right)\\
\end{array}
\end{array}
if x < 0.20000000000000001Initial program 7.2%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f647.2%
Simplified7.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f647.2%
Applied egg-rr7.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f647.0%
Simplified7.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f646.6%
Simplified6.6%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
rgt-mult-inverseN/A
distribute-lft-inN/A
associate-*l*N/A
unpow2N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-commutativeN/A
rgt-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f647.6%
Simplified7.6%
if 0.20000000000000001 < x Initial program 0.0%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f640.0%
Simplified0.0%
Taylor expanded in x around 0
Simplified0.0%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f640.0%
Simplified0.0%
Taylor expanded in x around 0
Simplified100.0%
(FPCore (x) :precision binary64 (fmod (+ x 1.0) 1.0))
double code(double x) {
return fmod((x + 1.0), 1.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = mod((x + 1.0d0), 1.0d0)
end function
def code(x): return math.fmod((x + 1.0), 1.0)
function code(x) return rem(Float64(x + 1.0), 1.0) end
code[x_] := N[With[{TMP1 = N[(x + 1.0), $MachinePrecision], TMP2 = 1.0}, Mod[Abs[TMP1], Abs[TMP2]] * Sign[TMP1]], $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + 1\right) \bmod 1\right)
\end{array}
Initial program 6.3%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f646.3%
Simplified6.3%
Taylor expanded in x around 0
Simplified5.6%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f645.2%
Simplified5.2%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f6417.0%
Simplified17.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.3%
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f64N/A
sqrt-lowering-sqrt.f64N/A
cos-lowering-cos.f64N/A
exp-lowering-exp.f646.3%
Simplified6.3%
Taylor expanded in x around 0
Simplified5.6%
Taylor expanded in x around 0
fmod-lowering-fmod.f64N/A
exp-lowering-exp.f645.2%
Simplified5.2%
Taylor expanded in x around 0
Simplified16.6%
herbie shell --seed 2024161
(FPCore (x)
:name "expfmod (used to be hard to sample)"
:precision binary64
(* (fmod (exp x) (sqrt (cos x))) (exp (- x))))