
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma 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.6%
+-commutative99.6%
fma-def99.6%
distribute-rgt-in95.7%
associate-+l+95.7%
+-commutative95.7%
count-295.7%
distribute-rgt-in99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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.6%
fma-def99.6%
associate-+l+99.6%
+-commutative99.6%
count-299.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* z 2.0))) (t_2 (* y (+ 5.0 x))))
(if (<= t -8.2e+95)
(* x t)
(if (<= t -6.8e-169)
t_2
(if (<= t -1.55e-229)
t_1
(if (<= t 2.6e-183)
t_2
(if (<= t 3e-41)
t_1
(if (<= t 6e-11) t_2 (if (<= t 4.6e+67) t_1 (* x t))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z * 2.0);
double t_2 = y * (5.0 + x);
double tmp;
if (t <= -8.2e+95) {
tmp = x * t;
} else if (t <= -6.8e-169) {
tmp = t_2;
} else if (t <= -1.55e-229) {
tmp = t_1;
} else if (t <= 2.6e-183) {
tmp = t_2;
} else if (t <= 3e-41) {
tmp = t_1;
} else if (t <= 6e-11) {
tmp = t_2;
} else if (t <= 4.6e+67) {
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) :: t_2
real(8) :: tmp
t_1 = x * (z * 2.0d0)
t_2 = y * (5.0d0 + x)
if (t <= (-8.2d+95)) then
tmp = x * t
else if (t <= (-6.8d-169)) then
tmp = t_2
else if (t <= (-1.55d-229)) then
tmp = t_1
else if (t <= 2.6d-183) then
tmp = t_2
else if (t <= 3d-41) then
tmp = t_1
else if (t <= 6d-11) then
tmp = t_2
else if (t <= 4.6d+67) 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 = x * (z * 2.0);
double t_2 = y * (5.0 + x);
double tmp;
if (t <= -8.2e+95) {
tmp = x * t;
} else if (t <= -6.8e-169) {
tmp = t_2;
} else if (t <= -1.55e-229) {
tmp = t_1;
} else if (t <= 2.6e-183) {
tmp = t_2;
} else if (t <= 3e-41) {
tmp = t_1;
} else if (t <= 6e-11) {
tmp = t_2;
} else if (t <= 4.6e+67) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z * 2.0) t_2 = y * (5.0 + x) tmp = 0 if t <= -8.2e+95: tmp = x * t elif t <= -6.8e-169: tmp = t_2 elif t <= -1.55e-229: tmp = t_1 elif t <= 2.6e-183: tmp = t_2 elif t <= 3e-41: tmp = t_1 elif t <= 6e-11: tmp = t_2 elif t <= 4.6e+67: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z * 2.0)) t_2 = Float64(y * Float64(5.0 + x)) tmp = 0.0 if (t <= -8.2e+95) tmp = Float64(x * t); elseif (t <= -6.8e-169) tmp = t_2; elseif (t <= -1.55e-229) tmp = t_1; elseif (t <= 2.6e-183) tmp = t_2; elseif (t <= 3e-41) tmp = t_1; elseif (t <= 6e-11) tmp = t_2; elseif (t <= 4.6e+67) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z * 2.0); t_2 = y * (5.0 + x); tmp = 0.0; if (t <= -8.2e+95) tmp = x * t; elseif (t <= -6.8e-169) tmp = t_2; elseif (t <= -1.55e-229) tmp = t_1; elseif (t <= 2.6e-183) tmp = t_2; elseif (t <= 3e-41) tmp = t_1; elseif (t <= 6e-11) tmp = t_2; elseif (t <= 4.6e+67) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e+95], N[(x * t), $MachinePrecision], If[LessEqual[t, -6.8e-169], t$95$2, If[LessEqual[t, -1.55e-229], t$95$1, If[LessEqual[t, 2.6e-183], t$95$2, If[LessEqual[t, 3e-41], t$95$1, If[LessEqual[t, 6e-11], t$95$2, If[LessEqual[t, 4.6e+67], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+95}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{-169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-229}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-183}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if t < -8.19999999999999972e95 or 4.5999999999999997e67 < t Initial program 99.0%
fma-def99.0%
associate-+l+99.0%
+-commutative99.0%
count-299.0%
Simplified99.0%
Taylor expanded in y around 0 92.8%
Taylor expanded in t around inf 73.9%
if -8.19999999999999972e95 < t < -6.8e-169 or -1.55e-229 < t < 2.5999999999999999e-183 or 2.99999999999999989e-41 < t < 6e-11Initial program 99.9%
Taylor expanded in y around 0 91.1%
Simplified91.1%
Taylor expanded in y around inf 57.5%
+-commutative57.5%
Simplified57.5%
if -6.8e-169 < t < -1.55e-229 or 2.5999999999999999e-183 < t < 2.99999999999999989e-41 or 6e-11 < t < 4.5999999999999997e67Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in x around inf 76.5%
Taylor expanded in z around inf 58.4%
Final simplification63.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.1e+124)
t_2
(if (<= y -9.2e+23)
t_1
(if (<= y -7.8e-5)
(* x (* (+ y z) 2.0))
(if (<= y -6e-62)
t_1
(if (<= y 1.7e+108) (* x (+ t (* z 2.0))) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.1e+124) {
tmp = t_2;
} else if (y <= -9.2e+23) {
tmp = t_1;
} else if (y <= -7.8e-5) {
tmp = x * ((y + z) * 2.0);
} else if (y <= -6e-62) {
tmp = t_1;
} else if (y <= 1.7e+108) {
tmp = x * (t + (z * 2.0));
} 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 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.1d+124)) then
tmp = t_2
else if (y <= (-9.2d+23)) then
tmp = t_1
else if (y <= (-7.8d-5)) then
tmp = x * ((y + z) * 2.0d0)
else if (y <= (-6d-62)) then
tmp = t_1
else if (y <= 1.7d+108) then
tmp = x * (t + (z * 2.0d0))
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 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.1e+124) {
tmp = t_2;
} else if (y <= -9.2e+23) {
tmp = t_1;
} else if (y <= -7.8e-5) {
tmp = x * ((y + z) * 2.0);
} else if (y <= -6e-62) {
tmp = t_1;
} else if (y <= 1.7e+108) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.1e+124: tmp = t_2 elif y <= -9.2e+23: tmp = t_1 elif y <= -7.8e-5: tmp = x * ((y + z) * 2.0) elif y <= -6e-62: tmp = t_1 elif y <= 1.7e+108: tmp = x * (t + (z * 2.0)) 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(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.1e+124) tmp = t_2; elseif (y <= -9.2e+23) tmp = t_1; elseif (y <= -7.8e-5) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); elseif (y <= -6e-62) tmp = t_1; elseif (y <= 1.7e+108) tmp = Float64(x * Float64(t + Float64(z * 2.0))); 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 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.1e+124) tmp = t_2; elseif (y <= -9.2e+23) tmp = t_1; elseif (y <= -7.8e-5) tmp = x * ((y + z) * 2.0); elseif (y <= -6e-62) tmp = t_1; elseif (y <= 1.7e+108) tmp = x * (t + (z * 2.0)); 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[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+124], t$95$2, If[LessEqual[y, -9.2e+23], t$95$1, If[LessEqual[y, -7.8e-5], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-62], t$95$1, If[LessEqual[y, 1.7e+108], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+124}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+108}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.1e124 or 1.69999999999999998e108 < y Initial program 98.5%
fma-def98.5%
associate-+l+98.5%
+-commutative98.5%
count-298.5%
Simplified98.5%
Taylor expanded in y around inf 87.1%
if -1.1e124 < y < -9.2000000000000002e23 or -7.7999999999999999e-5 < y < -6.0000000000000002e-62Initial program 100.0%
Taylor expanded in t around inf 77.0%
if -9.2000000000000002e23 < y < -7.7999999999999999e-5Initial program 99.8%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 77.3%
Taylor expanded in t around 0 77.3%
if -6.0000000000000002e-62 < y < 1.69999999999999998e108Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around 0 99.2%
Taylor expanded in y around 0 82.6%
Final simplification82.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z)))) (t_2 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -3.5e-13)
t_2
(if (<= x -1.35e-264)
t_1
(if (<= x 1.7e-88) (+ (* y 5.0) (* x t)) (if (<= x 1.9e-9) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -3.5e-13) {
tmp = t_2;
} else if (x <= -1.35e-264) {
tmp = t_1;
} else if (x <= 1.7e-88) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.9e-9) {
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) + (2.0d0 * (x * z))
t_2 = x * (t + ((y + z) * 2.0d0))
if (x <= (-3.5d-13)) then
tmp = t_2
else if (x <= (-1.35d-264)) then
tmp = t_1
else if (x <= 1.7d-88) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 1.9d-9) 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) + (2.0 * (x * z));
double t_2 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -3.5e-13) {
tmp = t_2;
} else if (x <= -1.35e-264) {
tmp = t_1;
} else if (x <= 1.7e-88) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 1.9e-9) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (2.0 * (x * z)) t_2 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -3.5e-13: tmp = t_2 elif x <= -1.35e-264: tmp = t_1 elif x <= 1.7e-88: tmp = (y * 5.0) + (x * t) elif x <= 1.9e-9: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))) t_2 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -3.5e-13) tmp = t_2; elseif (x <= -1.35e-264) tmp = t_1; elseif (x <= 1.7e-88) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 1.9e-9) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (2.0 * (x * z)); t_2 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -3.5e-13) tmp = t_2; elseif (x <= -1.35e-264) tmp = t_1; elseif (x <= 1.7e-88) tmp = (y * 5.0) + (x * t); elseif (x <= 1.9e-9) 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[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e-13], t$95$2, If[LessEqual[x, -1.35e-264], t$95$1, If[LessEqual[x, 1.7e-88], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e-9], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{-13}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.5000000000000002e-13 or 1.90000000000000006e-9 < 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 99.8%
if -3.5000000000000002e-13 < x < -1.34999999999999997e-264 or 1.69999999999999987e-88 < x < 1.90000000000000006e-9Initial program 98.7%
Taylor expanded in z around inf 86.5%
if -1.34999999999999997e-264 < x < 1.69999999999999987e-88Initial program 99.9%
Taylor expanded in t around inf 88.5%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.5e+27) (not (<= x 5.3e-8))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x (+ t (+ y (+ z z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+27) || !(x <= 5.3e-8)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-9.5d+27)) .or. (.not. (x <= 5.3d-8))) then
tmp = x * (t + ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * (t + (y + (z + z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e+27) || !(x <= 5.3e-8)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (y + (z + z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.5e+27) or not (x <= 5.3e-8): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t + (y + (z + z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.5e+27) || !(x <= 5.3e-8)) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -9.5e+27) || ~((x <= 5.3e-8))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t + (y + (z + z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.5e+27], N[Not[LessEqual[x, 5.3e-8]], $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[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+27} \lor \neg \left(x \leq 5.3 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + \left(z + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.4999999999999997e27 or 5.2999999999999998e-8 < 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 99.8%
if -9.4999999999999997e27 < x < 5.2999999999999998e-8Initial program 99.1%
Taylor expanded in y around 0 99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -9.8e+148)
t_1
(if (<= y -1.95e+54)
(* x (+ t (* y 2.0)))
(if (or (<= y -3.3e-21) (not (<= y 9.5e+106)))
t_1
(* x (+ t (* z 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -9.8e+148) {
tmp = t_1;
} else if (y <= -1.95e+54) {
tmp = x * (t + (y * 2.0));
} else if ((y <= -3.3e-21) || !(y <= 9.5e+106)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-9.8d+148)) then
tmp = t_1
else if (y <= (-1.95d+54)) then
tmp = x * (t + (y * 2.0d0))
else if ((y <= (-3.3d-21)) .or. (.not. (y <= 9.5d+106))) then
tmp = t_1
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 t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -9.8e+148) {
tmp = t_1;
} else if (y <= -1.95e+54) {
tmp = x * (t + (y * 2.0));
} else if ((y <= -3.3e-21) || !(y <= 9.5e+106)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -9.8e+148: tmp = t_1 elif y <= -1.95e+54: tmp = x * (t + (y * 2.0)) elif (y <= -3.3e-21) or not (y <= 9.5e+106): tmp = t_1 else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -9.8e+148) tmp = t_1; elseif (y <= -1.95e+54) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif ((y <= -3.3e-21) || !(y <= 9.5e+106)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(z * 2.0))); 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 <= -9.8e+148) tmp = t_1; elseif (y <= -1.95e+54) tmp = x * (t + (y * 2.0)); elseif ((y <= -3.3e-21) || ~((y <= 9.5e+106))) tmp = t_1; else tmp = x * (t + (z * 2.0)); 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, -9.8e+148], t$95$1, If[LessEqual[y, -1.95e+54], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.3e-21], N[Not[LessEqual[y, 9.5e+106]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -9.8 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-21} \lor \neg \left(y \leq 9.5 \cdot 10^{+106}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -9.8e148 or -1.9500000000000001e54 < y < -3.30000000000000009e-21 or 9.4999999999999995e106 < y Initial program 98.8%
fma-def98.8%
associate-+l+98.8%
+-commutative98.8%
count-298.8%
Simplified98.8%
Taylor expanded in y around inf 82.1%
if -9.8e148 < y < -1.9500000000000001e54Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around 0 66.4%
if -3.30000000000000009e-21 < y < 9.4999999999999995e106Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around 0 99.3%
Taylor expanded in y around 0 81.2%
Final simplification80.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))) (t_2 (* x (* (+ y z) 2.0))))
(if (<= x -6.4e+94)
t_2
(if (<= x -3.65e-13)
t_1
(if (<= x 5.8e-9)
(* y (+ 5.0 (* x 2.0)))
(if (<= x 9.5e+260) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double t_2 = x * ((y + z) * 2.0);
double tmp;
if (x <= -6.4e+94) {
tmp = t_2;
} else if (x <= -3.65e-13) {
tmp = t_1;
} else if (x <= 5.8e-9) {
tmp = y * (5.0 + (x * 2.0));
} else if (x <= 9.5e+260) {
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 + (y * 2.0d0))
t_2 = x * ((y + z) * 2.0d0)
if (x <= (-6.4d+94)) then
tmp = t_2
else if (x <= (-3.65d-13)) then
tmp = t_1
else if (x <= 5.8d-9) then
tmp = y * (5.0d0 + (x * 2.0d0))
else if (x <= 9.5d+260) 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 + (y * 2.0));
double t_2 = x * ((y + z) * 2.0);
double tmp;
if (x <= -6.4e+94) {
tmp = t_2;
} else if (x <= -3.65e-13) {
tmp = t_1;
} else if (x <= 5.8e-9) {
tmp = y * (5.0 + (x * 2.0));
} else if (x <= 9.5e+260) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) t_2 = x * ((y + z) * 2.0) tmp = 0 if x <= -6.4e+94: tmp = t_2 elif x <= -3.65e-13: tmp = t_1 elif x <= 5.8e-9: tmp = y * (5.0 + (x * 2.0)) elif x <= 9.5e+260: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) t_2 = Float64(x * Float64(Float64(y + z) * 2.0)) tmp = 0.0 if (x <= -6.4e+94) tmp = t_2; elseif (x <= -3.65e-13) tmp = t_1; elseif (x <= 5.8e-9) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); elseif (x <= 9.5e+260) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); t_2 = x * ((y + z) * 2.0); tmp = 0.0; if (x <= -6.4e+94) tmp = t_2; elseif (x <= -3.65e-13) tmp = t_1; elseif (x <= 5.8e-9) tmp = y * (5.0 + (x * 2.0)); elseif (x <= 9.5e+260) 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[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.4e+94], t$95$2, If[LessEqual[x, -3.65e-13], t$95$1, If[LessEqual[x, 5.8e-9], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e+260], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{+94}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.65 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-9}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+260}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.40000000000000028e94 or 9.5000000000000004e260 < 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 81.2%
if -6.40000000000000028e94 < x < -3.6500000000000001e-13 or 5.79999999999999982e-9 < x < 9.5000000000000004e260Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 99.7%
Taylor expanded in z around 0 73.9%
if -3.6500000000000001e-13 < x < 5.79999999999999982e-9Initial program 99.1%
fma-def99.1%
associate-+l+99.1%
+-commutative99.1%
count-299.1%
Simplified99.1%
Taylor expanded in y around inf 62.8%
Final simplification70.5%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (+ y (+ z (+ y z)))))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * 5.0d0) + (x * (t + (y + (z + (y + z)))))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + (y + (z + (y + z)))));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + (y + (z + (y + z)))))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z)))))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + (y + (z + (y + z))))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ y t))))
(if (<= x -5.9e+171)
t_1
(if (<= x -1.45e+91)
(* x (* z 2.0))
(if (or (<= x -5e-15) (not (<= x 2.05e-9))) t_1 (* y (+ 5.0 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y + t);
double tmp;
if (x <= -5.9e+171) {
tmp = t_1;
} else if (x <= -1.45e+91) {
tmp = x * (z * 2.0);
} else if ((x <= -5e-15) || !(x <= 2.05e-9)) {
tmp = t_1;
} else {
tmp = y * (5.0 + x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y + t)
if (x <= (-5.9d+171)) then
tmp = t_1
else if (x <= (-1.45d+91)) then
tmp = x * (z * 2.0d0)
else if ((x <= (-5d-15)) .or. (.not. (x <= 2.05d-9))) then
tmp = t_1
else
tmp = y * (5.0d0 + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y + t);
double tmp;
if (x <= -5.9e+171) {
tmp = t_1;
} else if (x <= -1.45e+91) {
tmp = x * (z * 2.0);
} else if ((x <= -5e-15) || !(x <= 2.05e-9)) {
tmp = t_1;
} else {
tmp = y * (5.0 + x);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y + t) tmp = 0 if x <= -5.9e+171: tmp = t_1 elif x <= -1.45e+91: tmp = x * (z * 2.0) elif (x <= -5e-15) or not (x <= 2.05e-9): tmp = t_1 else: tmp = y * (5.0 + x) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y + t)) tmp = 0.0 if (x <= -5.9e+171) tmp = t_1; elseif (x <= -1.45e+91) tmp = Float64(x * Float64(z * 2.0)); elseif ((x <= -5e-15) || !(x <= 2.05e-9)) tmp = t_1; else tmp = Float64(y * Float64(5.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y + t); tmp = 0.0; if (x <= -5.9e+171) tmp = t_1; elseif (x <= -1.45e+91) tmp = x * (z * 2.0); elseif ((x <= -5e-15) || ~((x <= 2.05e-9))) tmp = t_1; else tmp = y * (5.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.9e+171], t$95$1, If[LessEqual[x, -1.45e+91], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5e-15], N[Not[LessEqual[x, 2.05e-9]], $MachinePrecision]], t$95$1, N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y + t\right)\\
\mathbf{if}\;x \leq -5.9 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{+91}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-15} \lor \neg \left(x \leq 2.05 \cdot 10^{-9}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\end{array}
\end{array}
if x < -5.90000000000000035e171 or -1.45000000000000007e91 < x < -4.99999999999999999e-15 or 2.0500000000000002e-9 < x Initial program 100.0%
Taylor expanded in y around 0 90.7%
Simplified90.7%
Taylor expanded in z around 0 64.4%
Taylor expanded in x around inf 64.4%
if -5.90000000000000035e171 < x < -1.45000000000000007e91Initial 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 inf 65.8%
if -4.99999999999999999e-15 < x < 2.0500000000000002e-9Initial program 99.1%
Taylor expanded in y around 0 99.1%
Simplified99.1%
Taylor expanded in y around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification63.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ y t))))
(if (<= t -9.2e+95)
t_1
(if (<= t -3e+60)
(* y (+ 5.0 x))
(if (<= t 1.75e+77) (* x (* (+ y z) 2.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y + t);
double tmp;
if (t <= -9.2e+95) {
tmp = t_1;
} else if (t <= -3e+60) {
tmp = y * (5.0 + x);
} else if (t <= 1.75e+77) {
tmp = x * ((y + 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 = x * (y + t)
if (t <= (-9.2d+95)) then
tmp = t_1
else if (t <= (-3d+60)) then
tmp = y * (5.0d0 + x)
else if (t <= 1.75d+77) then
tmp = x * ((y + 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 = x * (y + t);
double tmp;
if (t <= -9.2e+95) {
tmp = t_1;
} else if (t <= -3e+60) {
tmp = y * (5.0 + x);
} else if (t <= 1.75e+77) {
tmp = x * ((y + z) * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y + t) tmp = 0 if t <= -9.2e+95: tmp = t_1 elif t <= -3e+60: tmp = y * (5.0 + x) elif t <= 1.75e+77: tmp = x * ((y + z) * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y + t)) tmp = 0.0 if (t <= -9.2e+95) tmp = t_1; elseif (t <= -3e+60) tmp = Float64(y * Float64(5.0 + x)); elseif (t <= 1.75e+77) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y + t); tmp = 0.0; if (t <= -9.2e+95) tmp = t_1; elseif (t <= -3e+60) tmp = y * (5.0 + x); elseif (t <= 1.75e+77) tmp = x * ((y + z) * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2e+95], t$95$1, If[LessEqual[t, -3e+60], N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+77], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y + t\right)\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3 \cdot 10^{+60}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+77}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.19999999999999989e95 or 1.7500000000000001e77 < t Initial program 99.0%
Taylor expanded in y around 0 99.5%
Simplified99.5%
Taylor expanded in z around 0 93.9%
Taylor expanded in x around inf 78.1%
if -9.19999999999999989e95 < t < -2.9999999999999998e60Initial program 99.9%
Taylor expanded in y around 0 92.5%
Simplified92.5%
Taylor expanded in y around inf 81.3%
+-commutative81.3%
Simplified81.3%
if -2.9999999999999998e60 < t < 1.7500000000000001e77Initial program 99.9%
fma-def99.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 59.4%
Final simplification67.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ y t))))
(if (<= t -1.3e+96)
t_1
(if (<= t -1.65e-103)
(* y (+ 5.0 (* x 2.0)))
(if (<= t 4.6e+73) (* x (* (+ y z) 2.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y + t);
double tmp;
if (t <= -1.3e+96) {
tmp = t_1;
} else if (t <= -1.65e-103) {
tmp = y * (5.0 + (x * 2.0));
} else if (t <= 4.6e+73) {
tmp = x * ((y + 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 = x * (y + t)
if (t <= (-1.3d+96)) then
tmp = t_1
else if (t <= (-1.65d-103)) then
tmp = y * (5.0d0 + (x * 2.0d0))
else if (t <= 4.6d+73) then
tmp = x * ((y + 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 = x * (y + t);
double tmp;
if (t <= -1.3e+96) {
tmp = t_1;
} else if (t <= -1.65e-103) {
tmp = y * (5.0 + (x * 2.0));
} else if (t <= 4.6e+73) {
tmp = x * ((y + z) * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y + t) tmp = 0 if t <= -1.3e+96: tmp = t_1 elif t <= -1.65e-103: tmp = y * (5.0 + (x * 2.0)) elif t <= 4.6e+73: tmp = x * ((y + z) * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y + t)) tmp = 0.0 if (t <= -1.3e+96) tmp = t_1; elseif (t <= -1.65e-103) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); elseif (t <= 4.6e+73) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y + t); tmp = 0.0; if (t <= -1.3e+96) tmp = t_1; elseif (t <= -1.65e-103) tmp = y * (5.0 + (x * 2.0)); elseif (t <= 4.6e+73) tmp = x * ((y + z) * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.3e+96], t$95$1, If[LessEqual[t, -1.65e-103], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+73], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y + t\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-103}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.3e96 or 4.6e73 < t Initial program 99.0%
Taylor expanded in y around 0 99.5%
Simplified99.5%
Taylor expanded in z around 0 93.9%
Taylor expanded in x around inf 78.1%
if -1.3e96 < t < -1.64999999999999995e-103Initial program 99.8%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in y around inf 67.0%
if -1.64999999999999995e-103 < t < 4.6e73Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 68.4%
Taylor expanded in t around 0 61.3%
Final simplification68.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e-37) (not (<= x 5.5e-26))) (* 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-37) || !(x <= 5.5e-26)) {
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-37)) .or. (.not. (x <= 5.5d-26))) 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-37) || !(x <= 5.5e-26)) {
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-37) or not (x <= 5.5e-26): 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-37) || !(x <= 5.5e-26)) 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 <= -4.5e-37) || ~((x <= 5.5e-26))) 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-37], N[Not[LessEqual[x, 5.5e-26]], $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 -4.5 \cdot 10^{-37} \lor \neg \left(x \leq 5.5 \cdot 10^{-26}\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 < -4.5000000000000004e-37 or 5.5000000000000005e-26 < 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 95.6%
if -4.5000000000000004e-37 < x < 5.5000000000000005e-26Initial program 98.9%
Taylor expanded in t around inf 81.3%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.9e+96) (not (<= t 4.6e+68))) (* x t) (* y (+ 5.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e+96) || !(t <= 4.6e+68)) {
tmp = x * t;
} else {
tmp = y * (5.0 + x);
}
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.9d+96)) .or. (.not. (t <= 4.6d+68))) then
tmp = x * t
else
tmp = y * (5.0d0 + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e+96) || !(t <= 4.6e+68)) {
tmp = x * t;
} else {
tmp = y * (5.0 + x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.9e+96) or not (t <= 4.6e+68): tmp = x * t else: tmp = y * (5.0 + x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.9e+96) || !(t <= 4.6e+68)) tmp = Float64(x * t); else tmp = Float64(y * Float64(5.0 + x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.9e+96) || ~((t <= 4.6e+68))) tmp = x * t; else tmp = y * (5.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.9e+96], N[Not[LessEqual[t, 4.6e+68]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+96} \lor \neg \left(t \leq 4.6 \cdot 10^{+68}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\end{array}
\end{array}
if t < -2.89999999999999978e96 or 4.6e68 < t Initial program 99.0%
fma-def99.0%
associate-+l+99.0%
+-commutative99.0%
count-299.0%
Simplified99.0%
Taylor expanded in y around 0 92.8%
Taylor expanded in t around inf 73.9%
if -2.89999999999999978e96 < t < 4.6e68Initial program 99.9%
Taylor expanded in y around 0 91.1%
Simplified91.1%
Taylor expanded in y around inf 45.8%
+-commutative45.8%
Simplified45.8%
Final simplification56.4%
(FPCore (x y z t) :precision binary64 (if (<= x -1.12e-12) (* x t) (if (<= x 2.95e-8) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.12e-12) {
tmp = x * t;
} else if (x <= 2.95e-8) {
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 <= (-1.12d-12)) then
tmp = x * t
else if (x <= 2.95d-8) 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 <= -1.12e-12) {
tmp = x * t;
} else if (x <= 2.95e-8) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.12e-12: tmp = x * t elif x <= 2.95e-8: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.12e-12) tmp = Float64(x * t); elseif (x <= 2.95e-8) 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 <= -1.12e-12) tmp = x * t; elseif (x <= 2.95e-8) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.12e-12], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.95e-8], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{-12}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.1200000000000001e-12 or 2.9499999999999999e-8 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around 0 92.0%
Taylor expanded in t around inf 47.2%
if -1.1200000000000001e-12 < x < 2.9499999999999999e-8Initial program 99.1%
Taylor expanded in x around 0 61.9%
Simplified61.9%
Final simplification54.0%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * t
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\end{array}
Initial program 99.6%
fma-def99.6%
associate-+l+99.6%
+-commutative99.6%
count-299.6%
Simplified99.6%
Taylor expanded in y around 0 95.6%
Taylor expanded in t around inf 34.3%
Final simplification34.3%
herbie shell --seed 2023257
(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)))