
(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 14 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 (+ (* (+ y z) 2.0) t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (((y + z) * 2.0) + t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= t -3.4e+23)
(* x t)
(if (<= t -3.8e-49)
(* y 5.0)
(if (<= t -7.4e-121)
t_1
(if (<= t -1.35e-211)
(* y 5.0)
(if (<= t 5.5e-189)
t_1
(if (<= t 1.7e-55) (* y 5.0) (if (<= t 3e+55) t_1 (* x t))))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (t <= -3.4e+23) {
tmp = x * t;
} else if (t <= -3.8e-49) {
tmp = y * 5.0;
} else if (t <= -7.4e-121) {
tmp = t_1;
} else if (t <= -1.35e-211) {
tmp = y * 5.0;
} else if (t <= 5.5e-189) {
tmp = t_1;
} else if (t <= 1.7e-55) {
tmp = y * 5.0;
} else if (t <= 3e+55) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * z)
if (t <= (-3.4d+23)) then
tmp = x * t
else if (t <= (-3.8d-49)) then
tmp = y * 5.0d0
else if (t <= (-7.4d-121)) then
tmp = t_1
else if (t <= (-1.35d-211)) then
tmp = y * 5.0d0
else if (t <= 5.5d-189) then
tmp = t_1
else if (t <= 1.7d-55) then
tmp = y * 5.0d0
else if (t <= 3d+55) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (t <= -3.4e+23) {
tmp = x * t;
} else if (t <= -3.8e-49) {
tmp = y * 5.0;
} else if (t <= -7.4e-121) {
tmp = t_1;
} else if (t <= -1.35e-211) {
tmp = y * 5.0;
} else if (t <= 5.5e-189) {
tmp = t_1;
} else if (t <= 1.7e-55) {
tmp = y * 5.0;
} else if (t <= 3e+55) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if t <= -3.4e+23: tmp = x * t elif t <= -3.8e-49: tmp = y * 5.0 elif t <= -7.4e-121: tmp = t_1 elif t <= -1.35e-211: tmp = y * 5.0 elif t <= 5.5e-189: tmp = t_1 elif t <= 1.7e-55: tmp = y * 5.0 elif t <= 3e+55: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (t <= -3.4e+23) tmp = Float64(x * t); elseif (t <= -3.8e-49) tmp = Float64(y * 5.0); elseif (t <= -7.4e-121) tmp = t_1; elseif (t <= -1.35e-211) tmp = Float64(y * 5.0); elseif (t <= 5.5e-189) tmp = t_1; elseif (t <= 1.7e-55) tmp = Float64(y * 5.0); elseif (t <= 3e+55) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (t <= -3.4e+23) tmp = x * t; elseif (t <= -3.8e-49) tmp = y * 5.0; elseif (t <= -7.4e-121) tmp = t_1; elseif (t <= -1.35e-211) tmp = y * 5.0; elseif (t <= 5.5e-189) tmp = t_1; elseif (t <= 1.7e-55) tmp = y * 5.0; elseif (t <= 3e+55) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+23], N[(x * t), $MachinePrecision], If[LessEqual[t, -3.8e-49], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, -7.4e-121], t$95$1, If[LessEqual[t, -1.35e-211], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 5.5e-189], t$95$1, If[LessEqual[t, 1.7e-55], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 3e+55], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-49}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-211}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-55}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -3.39999999999999992e23 or 3.00000000000000017e55 < t Initial program 99.9%
Taylor expanded in t around inf 58.1%
if -3.39999999999999992e23 < t < -3.7999999999999997e-49 or -7.4000000000000004e-121 < t < -1.35e-211 or 5.4999999999999999e-189 < t < 1.69999999999999986e-55Initial program 99.9%
Taylor expanded in x around 0 53.7%
if -3.7999999999999997e-49 < t < -7.4000000000000004e-121 or -1.35e-211 < t < 5.4999999999999999e-189 or 1.69999999999999986e-55 < t < 3.00000000000000017e55Initial program 100.0%
Taylor expanded in z around inf 54.0%
Final simplification55.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))) (t_2 (* y (+ 5.0 x))))
(if (<= y -2.3e-29)
t_2
(if (<= y -1.4e-167)
(* x t)
(if (<= y -3.5e-230)
t_1
(if (<= y 1.1e-287)
(* x t)
(if (<= y 6.5e-150) t_1 (if (<= y 9.2e-18) (* x t) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double t_2 = y * (5.0 + x);
double tmp;
if (y <= -2.3e-29) {
tmp = t_2;
} else if (y <= -1.4e-167) {
tmp = x * t;
} else if (y <= -3.5e-230) {
tmp = t_1;
} else if (y <= 1.1e-287) {
tmp = x * t;
} else if (y <= 6.5e-150) {
tmp = t_1;
} else if (y <= 9.2e-18) {
tmp = x * t;
} 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 * z)
t_2 = y * (5.0d0 + x)
if (y <= (-2.3d-29)) then
tmp = t_2
else if (y <= (-1.4d-167)) then
tmp = x * t
else if (y <= (-3.5d-230)) then
tmp = t_1
else if (y <= 1.1d-287) then
tmp = x * t
else if (y <= 6.5d-150) then
tmp = t_1
else if (y <= 9.2d-18) then
tmp = x * t
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 * z);
double t_2 = y * (5.0 + x);
double tmp;
if (y <= -2.3e-29) {
tmp = t_2;
} else if (y <= -1.4e-167) {
tmp = x * t;
} else if (y <= -3.5e-230) {
tmp = t_1;
} else if (y <= 1.1e-287) {
tmp = x * t;
} else if (y <= 6.5e-150) {
tmp = t_1;
} else if (y <= 9.2e-18) {
tmp = x * t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) t_2 = y * (5.0 + x) tmp = 0 if y <= -2.3e-29: tmp = t_2 elif y <= -1.4e-167: tmp = x * t elif y <= -3.5e-230: tmp = t_1 elif y <= 1.1e-287: tmp = x * t elif y <= 6.5e-150: tmp = t_1 elif y <= 9.2e-18: tmp = x * t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) t_2 = Float64(y * Float64(5.0 + x)) tmp = 0.0 if (y <= -2.3e-29) tmp = t_2; elseif (y <= -1.4e-167) tmp = Float64(x * t); elseif (y <= -3.5e-230) tmp = t_1; elseif (y <= 1.1e-287) tmp = Float64(x * t); elseif (y <= 6.5e-150) tmp = t_1; elseif (y <= 9.2e-18) tmp = Float64(x * t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); t_2 = y * (5.0 + x); tmp = 0.0; if (y <= -2.3e-29) tmp = t_2; elseif (y <= -1.4e-167) tmp = x * t; elseif (y <= -3.5e-230) tmp = t_1; elseif (y <= 1.1e-287) tmp = x * t; elseif (y <= 6.5e-150) tmp = t_1; elseif (y <= 9.2e-18) tmp = x * t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e-29], t$95$2, If[LessEqual[y, -1.4e-167], N[(x * t), $MachinePrecision], If[LessEqual[y, -3.5e-230], t$95$1, If[LessEqual[y, 1.1e-287], N[(x * t), $MachinePrecision], If[LessEqual[y, 6.5e-150], t$95$1, If[LessEqual[y, 9.2e-18], N[(x * t), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-167}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-230}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-287}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-18}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.29999999999999991e-29 or 9.2000000000000004e-18 < y Initial program 99.9%
Taylor expanded in y around 0 89.7%
Taylor expanded in y around inf 66.1%
+-commutative66.1%
Simplified66.1%
if -2.29999999999999991e-29 < y < -1.39999999999999993e-167 or -3.49999999999999988e-230 < y < 1.1e-287 or 6.49999999999999997e-150 < y < 9.2000000000000004e-18Initial program 99.9%
Taylor expanded in t around inf 55.8%
if -1.39999999999999993e-167 < y < -3.49999999999999988e-230 or 1.1e-287 < y < 6.49999999999999997e-150Initial program 100.0%
Taylor expanded in z around inf 69.9%
Final simplification63.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (+ (* y 2.0) (* z 2.0))))))
(if (<= x -1.05e-57)
t_1
(if (<= x 5e-242)
(+ (* y 5.0) (* x t))
(if (<= x 2.65e-53) (+ (* y 5.0) (* z (* x 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y * 2.0) + (z * 2.0)));
double tmp;
if (x <= -1.05e-57) {
tmp = t_1;
} else if (x <= 5e-242) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.65e-53) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
if (x <= (-1.05d-57)) then
tmp = t_1
else if (x <= 5d-242) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 2.65d-53) then
tmp = (y * 5.0d0) + (z * (x * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y * 2.0) + (z * 2.0)));
double tmp;
if (x <= -1.05e-57) {
tmp = t_1;
} else if (x <= 5e-242) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.65e-53) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y * 2.0) + (z * 2.0))) tmp = 0 if x <= -1.05e-57: tmp = t_1 elif x <= 5e-242: tmp = (y * 5.0) + (x * t) elif x <= 2.65e-53: tmp = (y * 5.0) + (z * (x * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))) tmp = 0.0 if (x <= -1.05e-57) tmp = t_1; elseif (x <= 5e-242) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 2.65e-53) tmp = Float64(Float64(y * 5.0) + Float64(z * Float64(x * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y * 2.0) + (z * 2.0))); tmp = 0.0; if (x <= -1.05e-57) tmp = t_1; elseif (x <= 5e-242) tmp = (y * 5.0) + (x * t); elseif (x <= 2.65e-53) tmp = (y * 5.0) + (z * (x * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-57], t$95$1, If[LessEqual[x, 5e-242], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.65e-53], N[(N[(y * 5.0), $MachinePrecision] + N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 5 + z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.05e-57 or 2.65e-53 < x Initial program 100.0%
Taylor expanded in x around inf 95.7%
if -1.05e-57 < x < 4.9999999999999998e-242Initial program 99.8%
Taylor expanded in y around inf 87.8%
+-commutative87.8%
distribute-lft-in87.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified87.8%
Taylor expanded in x around 0 87.8%
if 4.9999999999999998e-242 < x < 2.65e-53Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 86.0%
Simplified86.0%
fma-udef86.0%
+-commutative86.0%
associate-*r*86.0%
*-commutative86.0%
Applied egg-rr86.0%
Final simplification92.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (+ (* y 2.0) (* z 2.0))))))
(if (<= x -3.9e-60)
t_1
(if (<= x 1.25e-244)
(+ (* y 5.0) (* x (+ t (+ y y))))
(if (<= x 5.2e-55) (+ (* y 5.0) (* z (* x 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y * 2.0) + (z * 2.0)));
double tmp;
if (x <= -3.9e-60) {
tmp = t_1;
} else if (x <= 1.25e-244) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else if (x <= 5.2e-55) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
if (x <= (-3.9d-60)) then
tmp = t_1
else if (x <= 1.25d-244) then
tmp = (y * 5.0d0) + (x * (t + (y + y)))
else if (x <= 5.2d-55) then
tmp = (y * 5.0d0) + (z * (x * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y * 2.0) + (z * 2.0)));
double tmp;
if (x <= -3.9e-60) {
tmp = t_1;
} else if (x <= 1.25e-244) {
tmp = (y * 5.0) + (x * (t + (y + y)));
} else if (x <= 5.2e-55) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y * 2.0) + (z * 2.0))) tmp = 0 if x <= -3.9e-60: tmp = t_1 elif x <= 1.25e-244: tmp = (y * 5.0) + (x * (t + (y + y))) elif x <= 5.2e-55: tmp = (y * 5.0) + (z * (x * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))) tmp = 0.0 if (x <= -3.9e-60) tmp = t_1; elseif (x <= 1.25e-244) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + y)))); elseif (x <= 5.2e-55) tmp = Float64(Float64(y * 5.0) + Float64(z * Float64(x * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y * 2.0) + (z * 2.0))); tmp = 0.0; if (x <= -3.9e-60) tmp = t_1; elseif (x <= 1.25e-244) tmp = (y * 5.0) + (x * (t + (y + y))); elseif (x <= 5.2e-55) tmp = (y * 5.0) + (z * (x * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e-60], t$95$1, If[LessEqual[x, 1.25e-244], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e-55], N[(N[(y * 5.0), $MachinePrecision] + N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-244}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-55}:\\
\;\;\;\;y \cdot 5 + z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.9000000000000002e-60 or 5.1999999999999998e-55 < x Initial program 100.0%
Taylor expanded in x around inf 95.7%
if -3.9000000000000002e-60 < x < 1.24999999999999999e-244Initial program 99.8%
Taylor expanded in y around inf 87.8%
if 1.24999999999999999e-244 < x < 5.1999999999999998e-55Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 86.0%
Simplified86.0%
fma-udef86.0%
+-commutative86.0%
associate-*r*86.0%
*-commutative86.0%
Applied egg-rr86.0%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.75e+22) (not (<= x 0.0011))) (* x (+ t (+ (* y 2.0) (* z 2.0)))) (+ (* y 5.0) (* x (+ t (+ y (* z 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.75e+22) || !(x <= 0.0011)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (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 ((x <= (-1.75d+22)) .or. (.not. (x <= 0.0011d0))) then
tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
else
tmp = (y * 5.0d0) + (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 ((x <= -1.75e+22) || !(x <= 0.0011)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z * 2.0))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.75e+22) or not (x <= 0.0011): tmp = x * (t + ((y * 2.0) + (z * 2.0))) else: tmp = (y * 5.0) + (x * (t + (y + (z * 2.0)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.75e+22) || !(x <= 0.0011)) tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z * 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.75e+22) || ~((x <= 0.0011))) tmp = x * (t + ((y * 2.0) + (z * 2.0))); else tmp = (y * 5.0) + (x * (t + (y + (z * 2.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.75e+22], N[Not[LessEqual[x, 0.0011]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+22} \lor \neg \left(x \leq 0.0011\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + z \cdot 2\right)\right)\\
\end{array}
\end{array}
if x < -1.75e22 or 0.00110000000000000007 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
if -1.75e22 < x < 0.00110000000000000007Initial program 99.9%
Taylor expanded in y around 0 99.1%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -7e+72)
t_2
(if (<= y -1.35e-133)
t_1
(if (<= y -2.1e-166)
(+ (* y 5.0) (* x t))
(if (<= y 1.3e-17) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -7e+72) {
tmp = t_2;
} else if (y <= -1.35e-133) {
tmp = t_1;
} else if (y <= -2.1e-166) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.3e-17) {
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 = x * (t + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-7d+72)) then
tmp = t_2
else if (y <= (-1.35d-133)) then
tmp = t_1
else if (y <= (-2.1d-166)) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1.3d-17) 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 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -7e+72) {
tmp = t_2;
} else if (y <= -1.35e-133) {
tmp = t_1;
} else if (y <= -2.1e-166) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1.3e-17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -7e+72: tmp = t_2 elif y <= -1.35e-133: tmp = t_1 elif y <= -2.1e-166: tmp = (y * 5.0) + (x * t) elif y <= 1.3e-17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -7e+72) tmp = t_2; elseif (y <= -1.35e-133) tmp = t_1; elseif (y <= -2.1e-166) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1.3e-17) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -7e+72) tmp = t_2; elseif (y <= -1.35e-133) tmp = t_1; elseif (y <= -2.1e-166) tmp = (y * 5.0) + (x * t); elseif (y <= 1.3e-17) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+72], t$95$2, If[LessEqual[y, -1.35e-133], t$95$1, If[LessEqual[y, -2.1e-166], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -7.0000000000000002e72 or 1.30000000000000002e-17 < y Initial program 99.9%
Taylor expanded in y around inf 80.1%
Simplified80.1%
if -7.0000000000000002e72 < y < -1.3499999999999999e-133 or -2.0999999999999999e-166 < y < 1.30000000000000002e-17Initial program 99.9%
Taylor expanded in y around 0 83.9%
if -1.3499999999999999e-133 < y < -2.0999999999999999e-166Initial program 100.0%
Taylor expanded in y around inf 92.8%
+-commutative92.8%
distribute-lft-in92.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified92.8%
Taylor expanded in x around 0 92.8%
Final simplification82.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (+ y (* z 2.0))))))
(if (<= x -1.05e-57)
t_1
(if (<= x 4.6e-248)
(+ (* y 5.0) (* x t))
(if (<= x 1.65e-53) (+ (* y 5.0) (* z (* x 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y + (z * 2.0)));
double tmp;
if (x <= -1.05e-57) {
tmp = t_1;
} else if (x <= 4.6e-248) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.65e-53) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t + (y + (z * 2.0d0)))
if (x <= (-1.05d-57)) then
tmp = t_1
else if (x <= 4.6d-248) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.65d-53) then
tmp = (y * 5.0d0) + (z * (x * 2.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y + (z * 2.0)));
double tmp;
if (x <= -1.05e-57) {
tmp = t_1;
} else if (x <= 4.6e-248) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.65e-53) {
tmp = (y * 5.0) + (z * (x * 2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y + (z * 2.0))) tmp = 0 if x <= -1.05e-57: tmp = t_1 elif x <= 4.6e-248: tmp = (y * 5.0) + (x * t) elif x <= 1.65e-53: tmp = (y * 5.0) + (z * (x * 2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y + Float64(z * 2.0)))) tmp = 0.0 if (x <= -1.05e-57) tmp = t_1; elseif (x <= 4.6e-248) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.65e-53) tmp = Float64(Float64(y * 5.0) + Float64(z * Float64(x * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y + (z * 2.0))); tmp = 0.0; if (x <= -1.05e-57) tmp = t_1; elseif (x <= 4.6e-248) tmp = (y * 5.0) + (x * t); elseif (x <= 1.65e-53) tmp = (y * 5.0) + (z * (x * 2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-57], t$95$1, If[LessEqual[x, 4.6e-248], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-53], N[(N[(y * 5.0), $MachinePrecision] + N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z \cdot 2\right)\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-248}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 5 + z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.05e-57 or 1.65000000000000002e-53 < x Initial program 100.0%
Taylor expanded in y around 0 87.7%
Taylor expanded in x around inf 84.2%
if -1.05e-57 < x < 4.6e-248Initial program 99.8%
Taylor expanded in y around inf 87.8%
+-commutative87.8%
distribute-lft-in87.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified87.8%
Taylor expanded in x around 0 87.8%
if 4.6e-248 < x < 1.65000000000000002e-53Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 86.0%
Simplified86.0%
fma-udef86.0%
+-commutative86.0%
associate-*r*86.0%
*-commutative86.0%
Applied egg-rr86.0%
Final simplification85.4%
(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 -4.5e-58) (not (<= x 3.1e-116))) (* 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 <= -4.5e-58) || !(x <= 3.1e-116)) {
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 <= (-4.5d-58)) .or. (.not. (x <= 3.1d-116))) 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 <= -4.5e-58) || !(x <= 3.1e-116)) {
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 <= -4.5e-58) or not (x <= 3.1e-116): 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 <= -4.5e-58) || !(x <= 3.1e-116)) tmp = Float64(x * Float64(t + Float64(y + Float64(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 <= -4.5e-58) || ~((x <= 3.1e-116))) 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, -4.5e-58], N[Not[LessEqual[x, 3.1e-116]], $MachinePrecision]], N[(x * N[(t + N[(y + N[(z * 2.0), $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 -4.5 \cdot 10^{-58} \lor \neg \left(x \leq 3.1 \cdot 10^{-116}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -4.5000000000000003e-58 or 3.10000000000000018e-116 < x Initial program 100.0%
Taylor expanded in y around 0 88.7%
Taylor expanded in x around inf 82.5%
if -4.5000000000000003e-58 < x < 3.10000000000000018e-116Initial program 99.9%
Taylor expanded in y around inf 85.6%
+-commutative85.6%
distribute-lft-in85.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified85.6%
Taylor expanded in x around 0 85.6%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.1e+71) (not (<= y 9.2e+38))) (* y (+ 5.0 x)) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e+71) || !(y <= 9.2e+38)) {
tmp = y * (5.0 + x);
} 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 <= (-3.1d+71)) .or. (.not. (y <= 9.2d+38))) then
tmp = y * (5.0d0 + x)
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 <= -3.1e+71) || !(y <= 9.2e+38)) {
tmp = y * (5.0 + x);
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.1e+71) or not (y <= 9.2e+38): tmp = y * (5.0 + x) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.1e+71) || !(y <= 9.2e+38)) tmp = Float64(y * Float64(5.0 + x)); 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 <= -3.1e+71) || ~((y <= 9.2e+38))) tmp = y * (5.0 + x); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.1e+71], N[Not[LessEqual[y, 9.2e+38]], $MachinePrecision]], N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+71} \lor \neg \left(y \leq 9.2 \cdot 10^{+38}\right):\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -3.10000000000000018e71 or 9.2000000000000005e38 < y Initial program 99.9%
Taylor expanded in y around 0 90.8%
Taylor expanded in y around inf 73.8%
+-commutative73.8%
Simplified73.8%
if -3.10000000000000018e71 < y < 9.2000000000000005e38Initial program 99.9%
Taylor expanded in y around 0 78.8%
Final simplification76.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.15e+71) (not (<= y 1.7e-18))) (* 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.15e+71) || !(y <= 1.7e-18)) {
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.15d+71)) .or. (.not. (y <= 1.7d-18))) 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.15e+71) || !(y <= 1.7e-18)) {
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.15e+71) or not (y <= 1.7e-18): 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.15e+71) || !(y <= 1.7e-18)) 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.15e+71) || ~((y <= 1.7e-18))) 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.15e+71], N[Not[LessEqual[y, 1.7e-18]], $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.15 \cdot 10^{+71} \lor \neg \left(y \leq 1.7 \cdot 10^{-18}\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.14999999999999992e71 or 1.70000000000000001e-18 < y Initial program 99.9%
Taylor expanded in y around inf 80.1%
Simplified80.1%
if -2.14999999999999992e71 < y < 1.70000000000000001e-18Initial program 99.9%
Taylor expanded in y around 0 81.4%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.6e+20) (not (<= t 7e-49))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.6e+20) || !(t <= 7e-49)) {
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 <= (-2.6d+20)) .or. (.not. (t <= 7d-49))) 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 <= -2.6e+20) || !(t <= 7e-49)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.6e+20) or not (t <= 7e-49): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.6e+20) || !(t <= 7e-49)) 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 <= -2.6e+20) || ~((t <= 7e-49))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.6e+20], N[Not[LessEqual[t, 7e-49]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+20} \lor \neg \left(t \leq 7 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if t < -2.6e20 or 7.00000000000000012e-49 < t Initial program 99.9%
Taylor expanded in t around inf 52.2%
if -2.6e20 < t < 7.00000000000000012e-49Initial program 99.9%
Taylor expanded in x around 0 37.4%
Final simplification45.1%
(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 26.3%
Final simplification26.3%
herbie shell --seed 2023322
(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)))