
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (t + ((y + z) * 2.0))));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(y + z\right) \cdot 2\right)\right)
\end{array}
Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
+-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -8.5e-72)
t_1
(if (<= x 3.2e-263)
(+ (* y 5.0) (* x (* z 2.0)))
(if (<= x 4.6e-63) (- (* x t) (* y (+ -5.0 (* x -2.0)))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -8.5e-72) {
tmp = t_1;
} else if (x <= 3.2e-263) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 4.6e-63) {
tmp = (x * t) - (y * (-5.0 + (x * -2.0)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y + z) * 2.0d0))
if (x <= (-8.5d-72)) then
tmp = t_1
else if (x <= 3.2d-263) then
tmp = (y * 5.0d0) + (x * (z * 2.0d0))
else if (x <= 4.6d-63) then
tmp = (x * t) - (y * ((-5.0d0) + (x * (-2.0d0))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -8.5e-72) {
tmp = t_1;
} else if (x <= 3.2e-263) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 4.6e-63) {
tmp = (x * t) - (y * (-5.0 + (x * -2.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -8.5e-72: tmp = t_1 elif x <= 3.2e-263: tmp = (y * 5.0) + (x * (z * 2.0)) elif x <= 4.6e-63: tmp = (x * t) - (y * (-5.0 + (x * -2.0))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -8.5e-72) tmp = t_1; elseif (x <= 3.2e-263) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(z * 2.0))); elseif (x <= 4.6e-63) tmp = Float64(Float64(x * t) - Float64(y * Float64(-5.0 + Float64(x * -2.0)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -8.5e-72) tmp = t_1; elseif (x <= 3.2e-263) tmp = (y * 5.0) + (x * (z * 2.0)); elseif (x <= 4.6e-63) tmp = (x * t) - (y * (-5.0 + (x * -2.0))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e-72], t$95$1, If[LessEqual[x, 3.2e-263], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.6e-63], N[(N[(x * t), $MachinePrecision] - N[(y * N[(-5.0 + N[(x * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-263}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-63}:\\
\;\;\;\;x \cdot t - y \cdot \left(-5 + x \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.50000000000000008e-72 or 4.6e-63 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6493.0%
Simplified93.0%
if -8.50000000000000008e-72 < x < 3.2e-263Initial program 99.8%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.8%
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.3%
Simplified93.3%
if 3.2e-263 < x < 4.6e-63Initial program 100.0%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in z around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-outN/A
distribute-neg-inN/A
*-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
Simplified89.9%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -7.5e-72)
t_1
(if (<= x 1.95e-268)
(+ (* y 5.0) (* x (* z 2.0)))
(if (<= x 5.5e-63) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -7.5e-72) {
tmp = t_1;
} else if (x <= 1.95e-268) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 5.5e-63) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y + z) * 2.0d0))
if (x <= (-7.5d-72)) then
tmp = t_1
else if (x <= 1.95d-268) then
tmp = (y * 5.0d0) + (x * (z * 2.0d0))
else if (x <= 5.5d-63) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -7.5e-72) {
tmp = t_1;
} else if (x <= 1.95e-268) {
tmp = (y * 5.0) + (x * (z * 2.0));
} else if (x <= 5.5e-63) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -7.5e-72: tmp = t_1 elif x <= 1.95e-268: tmp = (y * 5.0) + (x * (z * 2.0)) elif x <= 5.5e-63: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -7.5e-72) tmp = t_1; elseif (x <= 1.95e-268) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(z * 2.0))); elseif (x <= 5.5e-63) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -7.5e-72) tmp = t_1; elseif (x <= 1.95e-268) tmp = (y * 5.0) + (x * (z * 2.0)); elseif (x <= 5.5e-63) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e-72], t$95$1, If[LessEqual[x, 1.95e-268], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-63], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-268}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-63}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.5000000000000004e-72 or 5.50000000000000043e-63 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6493.0%
Simplified93.0%
if -7.5000000000000004e-72 < x < 1.9499999999999999e-268Initial program 99.8%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.8%
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.3%
Simplified93.3%
if 1.9499999999999999e-268 < x < 5.50000000000000043e-63Initial program 100.0%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6489.9%
Simplified89.9%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.8e+109)
t_1
(if (<= y -8.2e-63)
(+ (* y 5.0) (* x t))
(if (<= y 1e+53) (* x (+ t (* z 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.8e+109) {
tmp = t_1;
} else if (y <= -8.2e-63) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1e+53) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.8d+109)) then
tmp = t_1
else if (y <= (-8.2d-63)) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1d+53) then
tmp = x * (t + (z * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.8e+109) {
tmp = t_1;
} else if (y <= -8.2e-63) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1e+53) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.8e+109: tmp = t_1 elif y <= -8.2e-63: tmp = (y * 5.0) + (x * t) elif y <= 1e+53: tmp = x * (t + (z * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.8e+109) tmp = t_1; elseif (y <= -8.2e-63) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1e+53) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.8e+109) tmp = t_1; elseif (y <= -8.2e-63) tmp = (y * 5.0) + (x * t); elseif (y <= 1e+53) tmp = x * (t + (z * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+109], t$95$1, If[LessEqual[y, -8.2e-63], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+53], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-63}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 10^{+53}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.8e109 or 9.9999999999999999e52 < y Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
if -1.8e109 < y < -8.1999999999999995e-63Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6475.1%
Simplified75.1%
if -8.1999999999999995e-63 < y < 9.9999999999999999e52Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6484.1%
Simplified84.1%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -9e-72) (* x t) (if (<= x 3.3e-63) (* y 5.0) (if (<= x 1.4e+68) (* x (* z 2.0)) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9e-72) {
tmp = x * t;
} else if (x <= 3.3e-63) {
tmp = y * 5.0;
} else if (x <= 1.4e+68) {
tmp = x * (z * 2.0);
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9d-72)) then
tmp = x * t
else if (x <= 3.3d-63) then
tmp = y * 5.0d0
else if (x <= 1.4d+68) then
tmp = x * (z * 2.0d0)
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9e-72) {
tmp = x * t;
} else if (x <= 3.3e-63) {
tmp = y * 5.0;
} else if (x <= 1.4e+68) {
tmp = x * (z * 2.0);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9e-72: tmp = x * t elif x <= 3.3e-63: tmp = y * 5.0 elif x <= 1.4e+68: tmp = x * (z * 2.0) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9e-72) tmp = Float64(x * t); elseif (x <= 3.3e-63) tmp = Float64(y * 5.0); elseif (x <= 1.4e+68) tmp = Float64(x * Float64(z * 2.0)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9e-72) tmp = x * t; elseif (x <= 3.3e-63) tmp = y * 5.0; elseif (x <= 1.4e+68) tmp = x * (z * 2.0); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9e-72], N[(x * t), $MachinePrecision], If[LessEqual[x, 3.3e-63], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.4e+68], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-72}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-63}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -9e-72 or 1.4e68 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6454.2%
Simplified54.2%
if -9e-72 < x < 3.29999999999999994e-63Initial program 99.8%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
*-lowering-*.f6470.6%
Simplified70.6%
if 3.29999999999999994e-63 < x < 1.4e68Initial program 100.0%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.5%
Simplified56.5%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (+ t (* (+ y z) 2.0))))) (if (<= x -8.5e-57) t_1 (if (<= x 2.25e-69) (+ (* y 5.0) (* x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -8.5e-57) {
tmp = t_1;
} else if (x <= 2.25e-69) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y + z) * 2.0d0))
if (x <= (-8.5d-57)) then
tmp = t_1
else if (x <= 2.25d-69) then
tmp = (y * 5.0d0) + (x * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -8.5e-57) {
tmp = t_1;
} else if (x <= 2.25e-69) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -8.5e-57: tmp = t_1 elif x <= 2.25e-69: tmp = (y * 5.0) + (x * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -8.5e-57) tmp = t_1; elseif (x <= 2.25e-69) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -8.5e-57) tmp = t_1; elseif (x <= 2.25e-69) tmp = (y * 5.0) + (x * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e-57], t$95$1, If[LessEqual[x, 2.25e-69], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-69}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.49999999999999955e-57 or 2.25000000000000005e-69 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6493.5%
Simplified93.5%
if -8.49999999999999955e-57 < x < 2.25000000000000005e-69Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6485.2%
Simplified85.2%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (+ 5.0 (* x 2.0))))) (if (<= y -8.5e+90) t_1 (if (<= y 5.2e+51) (* x (+ t (* z 2.0))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.5e+90) {
tmp = t_1;
} else if (y <= 5.2e+51) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-8.5d+90)) then
tmp = t_1
else if (y <= 5.2d+51) then
tmp = x * (t + (z * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -8.5e+90) {
tmp = t_1;
} else if (y <= 5.2e+51) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -8.5e+90: tmp = t_1 elif y <= 5.2e+51: tmp = x * (t + (z * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -8.5e+90) tmp = t_1; elseif (y <= 5.2e+51) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -8.5e+90) tmp = t_1; elseif (y <= 5.2e+51) tmp = x * (t + (z * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+90], t$95$1, If[LessEqual[y, 5.2e+51], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.5000000000000002e90 or 5.2000000000000002e51 < y Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6482.9%
Simplified82.9%
if -8.5000000000000002e90 < y < 5.2000000000000002e51Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (+ t (* z 2.0))))) (if (<= x -1.65e-77) t_1 (if (<= x 3.1e-125) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -1.65e-77) {
tmp = t_1;
} else if (x <= 3.1e-125) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
if (x <= (-1.65d-77)) then
tmp = t_1
else if (x <= 3.1d-125) then
tmp = y * 5.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -1.65e-77) {
tmp = t_1;
} else if (x <= 3.1e-125) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -1.65e-77: tmp = t_1 elif x <= 3.1e-125: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -1.65e-77) tmp = t_1; elseif (x <= 3.1e-125) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -1.65e-77) tmp = t_1; elseif (x <= 3.1e-125) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e-77], t$95$1, If[LessEqual[x, 3.1e-125], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.64999999999999996e-77 or 3.10000000000000013e-125 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6475.1%
Simplified75.1%
if -1.64999999999999996e-77 < x < 3.10000000000000013e-125Initial program 99.8%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
*-lowering-*.f6476.0%
Simplified76.0%
Final simplification75.4%
(FPCore (x y z t) :precision binary64 (if (<= x -8.2e-72) (* x t) (if (<= x 0.145) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.2e-72) {
tmp = x * t;
} else if (x <= 0.145) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-8.2d-72)) then
tmp = x * t
else if (x <= 0.145d0) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.2e-72) {
tmp = x * t;
} else if (x <= 0.145) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.2e-72: tmp = x * t elif x <= 0.145: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.2e-72) tmp = Float64(x * t); elseif (x <= 0.145) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.2e-72) tmp = x * t; elseif (x <= 0.145) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.2e-72], N[(x * t), $MachinePrecision], If[LessEqual[x, 0.145], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-72}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 0.145:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -8.20000000000000007e-72 or 0.14499999999999999 < x Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6450.5%
Simplified50.5%
if -8.20000000000000007e-72 < x < 0.14499999999999999Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
*-lowering-*.f6465.7%
Simplified65.7%
Final simplification57.5%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + ((y + z) * 2.0)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + ((y + z) * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + ((y + z) * 2.0)));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + ((y + z) * 2.0)))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + ((y + z) * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + z\right) \cdot 2\right)
\end{array}
Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
*-lowering-*.f6433.0%
Simplified33.0%
Final simplification33.0%
herbie shell --seed 2024160
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))