
(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 16 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 (+ (+ y t) (+ y (+ z z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((y + t) + (y + (z + z))), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(y + t) + Float64(y + Float64(z + z))), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(y + t), $MachinePrecision] + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \left(y + t\right) + \left(y + \left(z + z\right)\right), y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
associate-+l+99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* 2.0 (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + (2.0 * (y + z))), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(2.0 * Float64(y + z))), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + 2 \cdot \left(y + z\right), y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.058) (not (<= x 3.8e-35))) (* x (+ t (+ (* 2.0 (+ y z)) (* 5.0 (/ y x))))) (+ (* y 5.0) (* x (+ t (+ y (+ z z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.058) || !(x <= 3.8e-35)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
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 <= (-0.058d0)) .or. (.not. (x <= 3.8d-35))) then
tmp = x * (t + ((2.0d0 * (y + z)) + (5.0d0 * (y / x))))
else
tmp = (y * 5.0d0) + (x * (t + (y + (z + z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.058) || !(x <= 3.8e-35)) {
tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x))));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.058) or not (x <= 3.8e-35): tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))) else: tmp = (y * 5.0) + (x * (t + (y + (z + z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.058) || !(x <= 3.8e-35)) tmp = Float64(x * Float64(t + Float64(Float64(2.0 * Float64(y + z)) + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -0.058) || ~((x <= 3.8e-35))) tmp = x * (t + ((2.0 * (y + z)) + (5.0 * (y / x)))); else tmp = (y * 5.0) + (x * (t + (y + (z + z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.058], N[Not[LessEqual[x, 3.8e-35]], $MachinePrecision]], N[(x * N[(t + N[(N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.058 \lor \neg \left(x \leq 3.8 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + \left(z + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -0.0580000000000000029 or 3.8000000000000001e-35 < x Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -0.0580000000000000029 < x < 3.8000000000000001e-35Initial program 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 5.0))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x (+ t (+ y (+ z z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 5.0)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
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.5d0)) .or. (.not. (x <= 5.0d0))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (x * (t + (y + (z + z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 5.0)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 5.0): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * (t + (y + (z + z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 5.0)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 5.0))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * (t + (y + (z + z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 5.0]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 5\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + \left(z + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.5 or 5 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.7%
if -2.5 < x < 5Initial program 99.9%
Taylor expanded in y around 0 99.6%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -7.5e+72)
t_1
(if (<= x -1e-7)
(* (+ y z) (* x 2.0))
(if (<= x 1900000000.0) (+ (* y 5.0) (* x t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -7.5e+72) {
tmp = t_1;
} else if (x <= -1e-7) {
tmp = (y + z) * (x * 2.0);
} else if (x <= 1900000000.0) {
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 * 2.0d0))
if (x <= (-7.5d+72)) then
tmp = t_1
else if (x <= (-1d-7)) then
tmp = (y + z) * (x * 2.0d0)
else if (x <= 1900000000.0d0) 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 * 2.0));
double tmp;
if (x <= -7.5e+72) {
tmp = t_1;
} else if (x <= -1e-7) {
tmp = (y + z) * (x * 2.0);
} else if (x <= 1900000000.0) {
tmp = (y * 5.0) + (x * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -7.5e+72: tmp = t_1 elif x <= -1e-7: tmp = (y + z) * (x * 2.0) elif x <= 1900000000.0: 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(y * 2.0))) tmp = 0.0 if (x <= -7.5e+72) tmp = t_1; elseif (x <= -1e-7) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif (x <= 1900000000.0) 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 * 2.0)); tmp = 0.0; if (x <= -7.5e+72) tmp = t_1; elseif (x <= -1e-7) tmp = (y + z) * (x * 2.0); elseif (x <= 1900000000.0) 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[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+72], t$95$1, If[LessEqual[x, -1e-7], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1900000000.0], 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 + y \cdot 2\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq 1900000000:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.50000000000000027e72 or 1.9e9 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 80.6%
if -7.50000000000000027e72 < x < -9.9999999999999995e-8Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 91.7%
Taylor expanded in t around 0 82.6%
associate-*r*82.6%
*-commutative82.6%
Simplified82.6%
if -9.9999999999999995e-8 < x < 1.9e9Initial program 99.9%
Taylor expanded in t around inf 81.4%
Simplified81.4%
Final simplification81.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ x 5.0))))
(if (<= y -900000000000.0)
t_1
(if (<= y 1.42e+29)
(* x (+ t (* z 2.0)))
(if (<= y 8.5e+183) (* x (+ t (* y 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x + 5.0);
double tmp;
if (y <= -900000000000.0) {
tmp = t_1;
} else if (y <= 1.42e+29) {
tmp = x * (t + (z * 2.0));
} else if (y <= 8.5e+183) {
tmp = x * (t + (y * 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 * (x + 5.0d0)
if (y <= (-900000000000.0d0)) then
tmp = t_1
else if (y <= 1.42d+29) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 8.5d+183) then
tmp = x * (t + (y * 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 * (x + 5.0);
double tmp;
if (y <= -900000000000.0) {
tmp = t_1;
} else if (y <= 1.42e+29) {
tmp = x * (t + (z * 2.0));
} else if (y <= 8.5e+183) {
tmp = x * (t + (y * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x + 5.0) tmp = 0 if y <= -900000000000.0: tmp = t_1 elif y <= 1.42e+29: tmp = x * (t + (z * 2.0)) elif y <= 8.5e+183: tmp = x * (t + (y * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x + 5.0)) tmp = 0.0 if (y <= -900000000000.0) tmp = t_1; elseif (y <= 1.42e+29) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 8.5e+183) tmp = Float64(x * Float64(t + Float64(y * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x + 5.0); tmp = 0.0; if (y <= -900000000000.0) tmp = t_1; elseif (y <= 1.42e+29) tmp = x * (t + (z * 2.0)); elseif (y <= 8.5e+183) tmp = x * (t + (y * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -900000000000.0], t$95$1, If[LessEqual[y, 1.42e+29], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+183], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x + 5\right)\\
\mathbf{if}\;y \leq -900000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+183}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9e11 or 8.5000000000000004e183 < y Initial program 99.9%
Taylor expanded in y around 0 87.8%
Taylor expanded in y around inf 69.7%
if -9e11 < y < 1.42e29Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 80.4%
Taylor expanded in y around 0 77.8%
if 1.42e29 < y < 8.5000000000000004e183Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 83.6%
Taylor expanded in z around 0 71.6%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))))
(if (<= x -1.35e+57)
t_1
(if (<= x -6.4e-52)
(* z (* x 2.0))
(if (<= x 1.4e-111) (* y (+ x 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double tmp;
if (x <= -1.35e+57) {
tmp = t_1;
} else if (x <= -6.4e-52) {
tmp = z * (x * 2.0);
} else if (x <= 1.4e-111) {
tmp = y * (x + 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 + (y * 2.0d0))
if (x <= (-1.35d+57)) then
tmp = t_1
else if (x <= (-6.4d-52)) then
tmp = z * (x * 2.0d0)
else if (x <= 1.4d-111) then
tmp = y * (x + 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 + (y * 2.0));
double tmp;
if (x <= -1.35e+57) {
tmp = t_1;
} else if (x <= -6.4e-52) {
tmp = z * (x * 2.0);
} else if (x <= 1.4e-111) {
tmp = y * (x + 5.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) tmp = 0 if x <= -1.35e+57: tmp = t_1 elif x <= -6.4e-52: tmp = z * (x * 2.0) elif x <= 1.4e-111: tmp = y * (x + 5.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) tmp = 0.0 if (x <= -1.35e+57) tmp = t_1; elseif (x <= -6.4e-52) tmp = Float64(z * Float64(x * 2.0)); elseif (x <= 1.4e-111) tmp = Float64(y * Float64(x + 5.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); tmp = 0.0; if (x <= -1.35e+57) tmp = t_1; elseif (x <= -6.4e-52) tmp = z * (x * 2.0); elseif (x <= 1.4e-111) tmp = y * (x + 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[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+57], t$95$1, If[LessEqual[x, -6.4e-52], N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-111], N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-52}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-111}:\\
\;\;\;\;y \cdot \left(x + 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.3499999999999999e57 or 1.39999999999999998e-111 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 95.9%
Taylor expanded in z around 0 76.3%
if -1.3499999999999999e57 < x < -6.4000000000000002e-52Initial program 99.9%
Taylor expanded in z around inf 68.6%
Taylor expanded in x around inf 68.6%
Taylor expanded in x around inf 61.4%
associate-*r*61.4%
*-commutative61.4%
Simplified61.4%
if -6.4000000000000002e-52 < x < 1.39999999999999998e-111Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in y around inf 60.4%
Final simplification69.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= x -2.5)
t_1
(if (<= x 1.35e-111)
(* y 5.0)
(if (<= x 80000000000000.0) (* x t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x * 2.0);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 1.35e-111) {
tmp = y * 5.0;
} else if (x <= 80000000000000.0) {
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 = y * (x * 2.0d0)
if (x <= (-2.5d0)) then
tmp = t_1
else if (x <= 1.35d-111) then
tmp = y * 5.0d0
else if (x <= 80000000000000.0d0) 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 = y * (x * 2.0);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 1.35e-111) {
tmp = y * 5.0;
} else if (x <= 80000000000000.0) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x * 2.0) tmp = 0 if x <= -2.5: tmp = t_1 elif x <= 1.35e-111: tmp = y * 5.0 elif x <= 80000000000000.0: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (x <= -2.5) tmp = t_1; elseif (x <= 1.35e-111) tmp = Float64(y * 5.0); elseif (x <= 80000000000000.0) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x * 2.0); tmp = 0.0; if (x <= -2.5) tmp = t_1; elseif (x <= 1.35e-111) tmp = y * 5.0; elseif (x <= 80000000000000.0) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5], t$95$1, If[LessEqual[x, 1.35e-111], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 80000000000000.0], N[(x * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-111}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 80000000000000:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5 or 8e13 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.7%
Taylor expanded in y around inf 43.6%
associate-*r*43.6%
*-commutative43.6%
Simplified43.6%
if -2.5 < x < 1.34999999999999994e-111Initial program 99.8%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 57.4%
Simplified57.4%
Taylor expanded in x around 0 57.4%
if 1.34999999999999994e-111 < x < 8e13Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 71.7%
Taylor expanded in t around inf 51.6%
*-commutative51.6%
Simplified51.6%
Final simplification49.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e-35) (not (<= x 1.6e-8))) (* x (+ t (* 2.0 (+ y z)))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e-35) || !(x <= 1.6e-8)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (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.3d-35)) .or. (.not. (x <= 1.6d-8))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (y * 5.0d0) + (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.3e-35) || !(x <= 1.6e-8)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.3e-35) or not (x <= 1.6e-8): tmp = x * (t + (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.3e-35) || !(x <= 1.6e-8)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.3e-35) || ~((x <= 1.6e-8))) tmp = x * (t + (2.0 * (y + z))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.3e-35], N[Not[LessEqual[x, 1.6e-8]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-35} \lor \neg \left(x \leq 1.6 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -2.2999999999999999e-35 or 1.6000000000000001e-8 < x Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.0%
if -2.2999999999999999e-35 < x < 1.6000000000000001e-8Initial program 99.8%
Taylor expanded in t around inf 82.8%
Simplified82.8%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7000000000000.0) (not (<= y 5.5e+60))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7000000000000.0) || !(y <= 5.5e+60)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
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 ((y <= (-7000000000000.0d0)) .or. (.not. (y <= 5.5d+60))) then
tmp = y * (5.0d0 + (x * 2.0d0))
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7000000000000.0) || !(y <= 5.5e+60)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7000000000000.0) or not (y <= 5.5e+60): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7000000000000.0) || !(y <= 5.5e+60)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7000000000000.0) || ~((y <= 5.5e+60))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7000000000000.0], N[Not[LessEqual[y, 5.5e+60]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7000000000000 \lor \neg \left(y \leq 5.5 \cdot 10^{+60}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -7e12 or 5.5000000000000001e60 < y Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 78.8%
if -7e12 < y < 5.5000000000000001e60Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 81.1%
Taylor expanded in y around 0 77.3%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1960000000000.0) (not (<= y 7e+55))) (* y (+ x 5.0)) (* x t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1960000000000.0) || !(y <= 7e+55)) {
tmp = y * (x + 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 ((y <= (-1960000000000.0d0)) .or. (.not. (y <= 7d+55))) then
tmp = y * (x + 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 ((y <= -1960000000000.0) || !(y <= 7e+55)) {
tmp = y * (x + 5.0);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1960000000000.0) or not (y <= 7e+55): tmp = y * (x + 5.0) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1960000000000.0) || !(y <= 7e+55)) tmp = Float64(y * Float64(x + 5.0)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1960000000000.0) || ~((y <= 7e+55))) tmp = y * (x + 5.0); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1960000000000.0], N[Not[LessEqual[y, 7e+55]], $MachinePrecision]], N[(y * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1960000000000 \lor \neg \left(y \leq 7 \cdot 10^{+55}\right):\\
\;\;\;\;y \cdot \left(x + 5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if y < -1.96e12 or 7.00000000000000021e55 < y Initial program 99.9%
Taylor expanded in y around 0 86.3%
Taylor expanded in y around inf 65.4%
if -1.96e12 < y < 7.00000000000000021e55Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 81.1%
Taylor expanded in t around inf 47.1%
*-commutative47.1%
Simplified47.1%
Final simplification55.4%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ y (* z 2.0)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (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 + (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 + (y + (z * 2.0)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (y + (z * 2.0)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(y + Float64(z * 2.0)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (y + (z * 2.0))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(y + z \cdot 2\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.22e+57) (not (<= t 7e-65))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.22e+57) || !(t <= 7e-65)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
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 ((t <= (-1.22d+57)) .or. (.not. (t <= 7d-65))) then
tmp = x * t
else
tmp = y * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.22e+57) || !(t <= 7e-65)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.22e+57) or not (t <= 7e-65): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.22e+57) || !(t <= 7e-65)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.22e+57) || ~((t <= 7e-65))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.22e+57], N[Not[LessEqual[t, 7e-65]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+57} \lor \neg \left(t \leq 7 \cdot 10^{-65}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if t < -1.22e57 or 7.00000000000000009e-65 < t Initial program 99.9%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 83.8%
Taylor expanded in t around inf 55.6%
*-commutative55.6%
Simplified55.6%
if -1.22e57 < t < 7.00000000000000009e-65Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 67.4%
Simplified36.7%
Taylor expanded in x around 0 36.7%
Final simplification46.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.1e+116) (not (<= z 1.12e+192))) (* x z) (* x t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.1e+116) || !(z <= 1.12e+192)) {
tmp = x * z;
} 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 ((z <= (-4.1d+116)) .or. (.not. (z <= 1.12d+192))) then
tmp = x * z
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 ((z <= -4.1e+116) || !(z <= 1.12e+192)) {
tmp = x * z;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.1e+116) or not (z <= 1.12e+192): tmp = x * z else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.1e+116) || !(z <= 1.12e+192)) tmp = Float64(x * z); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.1e+116) || ~((z <= 1.12e+192))) tmp = x * z; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.1e+116], N[Not[LessEqual[z, 1.12e+192]], $MachinePrecision]], N[(x * z), $MachinePrecision], N[(x * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+116} \lor \neg \left(z \leq 1.12 \cdot 10^{+192}\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if z < -4.0999999999999998e116 or 1.12e192 < z Initial program 99.9%
Taylor expanded in z around inf 88.6%
Taylor expanded in x around -inf 80.8%
Simplified4.7%
Taylor expanded in x around inf 4.4%
associate-*r*4.4%
mul-1-neg4.4%
Simplified4.4%
add-sqr-sqrt3.8%
sqrt-unprod25.3%
sqr-neg25.3%
sqrt-unprod22.0%
add-sqr-sqrt44.5%
pow144.5%
Applied egg-rr44.5%
unpow144.5%
Simplified44.5%
if -4.0999999999999998e116 < z < 1.12e192Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 87.2%
Taylor expanded in t around inf 36.0%
*-commutative36.0%
Simplified36.0%
Final simplification38.0%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
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 * t
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 87.2%
Taylor expanded in t around inf 31.9%
*-commutative31.9%
Simplified31.9%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -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 = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 48.9%
Simplified26.9%
Taylor expanded in y around 0 26.9%
Simplified3.1%
herbie shell --seed 2024132
(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)))