
(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 17 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 (if (or (<= x -4e+38) (not (<= x 1e+39))) (* x (+ t (* 2.0 (+ y z)))) (+ (* x (+ t (* z 2.0))) (* y (+ 5.0 (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4e+38) || !(x <= 1e+39)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 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 ((x <= (-4d+38)) .or. (.not. (x <= 1d+39))) then
tmp = x * (t + (2.0d0 * (y + z)))
else
tmp = (x * (t + (z * 2.0d0))) + (y * (5.0d0 + (x * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4e+38) || !(x <= 1e+39)) {
tmp = x * (t + (2.0 * (y + z)));
} else {
tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4e+38) or not (x <= 1e+39): tmp = x * (t + (2.0 * (y + z))) else: tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4e+38) || !(x <= 1e+39)) tmp = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))); else tmp = Float64(Float64(x * Float64(t + Float64(z * 2.0))) + Float64(y * Float64(5.0 + Float64(x * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4e+38) || ~((x <= 1e+39))) tmp = x * (t + (2.0 * (y + z))); else tmp = (x * (t + (z * 2.0))) + (y * (5.0 + (x * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4e+38], N[Not[LessEqual[x, 1e+39]], $MachinePrecision]], N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+38} \lor \neg \left(x \leq 10^{+39}\right):\\
\;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)\\
\end{array}
\end{array}
if x < -3.99999999999999991e38 or 9.9999999999999994e38 < 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%
if -3.99999999999999991e38 < x < 9.9999999999999994e38Initial program 99.9%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (fma x (+ (+ y (+ z z)) (+ y t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, ((y + (z + z)) + (y + t)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(Float64(y + Float64(z + z)) + Float64(y + t)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision] + N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \left(y + \left(z + z\right)\right) + \left(y + t\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 (<= t -4.5e+115)
(* x t)
(if (<= t -9e+74)
(* y 5.0)
(if (<= t -5.5e+23)
(* x t)
(if (<= t -9.2e-297)
(* y 5.0)
(if (<= t 9.5e-47)
(* 2.0 (* x z))
(if (<= t 1.12e+69) (* y 5.0) (* x t))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e+115) {
tmp = x * t;
} else if (t <= -9e+74) {
tmp = y * 5.0;
} else if (t <= -5.5e+23) {
tmp = x * t;
} else if (t <= -9.2e-297) {
tmp = y * 5.0;
} else if (t <= 9.5e-47) {
tmp = 2.0 * (x * z);
} else if (t <= 1.12e+69) {
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 (t <= (-4.5d+115)) then
tmp = x * t
else if (t <= (-9d+74)) then
tmp = y * 5.0d0
else if (t <= (-5.5d+23)) then
tmp = x * t
else if (t <= (-9.2d-297)) then
tmp = y * 5.0d0
else if (t <= 9.5d-47) then
tmp = 2.0d0 * (x * z)
else if (t <= 1.12d+69) 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 (t <= -4.5e+115) {
tmp = x * t;
} else if (t <= -9e+74) {
tmp = y * 5.0;
} else if (t <= -5.5e+23) {
tmp = x * t;
} else if (t <= -9.2e-297) {
tmp = y * 5.0;
} else if (t <= 9.5e-47) {
tmp = 2.0 * (x * z);
} else if (t <= 1.12e+69) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.5e+115: tmp = x * t elif t <= -9e+74: tmp = y * 5.0 elif t <= -5.5e+23: tmp = x * t elif t <= -9.2e-297: tmp = y * 5.0 elif t <= 9.5e-47: tmp = 2.0 * (x * z) elif t <= 1.12e+69: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.5e+115) tmp = Float64(x * t); elseif (t <= -9e+74) tmp = Float64(y * 5.0); elseif (t <= -5.5e+23) tmp = Float64(x * t); elseif (t <= -9.2e-297) tmp = Float64(y * 5.0); elseif (t <= 9.5e-47) tmp = Float64(2.0 * Float64(x * z)); elseif (t <= 1.12e+69) 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 (t <= -4.5e+115) tmp = x * t; elseif (t <= -9e+74) tmp = y * 5.0; elseif (t <= -5.5e+23) tmp = x * t; elseif (t <= -9.2e-297) tmp = y * 5.0; elseif (t <= 9.5e-47) tmp = 2.0 * (x * z); elseif (t <= 1.12e+69) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.5e+115], N[(x * t), $MachinePrecision], If[LessEqual[t, -9e+74], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, -5.5e+23], N[(x * t), $MachinePrecision], If[LessEqual[t, -9.2e-297], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 9.5e-47], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+69], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+115}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -9 \cdot 10^{+74}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{+23}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-297}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-47}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+69}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -4.49999999999999963e115 or -8.9999999999999999e74 < t < -5.50000000000000004e23 or 1.12e69 < t Initial program 100.0%
Taylor expanded in t around inf 66.9%
Simplified66.9%
if -4.49999999999999963e115 < t < -8.9999999999999999e74 or -5.50000000000000004e23 < t < -9.1999999999999996e-297 or 9.4999999999999991e-47 < t < 1.12e69Initial program 99.8%
Taylor expanded in x around 0 48.9%
if -9.1999999999999996e-297 < t < 9.4999999999999991e-47Initial program 100.0%
Taylor expanded in z around inf 53.5%
Final simplification57.2%
(FPCore (x y z t)
:precision binary64
(if (<= x -6.6e-56)
(* x t)
(if (<= x 2.3e-56)
(* y 5.0)
(if (<= x 1.5e+56)
(* x t)
(if (<= x 1.5e+208)
(* 2.0 (* x y))
(if (<= x 1.06e+276) (* x t) (* 2.0 (* x z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-56) {
tmp = x * t;
} else if (x <= 2.3e-56) {
tmp = y * 5.0;
} else if (x <= 1.5e+56) {
tmp = x * t;
} else if (x <= 1.5e+208) {
tmp = 2.0 * (x * y);
} else if (x <= 1.06e+276) {
tmp = x * t;
} else {
tmp = 2.0 * (x * 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 <= (-6.6d-56)) then
tmp = x * t
else if (x <= 2.3d-56) then
tmp = y * 5.0d0
else if (x <= 1.5d+56) then
tmp = x * t
else if (x <= 1.5d+208) then
tmp = 2.0d0 * (x * y)
else if (x <= 1.06d+276) then
tmp = x * t
else
tmp = 2.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.6e-56) {
tmp = x * t;
} else if (x <= 2.3e-56) {
tmp = y * 5.0;
} else if (x <= 1.5e+56) {
tmp = x * t;
} else if (x <= 1.5e+208) {
tmp = 2.0 * (x * y);
} else if (x <= 1.06e+276) {
tmp = x * t;
} else {
tmp = 2.0 * (x * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.6e-56: tmp = x * t elif x <= 2.3e-56: tmp = y * 5.0 elif x <= 1.5e+56: tmp = x * t elif x <= 1.5e+208: tmp = 2.0 * (x * y) elif x <= 1.06e+276: tmp = x * t else: tmp = 2.0 * (x * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.6e-56) tmp = Float64(x * t); elseif (x <= 2.3e-56) tmp = Float64(y * 5.0); elseif (x <= 1.5e+56) tmp = Float64(x * t); elseif (x <= 1.5e+208) tmp = Float64(2.0 * Float64(x * y)); elseif (x <= 1.06e+276) tmp = Float64(x * t); else tmp = Float64(2.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.6e-56) tmp = x * t; elseif (x <= 2.3e-56) tmp = y * 5.0; elseif (x <= 1.5e+56) tmp = x * t; elseif (x <= 1.5e+208) tmp = 2.0 * (x * y); elseif (x <= 1.06e+276) tmp = x * t; else tmp = 2.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.6e-56], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.3e-56], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.5e+56], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.5e+208], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e+276], N[(x * t), $MachinePrecision], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-56}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+208}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+276}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -6.59999999999999967e-56 or 2.30000000000000002e-56 < x < 1.50000000000000003e56 or 1.49999999999999997e208 < x < 1.05999999999999997e276Initial program 99.9%
Taylor expanded in t around inf 48.2%
Simplified48.2%
if -6.59999999999999967e-56 < x < 2.30000000000000002e-56Initial program 99.9%
Taylor expanded in x around 0 63.3%
if 1.50000000000000003e56 < x < 1.49999999999999997e208Initial program 100.0%
Taylor expanded in y around inf 64.6%
Simplified64.6%
Taylor expanded in x around inf 64.6%
*-commutative64.6%
Simplified64.6%
if 1.05999999999999997e276 < x Initial program 100.0%
Taylor expanded in z around inf 61.2%
Final simplification57.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* x (+ t (* 2.0 (+ y z))))))
(if (<= x -2.3e-59)
t_2
(if (<= x 2.05e-254)
t_1
(if (<= x 8.3e-137)
(* z (+ (* x 2.0) (* y (/ 5.0 z))))
(if (<= x 1.55e-49) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -2.3e-59) {
tmp = t_2;
} else if (x <= 2.05e-254) {
tmp = t_1;
} else if (x <= 8.3e-137) {
tmp = z * ((x * 2.0) + (y * (5.0 / z)));
} else if (x <= 1.55e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (y * 5.0d0) + (x * t)
t_2 = x * (t + (2.0d0 * (y + z)))
if (x <= (-2.3d-59)) then
tmp = t_2
else if (x <= 2.05d-254) then
tmp = t_1
else if (x <= 8.3d-137) then
tmp = z * ((x * 2.0d0) + (y * (5.0d0 / z)))
else if (x <= 1.55d-49) then
tmp = t_1
else
tmp = t_2
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 * t);
double t_2 = x * (t + (2.0 * (y + z)));
double tmp;
if (x <= -2.3e-59) {
tmp = t_2;
} else if (x <= 2.05e-254) {
tmp = t_1;
} else if (x <= 8.3e-137) {
tmp = z * ((x * 2.0) + (y * (5.0 / z)));
} else if (x <= 1.55e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = x * (t + (2.0 * (y + z))) tmp = 0 if x <= -2.3e-59: tmp = t_2 elif x <= 2.05e-254: tmp = t_1 elif x <= 8.3e-137: tmp = z * ((x * 2.0) + (y * (5.0 / z))) elif x <= 1.55e-49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) t_2 = Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))) tmp = 0.0 if (x <= -2.3e-59) tmp = t_2; elseif (x <= 2.05e-254) tmp = t_1; elseif (x <= 8.3e-137) tmp = Float64(z * Float64(Float64(x * 2.0) + Float64(y * Float64(5.0 / z)))); elseif (x <= 1.55e-49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (x * t); t_2 = x * (t + (2.0 * (y + z))); tmp = 0.0; if (x <= -2.3e-59) tmp = t_2; elseif (x <= 2.05e-254) tmp = t_1; elseif (x <= 8.3e-137) tmp = z * ((x * 2.0) + (y * (5.0 / z))); elseif (x <= 1.55e-49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e-59], t$95$2, If[LessEqual[x, 2.05e-254], t$95$1, If[LessEqual[x, 8.3e-137], N[(z * N[(N[(x * 2.0), $MachinePrecision] + N[(y * N[(5.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e-49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.3 \cdot 10^{-137}:\\
\;\;\;\;z \cdot \left(x \cdot 2 + y \cdot \frac{5}{z}\right)\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.29999999999999979e-59 or 1.55e-49 < 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 98.6%
if -2.29999999999999979e-59 < x < 2.05000000000000009e-254 or 8.30000000000000018e-137 < x < 1.55e-49Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified83.1%
Taylor expanded in x around 0 83.1%
if 2.05000000000000009e-254 < x < 8.30000000000000018e-137Initial program 99.8%
Taylor expanded in z around inf 94.9%
Taylor expanded in x around 0 94.9%
associate-*r/95.2%
*-commutative95.2%
associate-*r/95.2%
Simplified95.2%
Final simplification92.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -3.4e+47)
t_1
(if (<= y 5.8e-53)
(* x (+ t (* z 2.0)))
(if (or (<= y 5.5e-7) (not (<= y 4.5e+80)))
t_1
(+ (* y 5.0) (* x t)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.4e+47) {
tmp = t_1;
} else if (y <= 5.8e-53) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 5.5e-7) || !(y <= 4.5e+80)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-3.4d+47)) then
tmp = t_1
else if (y <= 5.8d-53) then
tmp = x * (t + (z * 2.0d0))
else if ((y <= 5.5d-7) .or. (.not. (y <= 4.5d+80))) then
tmp = t_1
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 t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.4e+47) {
tmp = t_1;
} else if (y <= 5.8e-53) {
tmp = x * (t + (z * 2.0));
} else if ((y <= 5.5e-7) || !(y <= 4.5e+80)) {
tmp = t_1;
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -3.4e+47: tmp = t_1 elif y <= 5.8e-53: tmp = x * (t + (z * 2.0)) elif (y <= 5.5e-7) or not (y <= 4.5e+80): tmp = t_1 else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -3.4e+47) tmp = t_1; elseif (y <= 5.8e-53) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif ((y <= 5.5e-7) || !(y <= 4.5e+80)) tmp = t_1; else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); 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 <= -3.4e+47) tmp = t_1; elseif (y <= 5.8e-53) tmp = x * (t + (z * 2.0)); elseif ((y <= 5.5e-7) || ~((y <= 4.5e+80))) tmp = t_1; else tmp = (y * 5.0) + (x * t); 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, -3.4e+47], t$95$1, If[LessEqual[y, 5.8e-53], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 5.5e-7], N[Not[LessEqual[y, 4.5e+80]], $MachinePrecision]], t$95$1, N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-53}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-7} \lor \neg \left(y \leq 4.5 \cdot 10^{+80}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if y < -3.3999999999999998e47 or 5.7999999999999996e-53 < y < 5.5000000000000003e-7 or 4.50000000000000007e80 < y Initial program 99.8%
Taylor expanded in y around inf 89.5%
Simplified89.5%
if -3.3999999999999998e47 < y < 5.7999999999999996e-53Initial program 100.0%
Taylor expanded in y around 0 82.5%
if 5.5000000000000003e-7 < y < 4.50000000000000007e80Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified66.4%
Taylor expanded in x around 0 66.4%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -260000.0)
(* x (+ t (* y 2.0)))
(if (<= x -1.26e-62)
t_1
(if (<= x 1.35e-86)
(* y 5.0)
(if (<= x 8e+55) t_1 (* 2.0 (* x (+ y z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -260000.0) {
tmp = x * (t + (y * 2.0));
} else if (x <= -1.26e-62) {
tmp = t_1;
} else if (x <= 1.35e-86) {
tmp = y * 5.0;
} else if (x <= 8e+55) {
tmp = t_1;
} else {
tmp = 2.0 * (x * (y + 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) :: t_1
real(8) :: tmp
t_1 = x * (t + (z * 2.0d0))
if (x <= (-260000.0d0)) then
tmp = x * (t + (y * 2.0d0))
else if (x <= (-1.26d-62)) then
tmp = t_1
else if (x <= 1.35d-86) then
tmp = y * 5.0d0
else if (x <= 8d+55) then
tmp = t_1
else
tmp = 2.0d0 * (x * (y + z))
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 <= -260000.0) {
tmp = x * (t + (y * 2.0));
} else if (x <= -1.26e-62) {
tmp = t_1;
} else if (x <= 1.35e-86) {
tmp = y * 5.0;
} else if (x <= 8e+55) {
tmp = t_1;
} else {
tmp = 2.0 * (x * (y + z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -260000.0: tmp = x * (t + (y * 2.0)) elif x <= -1.26e-62: tmp = t_1 elif x <= 1.35e-86: tmp = y * 5.0 elif x <= 8e+55: tmp = t_1 else: tmp = 2.0 * (x * (y + z)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -260000.0) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (x <= -1.26e-62) tmp = t_1; elseif (x <= 1.35e-86) tmp = Float64(y * 5.0); elseif (x <= 8e+55) tmp = t_1; else tmp = Float64(2.0 * Float64(x * Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -260000.0) tmp = x * (t + (y * 2.0)); elseif (x <= -1.26e-62) tmp = t_1; elseif (x <= 1.35e-86) tmp = y * 5.0; elseif (x <= 8e+55) tmp = t_1; else tmp = 2.0 * (x * (y + z)); 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, -260000.0], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.26e-62], t$95$1, If[LessEqual[x, 1.35e-86], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8e+55], t$95$1, N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -260000:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-86}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if x < -2.6e5Initial program 99.9%
Taylor expanded in y around 0 87.5%
Taylor expanded in z around 0 74.3%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -2.6e5 < x < -1.26e-62 or 1.34999999999999996e-86 < x < 8.00000000000000008e55Initial program 99.9%
Taylor expanded in y around 0 85.5%
if -1.26e-62 < x < 1.34999999999999996e-86Initial program 99.9%
Taylor expanded in x around 0 63.8%
if 8.00000000000000008e55 < 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 t around 0 79.9%
Final simplification73.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (<= y -7.1e+59)
(* y (+ 5.0 (* 2.0 (+ x (* x (/ z y))))))
(if (<= y 3.6e+104)
(* x (+ t (+ t_1 (* 5.0 (/ y x)))))
(+ (* x t_1) (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (y <= -7.1e+59) {
tmp = y * (5.0 + (2.0 * (x + (x * (z / y)))));
} else if (y <= 3.6e+104) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else {
tmp = (x * t_1) + (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if (y <= (-7.1d+59)) then
tmp = y * (5.0d0 + (2.0d0 * (x + (x * (z / y)))))
else if (y <= 3.6d+104) then
tmp = x * (t + (t_1 + (5.0d0 * (y / x))))
else
tmp = (x * t_1) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if (y <= -7.1e+59) {
tmp = y * (5.0 + (2.0 * (x + (x * (z / y)))));
} else if (y <= 3.6e+104) {
tmp = x * (t + (t_1 + (5.0 * (y / x))));
} else {
tmp = (x * t_1) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if y <= -7.1e+59: tmp = y * (5.0 + (2.0 * (x + (x * (z / y))))) elif y <= 3.6e+104: tmp = x * (t + (t_1 + (5.0 * (y / x)))) else: tmp = (x * t_1) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if (y <= -7.1e+59) tmp = Float64(y * Float64(5.0 + Float64(2.0 * Float64(x + Float64(x * Float64(z / y)))))); elseif (y <= 3.6e+104) tmp = Float64(x * Float64(t + Float64(t_1 + Float64(5.0 * Float64(y / x))))); else tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if (y <= -7.1e+59) tmp = y * (5.0 + (2.0 * (x + (x * (z / y))))); elseif (y <= 3.6e+104) tmp = x * (t + (t_1 + (5.0 * (y / x)))); else tmp = (x * t_1) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.1e+59], N[(y * N[(5.0 + N[(2.0 * N[(x + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+104], N[(x * N[(t + N[(t$95$1 + N[(5.0 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;y \leq -7.1 \cdot 10^{+59}:\\
\;\;\;\;y \cdot \left(5 + 2 \cdot \left(x + x \cdot \frac{z}{y}\right)\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \left(t + \left(t\_1 + 5 \cdot \frac{y}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\end{array}
\end{array}
if y < -7.10000000000000003e59Initial program 99.8%
Taylor expanded in y around inf 93.5%
Taylor expanded in t around 0 91.4%
distribute-lft-out91.4%
associate-/l*97.7%
Simplified97.7%
if -7.10000000000000003e59 < y < 3.60000000000000001e104Initial program 100.0%
fma-define100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.3%
if 3.60000000000000001e104 < y Initial program 99.8%
Taylor expanded in t around 0 97.7%
Simplified97.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))))
(if (<= y -3.2e+47)
t_1
(if (<= y 4.8e+80)
(* x (+ t (* z 2.0)))
(if (<= y 8.6e+239) (* y 5.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (y <= -3.2e+47) {
tmp = t_1;
} else if (y <= 4.8e+80) {
tmp = x * (t + (z * 2.0));
} else if (y <= 8.6e+239) {
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 = 2.0d0 * (x * (y + z))
if (y <= (-3.2d+47)) then
tmp = t_1
else if (y <= 4.8d+80) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 8.6d+239) 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 = 2.0 * (x * (y + z));
double tmp;
if (y <= -3.2e+47) {
tmp = t_1;
} else if (y <= 4.8e+80) {
tmp = x * (t + (z * 2.0));
} else if (y <= 8.6e+239) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) tmp = 0 if y <= -3.2e+47: tmp = t_1 elif y <= 4.8e+80: tmp = x * (t + (z * 2.0)) elif y <= 8.6e+239: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (y <= -3.2e+47) tmp = t_1; elseif (y <= 4.8e+80) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 8.6e+239) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); tmp = 0.0; if (y <= -3.2e+47) tmp = t_1; elseif (y <= 4.8e+80) tmp = x * (t + (z * 2.0)); elseif (y <= 8.6e+239) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+47], t$95$1, If[LessEqual[y, 4.8e+80], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e+239], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+239}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2e47 or 8.6000000000000008e239 < y Initial program 99.9%
fma-define99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 66.2%
Taylor expanded in t around 0 63.2%
if -3.2e47 < y < 4.79999999999999958e80Initial program 100.0%
Taylor expanded in y around 0 77.0%
if 4.79999999999999958e80 < y < 8.6000000000000008e239Initial program 99.8%
Taylor expanded in x around 0 61.0%
Final simplification71.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (+ y z))))
(if (or (<= x -2.7e-56) (not (<= x 4.7e-77)))
(* x (+ t t_1))
(+ (* x t_1) (* y 5.0)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if ((x <= -2.7e-56) || !(x <= 4.7e-77)) {
tmp = x * (t + t_1);
} else {
tmp = (x * t_1) + (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (y + z)
if ((x <= (-2.7d-56)) .or. (.not. (x <= 4.7d-77))) then
tmp = x * (t + t_1)
else
tmp = (x * t_1) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (y + z);
double tmp;
if ((x <= -2.7e-56) || !(x <= 4.7e-77)) {
tmp = x * (t + t_1);
} else {
tmp = (x * t_1) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (y + z) tmp = 0 if (x <= -2.7e-56) or not (x <= 4.7e-77): tmp = x * (t + t_1) else: tmp = (x * t_1) + (y * 5.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(y + z)) tmp = 0.0 if ((x <= -2.7e-56) || !(x <= 4.7e-77)) tmp = Float64(x * Float64(t + t_1)); else tmp = Float64(Float64(x * t_1) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (y + z); tmp = 0.0; if ((x <= -2.7e-56) || ~((x <= 4.7e-77))) tmp = x * (t + t_1); else tmp = (x * t_1) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -2.7e-56], N[Not[LessEqual[x, 4.7e-77]], $MachinePrecision]], N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$1), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-56} \lor \neg \left(x \leq 4.7 \cdot 10^{-77}\right):\\
\;\;\;\;x \cdot \left(t + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1 + y \cdot 5\\
\end{array}
\end{array}
if x < -2.69999999999999995e-56 or 4.6999999999999999e-77 < 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 97.9%
if -2.69999999999999995e-56 < x < 4.6999999999999999e-77Initial program 99.9%
Taylor expanded in t around 0 82.1%
Simplified82.1%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6e-56) (not (<= x 2.15e-60))) (* 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 <= -6e-56) || !(x <= 2.15e-60)) {
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 <= (-6d-56)) .or. (.not. (x <= 2.15d-60))) 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 <= -6e-56) || !(x <= 2.15e-60)) {
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 <= -6e-56) or not (x <= 2.15e-60): 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 <= -6e-56) || !(x <= 2.15e-60)) 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 <= -6e-56) || ~((x <= 2.15e-60))) 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, -6e-56], N[Not[LessEqual[x, 2.15e-60]], $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 -6 \cdot 10^{-56} \lor \neg \left(x \leq 2.15 \cdot 10^{-60}\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 < -5.99999999999999979e-56 or 2.15e-60 < 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 98.6%
if -5.99999999999999979e-56 < x < 2.15e-60Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
flip-+0.0%
pow20.0%
pow20.0%
Applied egg-rr0.0%
Simplified81.1%
Taylor expanded in x around 0 81.1%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e-61) (not (<= x 1.34e-42))) (* 2.0 (* x (+ y z))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e-61) || !(x <= 1.34e-42)) {
tmp = 2.0 * (x * (y + z));
} 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 ((x <= (-5.8d-61)) .or. (.not. (x <= 1.34d-42))) then
tmp = 2.0d0 * (x * (y + z))
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 ((x <= -5.8e-61) || !(x <= 1.34e-42)) {
tmp = 2.0 * (x * (y + z));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.8e-61) or not (x <= 1.34e-42): tmp = 2.0 * (x * (y + z)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.8e-61) || !(x <= 1.34e-42)) tmp = Float64(2.0 * Float64(x * Float64(y + z))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.8e-61) || ~((x <= 1.34e-42))) tmp = 2.0 * (x * (y + z)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.8e-61], N[Not[LessEqual[x, 1.34e-42]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-61} \lor \neg \left(x \leq 1.34 \cdot 10^{-42}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -5.7999999999999999e-61 or 1.34e-42 < 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 98.5%
Taylor expanded in t around 0 67.2%
if -5.7999999999999999e-61 < x < 1.34e-42Initial program 99.9%
Taylor expanded in x around 0 62.8%
Final simplification65.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6e+47) (not (<= y 6e-53))) (* 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 <= -6e+47) || !(y <= 6e-53)) {
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 <= (-6d+47)) .or. (.not. (y <= 6d-53))) 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 <= -6e+47) || !(y <= 6e-53)) {
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 <= -6e+47) or not (y <= 6e-53): 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 <= -6e+47) || !(y <= 6e-53)) 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 <= -6e+47) || ~((y <= 6e-53))) 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, -6e+47], N[Not[LessEqual[y, 6e-53]], $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 -6 \cdot 10^{+47} \lor \neg \left(y \leq 6 \cdot 10^{-53}\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 < -6.0000000000000003e47 or 6.0000000000000004e-53 < y Initial program 99.8%
Taylor expanded in y around inf 82.5%
Simplified82.5%
if -6.0000000000000003e47 < y < 6.0000000000000004e-53Initial program 100.0%
Taylor expanded in y around 0 82.5%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (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 * (t + (y + (z + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e-59) (not (<= x 3e-44))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e-59) || !(x <= 3e-44)) {
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 ((x <= (-2.3d-59)) .or. (.not. (x <= 3d-44))) 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 ((x <= -2.3e-59) || !(x <= 3e-44)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.3e-59) or not (x <= 3e-44): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.3e-59) || !(x <= 3e-44)) 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 ((x <= -2.3e-59) || ~((x <= 3e-44))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.3e-59], N[Not[LessEqual[x, 3e-44]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-59} \lor \neg \left(x \leq 3 \cdot 10^{-44}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.29999999999999979e-59 or 3.0000000000000002e-44 < x Initial program 99.9%
Taylor expanded in t around inf 41.0%
Simplified41.0%
if -2.29999999999999979e-59 < x < 3.0000000000000002e-44Initial program 99.9%
Taylor expanded in x around 0 63.3%
Final simplification50.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%
Taylor expanded in x around 0 29.8%
Final simplification29.8%
herbie shell --seed 2024079
(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)))