
(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 13 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 x (fma 2.0 (+ y z) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, fma(2.0, (y + z), t), (y * 5.0));
}
function code(x, y, z, t) return fma(x, fma(2.0, Float64(y + z), t), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f6499.9
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -5.5e-25)
t_1
(if (<= x -2.1e-213)
(fma y 5.0 (* x t))
(if (<= x 4.45e-7) (fma 5.0 y (* x (* 2.0 z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -5.5e-25) {
tmp = t_1;
} else if (x <= -2.1e-213) {
tmp = fma(y, 5.0, (x * t));
} else if (x <= 4.45e-7) {
tmp = fma(5.0, y, (x * (2.0 * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -5.5e-25) tmp = t_1; elseif (x <= -2.1e-213) tmp = fma(y, 5.0, Float64(x * t)); elseif (x <= 4.45e-7) tmp = fma(5.0, y, Float64(x * Float64(2.0 * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e-25], t$95$1, If[LessEqual[x, -2.1e-213], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(5.0 * y + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-213}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
\mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.50000000000000004e-25 or 4.45e-7 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6496.6
Simplified96.6%
if -5.50000000000000004e-25 < x < -2.0999999999999998e-213Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f6499.9
Simplified99.9%
Taylor expanded in z around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-+r+N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower-fma.f64N/A
Simplified85.2%
Taylor expanded in x around 0
Simplified85.2%
if -2.0999999999999998e-213 < x < 4.45e-7Initial program 99.9%
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+r+N/A
lower-+.f64N/A
Applied egg-rr99.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6485.3
Simplified85.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ y y))))
(if (<= x -2e+225)
t_1
(if (<= x -2.55e-33)
(* x t)
(if (<= x 4.45e-7) (* y 5.0) (if (<= x 4.2e+93) (* x t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y + y);
double tmp;
if (x <= -2e+225) {
tmp = t_1;
} else if (x <= -2.55e-33) {
tmp = x * t;
} else if (x <= 4.45e-7) {
tmp = y * 5.0;
} else if (x <= 4.2e+93) {
tmp = 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 * (y + y)
if (x <= (-2d+225)) then
tmp = t_1
else if (x <= (-2.55d-33)) then
tmp = x * t
else if (x <= 4.45d-7) then
tmp = y * 5.0d0
else if (x <= 4.2d+93) then
tmp = 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 * (y + y);
double tmp;
if (x <= -2e+225) {
tmp = t_1;
} else if (x <= -2.55e-33) {
tmp = x * t;
} else if (x <= 4.45e-7) {
tmp = y * 5.0;
} else if (x <= 4.2e+93) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y + y) tmp = 0 if x <= -2e+225: tmp = t_1 elif x <= -2.55e-33: tmp = x * t elif x <= 4.45e-7: tmp = y * 5.0 elif x <= 4.2e+93: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y + y)) tmp = 0.0 if (x <= -2e+225) tmp = t_1; elseif (x <= -2.55e-33) tmp = Float64(x * t); elseif (x <= 4.45e-7) tmp = Float64(y * 5.0); elseif (x <= 4.2e+93) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y + y); tmp = 0.0; if (x <= -2e+225) tmp = t_1; elseif (x <= -2.55e-33) tmp = x * t; elseif (x <= 4.45e-7) tmp = y * 5.0; elseif (x <= 4.2e+93) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+225], t$95$1, If[LessEqual[x, -2.55e-33], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+93], N[(x * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y + y\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-33}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.99999999999999986e225 or 4.1999999999999996e93 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64100.0
Simplified100.0%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6451.1
Simplified51.1%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
count-2N/A
lower-+.f6451.1
Simplified51.1%
if -1.99999999999999986e225 < x < -2.55000000000000004e-33 or 4.45e-7 < x < 4.1999999999999996e93Initial program 99.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6443.2
Simplified43.2%
if -2.55000000000000004e-33 < x < 4.45e-7Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6457.6
Simplified57.6%
Final simplification52.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (fma x 2.0 5.0))))
(if (<= y -5.5e+53)
t_1
(if (<= y 55.0)
(* x (fma 2.0 z t))
(if (<= y 1.4e+118) (fma x t (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -5.5e+53) {
tmp = t_1;
} else if (y <= 55.0) {
tmp = x * fma(2.0, z, t);
} else if (y <= 1.4e+118) {
tmp = fma(x, t, (y * 5.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -5.5e+53) tmp = t_1; elseif (y <= 55.0) tmp = Float64(x * fma(2.0, z, t)); elseif (y <= 1.4e+118) tmp = fma(x, t, Float64(y * 5.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+53], t$95$1, If[LessEqual[y, 55.0], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+118], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 55:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.49999999999999975e53 or 1.39999999999999993e118 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6481.3
Simplified81.3%
if -5.49999999999999975e53 < y < 55Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6482.7
Simplified82.7%
if 55 < y < 1.39999999999999993e118Initial program 99.9%
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+r+N/A
lower-+.f64N/A
Applied egg-rr96.2%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
lower-fma.f64N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-inversesN/A
associate-/l*N/A
Simplified80.3%
Final simplification81.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 z t))))
(if (<= x -1.05e-37)
t_1
(if (<= x 7e-132) (* y 5.0) (if (<= x 8e-10) t_1 (* x (fma y 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, z, t);
double tmp;
if (x <= -1.05e-37) {
tmp = t_1;
} else if (x <= 7e-132) {
tmp = y * 5.0;
} else if (x <= 8e-10) {
tmp = t_1;
} else {
tmp = x * fma(y, 2.0, t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, z, t)) tmp = 0.0 if (x <= -1.05e-37) tmp = t_1; elseif (x <= 7e-132) tmp = Float64(y * 5.0); elseif (x <= 8e-10) tmp = t_1; else tmp = Float64(x * fma(y, 2.0, t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-37], t$95$1, If[LessEqual[x, 7e-132], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8e-10], t$95$1, N[(x * N[(y * 2.0 + t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-132}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, 2, t\right)\\
\end{array}
\end{array}
if x < -1.05e-37 or 6.9999999999999999e-132 < x < 8.00000000000000029e-10Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6467.1
Simplified67.1%
if -1.05e-37 < x < 6.9999999999999999e-132Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6464.2
Simplified64.2%
if 8.00000000000000029e-10 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6497.3
Simplified97.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6478.9
Simplified78.9%
Final simplification68.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.3e+250)
(* x (+ y y))
(if (<= y -5.5e+73)
(* y 5.0)
(if (<= y 1e+53) (* x (fma 2.0 z t)) (* y 5.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e+250) {
tmp = x * (y + y);
} else if (y <= -5.5e+73) {
tmp = y * 5.0;
} else if (y <= 1e+53) {
tmp = x * fma(2.0, z, t);
} else {
tmp = y * 5.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e+250) tmp = Float64(x * Float64(y + y)); elseif (y <= -5.5e+73) tmp = Float64(y * 5.0); elseif (y <= 1e+53) tmp = Float64(x * fma(2.0, z, t)); else tmp = Float64(y * 5.0); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e+250], N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.5e+73], N[(y * 5.0), $MachinePrecision], If[LessEqual[y, 1e+53], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+250}:\\
\;\;\;\;x \cdot \left(y + y\right)\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+73}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 10^{+53}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if y < -3.30000000000000006e250Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6464.8
Simplified64.8%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6463.8
Simplified63.8%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
count-2N/A
lower-+.f6463.8
Simplified63.8%
if -3.30000000000000006e250 < y < -5.5000000000000003e73 or 9.9999999999999999e52 < y Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6450.3
Simplified50.3%
if -5.5000000000000003e73 < y < 9.9999999999999999e52Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6478.8
Simplified78.8%
Final simplification66.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -48000.0)
t_1
(if (<= x 2.5) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -48000.0) {
tmp = t_1;
} else if (x <= 2.5) {
tmp = fma(y, 5.0, (x * (t + (z + z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -48000.0) tmp = t_1; elseif (x <= 2.5) tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -48000.0], t$95$1, If[LessEqual[x, 2.5], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -48000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.5:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -48000 or 2.5 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6498.9
Simplified98.9%
if -48000 < x < 2.5Initial program 99.9%
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
Applied egg-rr98.7%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.7e+109)
(fma 5.0 y (* x (* 2.0 z)))
(if (<= z 2.9e+112)
(fma x (fma y 2.0 t) (* y 5.0))
(* x (fma 2.0 (+ y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.7e+109) {
tmp = fma(5.0, y, (x * (2.0 * z)));
} else if (z <= 2.9e+112) {
tmp = fma(x, fma(y, 2.0, t), (y * 5.0));
} else {
tmp = x * fma(2.0, (y + z), t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -5.7e+109) tmp = fma(5.0, y, Float64(x * Float64(2.0 * z))); elseif (z <= 2.9e+112) tmp = fma(x, fma(y, 2.0, t), Float64(y * 5.0)); else tmp = Float64(x * fma(2.0, Float64(y + z), t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.7e+109], N[(5.0 * y + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+112], N[(x * N[(y * 2.0 + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\end{array}
\end{array}
if z < -5.7000000000000002e109Initial program 100.0%
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+r+N/A
lower-+.f64N/A
Applied egg-rr93.3%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.4
Simplified87.4%
if -5.7000000000000002e109 < z < 2.9000000000000002e112Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6491.6
Simplified91.6%
if 2.9000000000000002e112 < z Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6483.9
Simplified83.9%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (<= x -5.5e-25) (* z (+ x x)) (if (<= x 4.45e-7) (* y 5.0) (if (<= x 4.2e+93) (* x t) (* x (+ y y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e-25) {
tmp = z * (x + x);
} else if (x <= 4.45e-7) {
tmp = y * 5.0;
} else if (x <= 4.2e+93) {
tmp = x * t;
} else {
tmp = x * (y + y);
}
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 <= (-5.5d-25)) then
tmp = z * (x + x)
else if (x <= 4.45d-7) then
tmp = y * 5.0d0
else if (x <= 4.2d+93) then
tmp = x * t
else
tmp = x * (y + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e-25) {
tmp = z * (x + x);
} else if (x <= 4.45e-7) {
tmp = y * 5.0;
} else if (x <= 4.2e+93) {
tmp = x * t;
} else {
tmp = x * (y + y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.5e-25: tmp = z * (x + x) elif x <= 4.45e-7: tmp = y * 5.0 elif x <= 4.2e+93: tmp = x * t else: tmp = x * (y + y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.5e-25) tmp = Float64(z * Float64(x + x)); elseif (x <= 4.45e-7) tmp = Float64(y * 5.0); elseif (x <= 4.2e+93) tmp = Float64(x * t); else tmp = Float64(x * Float64(y + y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.5e-25) tmp = z * (x + x); elseif (x <= 4.45e-7) tmp = y * 5.0; elseif (x <= 4.2e+93) tmp = x * t; else tmp = x * (y + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.5e-25], N[(z * N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+93], N[(x * t), $MachinePrecision], N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;z \cdot \left(x + x\right)\\
\mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + y\right)\\
\end{array}
\end{array}
if x < -5.50000000000000004e-25Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6494.9
Simplified94.9%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f6468.6
Simplified68.6%
distribute-lft-inN/A
count-2N/A
associate-+r+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f6468.6
Applied egg-rr68.6%
Taylor expanded in y around 0
associate-*r*N/A
lower-*.f64N/A
count-2N/A
lower-+.f6441.6
Simplified41.6%
if -5.50000000000000004e-25 < x < 4.45e-7Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6457.5
Simplified57.5%
if 4.45e-7 < x < 4.1999999999999996e93Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6469.9
Simplified69.9%
if 4.1999999999999996e93 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64100.0
Simplified100.0%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6449.6
Simplified49.6%
Taylor expanded in y around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
count-2N/A
lower-+.f6449.6
Simplified49.6%
Final simplification52.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 (+ y z) t)))) (if (<= x -5.5e-25) t_1 (if (<= x 4.5e-131) (fma y 5.0 (* x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -5.5e-25) {
tmp = t_1;
} else if (x <= 4.5e-131) {
tmp = fma(y, 5.0, (x * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -5.5e-25) tmp = t_1; elseif (x <= 4.5e-131) tmp = fma(y, 5.0, Float64(x * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e-25], t$95$1, If[LessEqual[x, 4.5e-131], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.50000000000000004e-25 or 4.5000000000000002e-131 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6491.3
Simplified91.3%
if -5.50000000000000004e-25 < x < 4.5000000000000002e-131Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f6499.9
Simplified99.9%
Taylor expanded in z around 0
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-+r+N/A
distribute-rgt-inN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
lower-fma.f64N/A
Simplified80.6%
Taylor expanded in x around 0
Simplified80.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (fma x 2.0 5.0)))) (if (<= y -5.5e+53) t_1 (if (<= y 1.7e+52) (* x (fma 2.0 z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -5.5e+53) {
tmp = t_1;
} else if (y <= 1.7e+52) {
tmp = x * fma(2.0, z, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -5.5e+53) tmp = t_1; elseif (y <= 1.7e+52) tmp = Float64(x * fma(2.0, z, t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+53], t$95$1, If[LessEqual[y, 1.7e+52], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.49999999999999975e53 or 1.7e52 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6480.1
Simplified80.1%
if -5.49999999999999975e53 < y < 1.7e52Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6480.1
Simplified80.1%
(FPCore (x y z t) :precision binary64 (if (<= x -2.55e-33) (* x t) (if (<= x 4.45e-7) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.55e-33) {
tmp = x * t;
} else if (x <= 4.45e-7) {
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 <= (-2.55d-33)) then
tmp = x * t
else if (x <= 4.45d-7) 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 <= -2.55e-33) {
tmp = x * t;
} else if (x <= 4.45e-7) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.55e-33: tmp = x * t elif x <= 4.45e-7: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.55e-33) tmp = Float64(x * t); elseif (x <= 4.45e-7) 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 <= -2.55e-33) tmp = x * t; elseif (x <= 4.45e-7) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.55e-33], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{-33}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.55000000000000004e-33 or 4.45e-7 < x Initial program 99.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6439.1
Simplified39.1%
if -2.55000000000000004e-33 < x < 4.45e-7Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6457.6
Simplified57.6%
Final simplification48.6%
(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%
Taylor expanded in x around 0
lower-*.f6432.0
Simplified32.0%
Final simplification32.0%
herbie shell --seed 2024212
(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)))