
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in96.8%
associate-+l+96.8%
+-commutative96.8%
count-296.8%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2.2e-20)
t_2
(if (<= y -2.6e-245)
t_1
(if (<= y 4e-264)
(* x t)
(if (<= y 2.05e-95)
t_1
(if (<= y 6.8e-16)
(* x (+ t (* y 2.0)))
(if (<= y 2.4e-6) (* 2.0 (* x z)) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2.2e-20) {
tmp = t_2;
} else if (y <= -2.6e-245) {
tmp = t_1;
} else if (y <= 4e-264) {
tmp = x * t;
} else if (y <= 2.05e-95) {
tmp = t_1;
} else if (y <= 6.8e-16) {
tmp = x * (t + (y * 2.0));
} else if (y <= 2.4e-6) {
tmp = 2.0 * (x * z);
} 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 = 2.0d0 * (x * (y + z))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-2.2d-20)) then
tmp = t_2
else if (y <= (-2.6d-245)) then
tmp = t_1
else if (y <= 4d-264) then
tmp = x * t
else if (y <= 2.05d-95) then
tmp = t_1
else if (y <= 6.8d-16) then
tmp = x * (t + (y * 2.0d0))
else if (y <= 2.4d-6) then
tmp = 2.0d0 * (x * z)
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 = 2.0 * (x * (y + z));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2.2e-20) {
tmp = t_2;
} else if (y <= -2.6e-245) {
tmp = t_1;
} else if (y <= 4e-264) {
tmp = x * t;
} else if (y <= 2.05e-95) {
tmp = t_1;
} else if (y <= 6.8e-16) {
tmp = x * (t + (y * 2.0));
} else if (y <= 2.4e-6) {
tmp = 2.0 * (x * z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -2.2e-20: tmp = t_2 elif y <= -2.6e-245: tmp = t_1 elif y <= 4e-264: tmp = x * t elif y <= 2.05e-95: tmp = t_1 elif y <= 6.8e-16: tmp = x * (t + (y * 2.0)) elif y <= 2.4e-6: tmp = 2.0 * (x * z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -2.2e-20) tmp = t_2; elseif (y <= -2.6e-245) tmp = t_1; elseif (y <= 4e-264) tmp = Float64(x * t); elseif (y <= 2.05e-95) tmp = t_1; elseif (y <= 6.8e-16) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (y <= 2.4e-6) tmp = Float64(2.0 * Float64(x * z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -2.2e-20) tmp = t_2; elseif (y <= -2.6e-245) tmp = t_1; elseif (y <= 4e-264) tmp = x * t; elseif (y <= 2.05e-95) tmp = t_1; elseif (y <= 6.8e-16) tmp = x * (t + (y * 2.0)); elseif (y <= 2.4e-6) tmp = 2.0 * (x * z); else tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-20], t$95$2, If[LessEqual[y, -2.6e-245], t$95$1, If[LessEqual[y, 4e-264], N[(x * t), $MachinePrecision], If[LessEqual[y, 2.05e-95], t$95$1, If[LessEqual[y, 6.8e-16], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-6], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-264}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-6}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.19999999999999991e-20 or 2.3999999999999999e-6 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 79.3%
if -2.19999999999999991e-20 < y < -2.60000000000000006e-245 or 4e-264 < y < 2.0499999999999999e-95Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 93.5%
Taylor expanded in t around 0 61.9%
if -2.60000000000000006e-245 < y < 4e-264Initial program 100.0%
Taylor expanded in t around inf 75.0%
if 2.0499999999999999e-95 < y < 6.8e-16Initial program 100.0%
fma-def100.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 78.9%
if 6.8e-16 < y < 2.3999999999999999e-6Initial program 99.5%
Taylor expanded in z around inf 67.7%
Final simplification73.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 8.5e-7))) (* x (+ t (* (+ y z) 2.0))) (+ (* x (+ t (+ y (+ z z)))) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 8.5e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (z + z)))) + (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.5d0)) .or. (.not. (x <= 8.5d-7))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (x * (t + (y + (z + z)))) + (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.5) || !(x <= 8.5e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (x * (t + (y + (z + z)))) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 8.5e-7): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (x * (t + (y + (z + z)))) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 8.5e-7)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(x * Float64(t + Float64(y + Float64(z + z)))) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 8.5e-7))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (x * (t + (y + (z + z)))) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 8.5e-7]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 8.5 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + \left(z + z\right)\right)\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -2.5 or 8.50000000000000014e-7 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
if -2.5 < x < 8.50000000000000014e-7Initial program 99.8%
Taylor expanded in y around 0 99.6%
Simplified99.6%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -8.3e+211)
(* 2.0 (* x z))
(if (<= x -8.2e-26)
(* x t)
(if (<= x 8.5e-7)
(* y 5.0)
(if (or (<= x 4.4e+224) (not (<= x 8.8e+262)))
(* 2.0 (* y x))
(* x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.3e+211) {
tmp = 2.0 * (x * z);
} else if (x <= -8.2e-26) {
tmp = x * t;
} else if (x <= 8.5e-7) {
tmp = y * 5.0;
} else if ((x <= 4.4e+224) || !(x <= 8.8e+262)) {
tmp = 2.0 * (y * x);
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-8.3d+211)) then
tmp = 2.0d0 * (x * z)
else if (x <= (-8.2d-26)) then
tmp = x * t
else if (x <= 8.5d-7) then
tmp = y * 5.0d0
else if ((x <= 4.4d+224) .or. (.not. (x <= 8.8d+262))) then
tmp = 2.0d0 * (y * x)
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.3e+211) {
tmp = 2.0 * (x * z);
} else if (x <= -8.2e-26) {
tmp = x * t;
} else if (x <= 8.5e-7) {
tmp = y * 5.0;
} else if ((x <= 4.4e+224) || !(x <= 8.8e+262)) {
tmp = 2.0 * (y * x);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.3e+211: tmp = 2.0 * (x * z) elif x <= -8.2e-26: tmp = x * t elif x <= 8.5e-7: tmp = y * 5.0 elif (x <= 4.4e+224) or not (x <= 8.8e+262): tmp = 2.0 * (y * x) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.3e+211) tmp = Float64(2.0 * Float64(x * z)); elseif (x <= -8.2e-26) tmp = Float64(x * t); elseif (x <= 8.5e-7) tmp = Float64(y * 5.0); elseif ((x <= 4.4e+224) || !(x <= 8.8e+262)) tmp = Float64(2.0 * Float64(y * x)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.3e+211) tmp = 2.0 * (x * z); elseif (x <= -8.2e-26) tmp = x * t; elseif (x <= 8.5e-7) tmp = y * 5.0; elseif ((x <= 4.4e+224) || ~((x <= 8.8e+262))) tmp = 2.0 * (y * x); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.3e+211], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.2e-26], N[(x * t), $MachinePrecision], If[LessEqual[x, 8.5e-7], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 4.4e+224], N[Not[LessEqual[x, 8.8e+262]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.3 \cdot 10^{+211}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-26}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+224} \lor \neg \left(x \leq 8.8 \cdot 10^{+262}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -8.29999999999999985e211Initial program 99.9%
Taylor expanded in z around inf 54.1%
if -8.29999999999999985e211 < x < -8.1999999999999997e-26 or 4.3999999999999999e224 < x < 8.80000000000000042e262Initial program 99.9%
Taylor expanded in t around inf 49.7%
if -8.1999999999999997e-26 < x < 8.50000000000000014e-7Initial program 99.8%
Taylor expanded in x around 0 59.8%
if 8.50000000000000014e-7 < x < 4.3999999999999999e224 or 8.80000000000000042e262 < x Initial program 100.0%
fma-def100.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 80.4%
Taylor expanded in y around inf 51.2%
Final simplification55.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x (+ y z)))))
(if (<= x -2.15e+157)
t_1
(if (<= x -1.5e+115)
(* x t)
(if (or (<= x -8.5e-31) (not (<= x 2.1e-109))) t_1 (* y 5.0))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * (y + z));
double tmp;
if (x <= -2.15e+157) {
tmp = t_1;
} else if (x <= -1.5e+115) {
tmp = x * t;
} else if ((x <= -8.5e-31) || !(x <= 2.1e-109)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * (y + z))
if (x <= (-2.15d+157)) then
tmp = t_1
else if (x <= (-1.5d+115)) then
tmp = x * t
else if ((x <= (-8.5d-31)) .or. (.not. (x <= 2.1d-109))) then
tmp = t_1
else
tmp = 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 * (x * (y + z));
double tmp;
if (x <= -2.15e+157) {
tmp = t_1;
} else if (x <= -1.5e+115) {
tmp = x * t;
} else if ((x <= -8.5e-31) || !(x <= 2.1e-109)) {
tmp = t_1;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * (y + z)) tmp = 0 if x <= -2.15e+157: tmp = t_1 elif x <= -1.5e+115: tmp = x * t elif (x <= -8.5e-31) or not (x <= 2.1e-109): tmp = t_1 else: tmp = y * 5.0 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * Float64(y + z))) tmp = 0.0 if (x <= -2.15e+157) tmp = t_1; elseif (x <= -1.5e+115) tmp = Float64(x * t); elseif ((x <= -8.5e-31) || !(x <= 2.1e-109)) tmp = t_1; else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * (y + z)); tmp = 0.0; if (x <= -2.15e+157) tmp = t_1; elseif (x <= -1.5e+115) tmp = x * t; elseif ((x <= -8.5e-31) || ~((x <= 2.1e-109))) tmp = t_1; else tmp = y * 5.0; 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[x, -2.15e+157], t$95$1, If[LessEqual[x, -1.5e+115], N[(x * t), $MachinePrecision], If[Or[LessEqual[x, -8.5e-31], N[Not[LessEqual[x, 2.1e-109]], $MachinePrecision]], t$95$1, N[(y * 5.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+157}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{+115}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-31} \lor \neg \left(x \leq 2.1 \cdot 10^{-109}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.15e157 or -1.5e115 < x < -8.5000000000000007e-31 or 2.09999999999999996e-109 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 96.1%
Taylor expanded in t around 0 69.3%
if -2.15e157 < x < -1.5e115Initial program 99.6%
Taylor expanded in t around inf 75.1%
if -8.5000000000000007e-31 < x < 2.09999999999999996e-109Initial program 99.8%
Taylor expanded in x around 0 64.3%
Final simplification67.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.4e+14) (not (<= y 1.25e-5))) (+ (* 2.0 (* x (+ y z))) (* y 5.0)) (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.4e+14) || !(y <= 1.25e-5)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = x * (t + ((y + 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 <= (-7.4d+14)) .or. (.not. (y <= 1.25d-5))) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else
tmp = x * (t + ((y + 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 <= -7.4e+14) || !(y <= 1.25e-5)) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else {
tmp = x * (t + ((y + z) * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.4e+14) or not (y <= 1.25e-5): tmp = (2.0 * (x * (y + z))) + (y * 5.0) else: tmp = x * (t + ((y + z) * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.4e+14) || !(y <= 1.25e-5)) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); else tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.4e+14) || ~((y <= 1.25e-5))) tmp = (2.0 * (x * (y + z))) + (y * 5.0); else tmp = x * (t + ((y + z) * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.4e+14], N[Not[LessEqual[y, 1.25e-5]], $MachinePrecision]], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+14} \lor \neg \left(y \leq 1.25 \cdot 10^{-5}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\end{array}
\end{array}
if y < -7.4e14 or 1.25000000000000006e-5 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 91.5%
if -7.4e14 < y < 1.25000000000000006e-5Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 91.8%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 8.5e-7))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x (- t (* z -2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5) || !(x <= 8.5e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (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 ((x <= (-2.5d0)) .or. (.not. (x <= 8.5d-7))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (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 ((x <= -2.5) || !(x <= 8.5e-7)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t - (z * -2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5) or not (x <= 8.5e-7): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t - (z * -2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.5) || !(x <= 8.5e-7)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t - Float64(z * -2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.5) || ~((x <= 8.5e-7))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t - (z * -2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 8.5e-7]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t - N[(z * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 8.5 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t - z \cdot -2\right)\\
\end{array}
\end{array}
if x < -2.5 or 8.50000000000000014e-7 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
if -2.5 < x < 8.50000000000000014e-7Initial program 99.8%
associate-+l+99.8%
distribute-rgt-in99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around -inf 99.6%
+-commutative99.6%
*-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
Simplified99.6%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.02e+15)
(+ (* 2.0 (* x (+ y z))) (* y 5.0))
(if (<= y 2.4e-6)
(* x (+ t (* (+ y z) 2.0)))
(+ (* y 5.0) (* x (+ t (* y 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.02e+15) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else if (y <= 2.4e-6) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (y * 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 <= (-2.02d+15)) then
tmp = (2.0d0 * (x * (y + z))) + (y * 5.0d0)
else if (y <= 2.4d-6) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * (t + (y * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.02e+15) {
tmp = (2.0 * (x * (y + z))) + (y * 5.0);
} else if (y <= 2.4e-6) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.02e+15: tmp = (2.0 * (x * (y + z))) + (y * 5.0) elif y <= 2.4e-6: tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t + (y * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.02e+15) tmp = Float64(Float64(2.0 * Float64(x * Float64(y + z))) + Float64(y * 5.0)); elseif (y <= 2.4e-6) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.02e+15) tmp = (2.0 * (x * (y + z))) + (y * 5.0); elseif (y <= 2.4e-6) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t + (y * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.02e+15], N[(N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-6], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.02 \cdot 10^{+15}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if y < -2.02e15Initial program 99.8%
fma-def99.8%
associate-+l+99.8%
+-commutative99.8%
count-299.8%
Simplified99.8%
Taylor expanded in t around 0 92.2%
if -2.02e15 < y < 2.3999999999999999e-6Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 91.8%
if 2.3999999999999999e-6 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 95.1%
Final simplification93.0%
(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 (<= x -1.5e-25)
(* x t)
(if (<= x 8.5e-7)
(* y 5.0)
(if (or (<= x 3.7e+224) (not (<= x 1.05e+262)))
(* 2.0 (* y x))
(* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.5e-25) {
tmp = x * t;
} else if (x <= 8.5e-7) {
tmp = y * 5.0;
} else if ((x <= 3.7e+224) || !(x <= 1.05e+262)) {
tmp = 2.0 * (y * x);
} 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 <= (-1.5d-25)) then
tmp = x * t
else if (x <= 8.5d-7) then
tmp = y * 5.0d0
else if ((x <= 3.7d+224) .or. (.not. (x <= 1.05d+262))) then
tmp = 2.0d0 * (y * x)
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 <= -1.5e-25) {
tmp = x * t;
} else if (x <= 8.5e-7) {
tmp = y * 5.0;
} else if ((x <= 3.7e+224) || !(x <= 1.05e+262)) {
tmp = 2.0 * (y * x);
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.5e-25: tmp = x * t elif x <= 8.5e-7: tmp = y * 5.0 elif (x <= 3.7e+224) or not (x <= 1.05e+262): tmp = 2.0 * (y * x) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.5e-25) tmp = Float64(x * t); elseif (x <= 8.5e-7) tmp = Float64(y * 5.0); elseif ((x <= 3.7e+224) || !(x <= 1.05e+262)) tmp = Float64(2.0 * Float64(y * x)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.5e-25) tmp = x * t; elseif (x <= 8.5e-7) tmp = y * 5.0; elseif ((x <= 3.7e+224) || ~((x <= 1.05e+262))) tmp = 2.0 * (y * x); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.5e-25], N[(x * t), $MachinePrecision], If[LessEqual[x, 8.5e-7], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 3.7e+224], N[Not[LessEqual[x, 1.05e+262]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-25}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+224} \lor \neg \left(x \leq 1.05 \cdot 10^{+262}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.4999999999999999e-25 or 3.70000000000000003e224 < x < 1.04999999999999995e262Initial program 99.9%
Taylor expanded in t around inf 44.8%
if -1.4999999999999999e-25 < x < 8.50000000000000014e-7Initial program 99.8%
Taylor expanded in x around 0 59.8%
if 8.50000000000000014e-7 < x < 3.70000000000000003e224 or 1.04999999999999995e262 < x Initial program 100.0%
fma-def100.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 80.4%
Taylor expanded in y around inf 51.2%
Final simplification53.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -3.6e+196)
t_1
(if (<= y -7e-21)
(+ (* y 5.0) (* x t))
(if (<= y 2.8e-5) (* x (+ t (* z 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.6e+196) {
tmp = t_1;
} else if (y <= -7e-21) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 2.8e-5) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-3.6d+196)) then
tmp = t_1
else if (y <= (-7d-21)) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 2.8d-5) then
tmp = x * (t + (z * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.6e+196) {
tmp = t_1;
} else if (y <= -7e-21) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 2.8e-5) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -3.6e+196: tmp = t_1 elif y <= -7e-21: tmp = (y * 5.0) + (x * t) elif y <= 2.8e-5: tmp = x * (t + (z * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -3.6e+196) tmp = t_1; elseif (y <= -7e-21) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 2.8e-5) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -3.6e+196) tmp = t_1; elseif (y <= -7e-21) tmp = (y * 5.0) + (x * t); elseif (y <= 2.8e-5) tmp = x * (t + (z * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+196], t$95$1, If[LessEqual[y, -7e-21], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-5], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-21}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.60000000000000007e196 or 2.79999999999999996e-5 < y Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 87.1%
if -3.60000000000000007e196 < y < -7.0000000000000007e-21Initial program 99.8%
associate-+l+99.8%
distribute-rgt-in94.6%
associate-+l+94.6%
Applied egg-rr94.6%
Taylor expanded in t around inf 74.5%
if -7.0000000000000007e-21 < y < 2.79999999999999996e-5Initial program 99.9%
Taylor expanded in y around 0 91.2%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.3e-29) (not (<= x 2.95e-109))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.3e-29) || !(x <= 2.95e-109)) {
tmp = x * (t + ((y + z) * 2.0));
} 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 <= (-1.3d-29)) .or. (.not. (x <= 2.95d-109))) then
tmp = x * (t + ((y + z) * 2.0d0))
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 <= -1.3e-29) || !(x <= 2.95e-109)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.3e-29) or not (x <= 2.95e-109): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.3e-29) || !(x <= 2.95e-109)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); 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 <= -1.3e-29) || ~((x <= 2.95e-109))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.3e-29], N[Not[LessEqual[x, 2.95e-109]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-29} \lor \neg \left(x \leq 2.95 \cdot 10^{-109}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -1.3000000000000001e-29 or 2.95000000000000011e-109 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 96.3%
if -1.3000000000000001e-29 < x < 2.95000000000000011e-109Initial program 99.8%
associate-+l+99.8%
distribute-rgt-in99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 80.7%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-24) (not (<= x 4.3e-13))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* 2.0 (* x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-24) || !(x <= 4.3e-13)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (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 <= (-2.8d-24)) .or. (.not. (x <= 4.3d-13))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (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 <= -2.8e-24) || !(x <= 4.3e-13)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (2.0 * (x * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e-24) or not (x <= 4.3e-13): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (2.0 * (x * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e-24) || !(x <= 4.3e-13)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e-24) || ~((x <= 4.3e-13))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (2.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e-24], N[Not[LessEqual[x, 4.3e-13]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-24} \lor \neg \left(x \leq 4.3 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -2.8000000000000002e-24 or 4.2999999999999999e-13 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.3%
if -2.8000000000000002e-24 < x < 4.2999999999999999e-13Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 83.1%
Taylor expanded in y around 0 83.1%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.85e+41) (not (<= y 2.8e-6))) (* 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 <= -2.85e+41) || !(y <= 2.8e-6)) {
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 <= (-2.85d+41)) .or. (.not. (y <= 2.8d-6))) 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 <= -2.85e+41) || !(y <= 2.8e-6)) {
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 <= -2.85e+41) or not (y <= 2.8e-6): 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 <= -2.85e+41) || !(y <= 2.8e-6)) 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 <= -2.85e+41) || ~((y <= 2.8e-6))) 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, -2.85e+41], N[Not[LessEqual[y, 2.8e-6]], $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 -2.85 \cdot 10^{+41} \lor \neg \left(y \leq 2.8 \cdot 10^{-6}\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 < -2.8500000000000001e41 or 2.79999999999999987e-6 < y Initial program 99.8%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 83.5%
if -2.8500000000000001e41 < y < 2.79999999999999987e-6Initial program 99.9%
Taylor expanded in y around 0 87.2%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= x -9.2e-24) (* x (+ t (* y 2.0))) (if (<= x 2.95e-109) (* y 5.0) (* 2.0 (* x (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.2e-24) {
tmp = x * (t + (y * 2.0));
} else if (x <= 2.95e-109) {
tmp = y * 5.0;
} 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) :: tmp
if (x <= (-9.2d-24)) then
tmp = x * (t + (y * 2.0d0))
else if (x <= 2.95d-109) then
tmp = y * 5.0d0
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 tmp;
if (x <= -9.2e-24) {
tmp = x * (t + (y * 2.0));
} else if (x <= 2.95e-109) {
tmp = y * 5.0;
} else {
tmp = 2.0 * (x * (y + z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.2e-24: tmp = x * (t + (y * 2.0)) elif x <= 2.95e-109: tmp = y * 5.0 else: tmp = 2.0 * (x * (y + z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.2e-24) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (x <= 2.95e-109) tmp = Float64(y * 5.0); else tmp = Float64(2.0 * Float64(x * Float64(y + z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.2e-24) tmp = x * (t + (y * 2.0)); elseif (x <= 2.95e-109) tmp = y * 5.0; else tmp = 2.0 * (x * (y + z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.2e-24], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.95e-109], N[(y * 5.0), $MachinePrecision], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-109}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if x < -9.2000000000000004e-24Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
Taylor expanded in z around 0 71.7%
if -9.2000000000000004e-24 < x < 2.95000000000000011e-109Initial program 99.9%
Taylor expanded in x around 0 63.3%
if 2.95000000000000011e-109 < x Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 93.9%
Taylor expanded in t around 0 70.0%
Final simplification67.4%
(FPCore (x y z t) :precision binary64 (if (<= x -6.5e-25) (* x t) (if (<= x 4.5e-12) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.5e-25) {
tmp = x * t;
} else if (x <= 4.5e-12) {
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 <= (-6.5d-25)) then
tmp = x * t
else if (x <= 4.5d-12) 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 <= -6.5e-25) {
tmp = x * t;
} else if (x <= 4.5e-12) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.5e-25: tmp = x * t elif x <= 4.5e-12: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.5e-25) tmp = Float64(x * t); elseif (x <= 4.5e-12) 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 <= -6.5e-25) tmp = x * t; elseif (x <= 4.5e-12) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e-25], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.5e-12], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-25}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-12}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -6.5e-25 or 4.49999999999999981e-12 < x Initial program 99.9%
Taylor expanded in t around inf 39.5%
if -6.5e-25 < x < 4.49999999999999981e-12Initial program 99.9%
Taylor expanded in x around 0 60.3%
Final simplification49.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 31.9%
Final simplification31.9%
herbie shell --seed 2023176
(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)))