
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* z (+ t (+ (* a (/ b z)) (* c (/ i z))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (c * (i / z))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (c * (i / z))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((a * (b / z)) + (c * (i / z)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(c * Float64(i / z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + ((a * (b / z)) + (c * (i / z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + c \cdot \frac{i}{z}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 38.5%
Taylor expanded in z around inf 61.5%
associate-/l*61.5%
associate-/l*84.6%
Simplified84.6%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
fma-define96.1%
associate-+l+96.1%
fma-define97.6%
fma-define98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t)))
(t_2 (* z (+ t (/ (* x y) z))))
(t_3 (+ (* x y) (* c i)))
(t_4 (* z (+ t (/ (* a b) z)))))
(if (<= (* a b) -2.45e+120)
t_4
(if (<= (* a b) -1e-76)
t_3
(if (<= (* a b) 6.2e-232)
t_1
(if (<= (* a b) 1.35e-153)
t_2
(if (<= (* a b) 3.9e-95)
t_3
(if (<= (* a b) 1.7e-33)
t_2
(if (<= (* a b) 3.5e+100) t_1 t_4)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = z * (t + ((x * y) / z));
double t_3 = (x * y) + (c * i);
double t_4 = z * (t + ((a * b) / z));
double tmp;
if ((a * b) <= -2.45e+120) {
tmp = t_4;
} else if ((a * b) <= -1e-76) {
tmp = t_3;
} else if ((a * b) <= 6.2e-232) {
tmp = t_1;
} else if ((a * b) <= 1.35e-153) {
tmp = t_2;
} else if ((a * b) <= 3.9e-95) {
tmp = t_3;
} else if ((a * b) <= 1.7e-33) {
tmp = t_2;
} else if ((a * b) <= 3.5e+100) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = z * (t + ((x * y) / z))
t_3 = (x * y) + (c * i)
t_4 = z * (t + ((a * b) / z))
if ((a * b) <= (-2.45d+120)) then
tmp = t_4
else if ((a * b) <= (-1d-76)) then
tmp = t_3
else if ((a * b) <= 6.2d-232) then
tmp = t_1
else if ((a * b) <= 1.35d-153) then
tmp = t_2
else if ((a * b) <= 3.9d-95) then
tmp = t_3
else if ((a * b) <= 1.7d-33) then
tmp = t_2
else if ((a * b) <= 3.5d+100) then
tmp = t_1
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = z * (t + ((x * y) / z));
double t_3 = (x * y) + (c * i);
double t_4 = z * (t + ((a * b) / z));
double tmp;
if ((a * b) <= -2.45e+120) {
tmp = t_4;
} else if ((a * b) <= -1e-76) {
tmp = t_3;
} else if ((a * b) <= 6.2e-232) {
tmp = t_1;
} else if ((a * b) <= 1.35e-153) {
tmp = t_2;
} else if ((a * b) <= 3.9e-95) {
tmp = t_3;
} else if ((a * b) <= 1.7e-33) {
tmp = t_2;
} else if ((a * b) <= 3.5e+100) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = z * (t + ((x * y) / z)) t_3 = (x * y) + (c * i) t_4 = z * (t + ((a * b) / z)) tmp = 0 if (a * b) <= -2.45e+120: tmp = t_4 elif (a * b) <= -1e-76: tmp = t_3 elif (a * b) <= 6.2e-232: tmp = t_1 elif (a * b) <= 1.35e-153: tmp = t_2 elif (a * b) <= 3.9e-95: tmp = t_3 elif (a * b) <= 1.7e-33: tmp = t_2 elif (a * b) <= 3.5e+100: tmp = t_1 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(z * Float64(t + Float64(Float64(x * y) / z))) t_3 = Float64(Float64(x * y) + Float64(c * i)) t_4 = Float64(z * Float64(t + Float64(Float64(a * b) / z))) tmp = 0.0 if (Float64(a * b) <= -2.45e+120) tmp = t_4; elseif (Float64(a * b) <= -1e-76) tmp = t_3; elseif (Float64(a * b) <= 6.2e-232) tmp = t_1; elseif (Float64(a * b) <= 1.35e-153) tmp = t_2; elseif (Float64(a * b) <= 3.9e-95) tmp = t_3; elseif (Float64(a * b) <= 1.7e-33) tmp = t_2; elseif (Float64(a * b) <= 3.5e+100) tmp = t_1; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = z * (t + ((x * y) / z)); t_3 = (x * y) + (c * i); t_4 = z * (t + ((a * b) / z)); tmp = 0.0; if ((a * b) <= -2.45e+120) tmp = t_4; elseif ((a * b) <= -1e-76) tmp = t_3; elseif ((a * b) <= 6.2e-232) tmp = t_1; elseif ((a * b) <= 1.35e-153) tmp = t_2; elseif ((a * b) <= 3.9e-95) tmp = t_3; elseif ((a * b) <= 1.7e-33) tmp = t_2; elseif ((a * b) <= 3.5e+100) tmp = t_1; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.45e+120], t$95$4, If[LessEqual[N[(a * b), $MachinePrecision], -1e-76], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 6.2e-232], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.35e-153], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.9e-95], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 1.7e-33], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.5e+100], t$95$1, t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := z \cdot \left(t + \frac{x \cdot y}{z}\right)\\
t_3 := x \cdot y + c \cdot i\\
t_4 := z \cdot \left(t + \frac{a \cdot b}{z}\right)\\
\mathbf{if}\;a \cdot b \leq -2.45 \cdot 10^{+120}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-76}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 6.2 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.35 \cdot 10^{-153}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 3.9 \cdot 10^{-95}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 1.7 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (*.f64 a b) < -2.45000000000000005e120 or 3.49999999999999976e100 < (*.f64 a b) Initial program 87.1%
Taylor expanded in x around 0 84.3%
Taylor expanded in z around inf 77.9%
Taylor expanded in c around 0 80.7%
if -2.45000000000000005e120 < (*.f64 a b) < -9.99999999999999927e-77 or 1.35000000000000005e-153 < (*.f64 a b) < 3.9e-95Initial program 100.0%
Taylor expanded in x around inf 78.6%
if -9.99999999999999927e-77 < (*.f64 a b) < 6.1999999999999998e-232 or 1.7e-33 < (*.f64 a b) < 3.49999999999999976e100Initial program 97.2%
Taylor expanded in z around inf 74.2%
if 6.1999999999999998e-232 < (*.f64 a b) < 1.35000000000000005e-153 or 3.9e-95 < (*.f64 a b) < 1.7e-33Initial program 96.6%
Taylor expanded in z around inf 90.2%
Taylor expanded in a around 0 90.2%
Taylor expanded in c around 0 82.2%
Final simplification77.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t)))
(t_2 (+ (* x y) (* c i)))
(t_3 (* z (+ t (/ (* a b) z)))))
(if (<= (* a b) -3e+120)
t_3
(if (<= (* a b) -7e-89)
t_2
(if (<= (* a b) 1.08e-215)
t_1
(if (<= (* a b) 3.9e-73) t_2 (if (<= (* a b) 2.5e+101) t_1 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (x * y) + (c * i);
double t_3 = z * (t + ((a * b) / z));
double tmp;
if ((a * b) <= -3e+120) {
tmp = t_3;
} else if ((a * b) <= -7e-89) {
tmp = t_2;
} else if ((a * b) <= 1.08e-215) {
tmp = t_1;
} else if ((a * b) <= 3.9e-73) {
tmp = t_2;
} else if ((a * b) <= 2.5e+101) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (x * y) + (c * i)
t_3 = z * (t + ((a * b) / z))
if ((a * b) <= (-3d+120)) then
tmp = t_3
else if ((a * b) <= (-7d-89)) then
tmp = t_2
else if ((a * b) <= 1.08d-215) then
tmp = t_1
else if ((a * b) <= 3.9d-73) then
tmp = t_2
else if ((a * b) <= 2.5d+101) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (x * y) + (c * i);
double t_3 = z * (t + ((a * b) / z));
double tmp;
if ((a * b) <= -3e+120) {
tmp = t_3;
} else if ((a * b) <= -7e-89) {
tmp = t_2;
} else if ((a * b) <= 1.08e-215) {
tmp = t_1;
} else if ((a * b) <= 3.9e-73) {
tmp = t_2;
} else if ((a * b) <= 2.5e+101) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (x * y) + (c * i) t_3 = z * (t + ((a * b) / z)) tmp = 0 if (a * b) <= -3e+120: tmp = t_3 elif (a * b) <= -7e-89: tmp = t_2 elif (a * b) <= 1.08e-215: tmp = t_1 elif (a * b) <= 3.9e-73: tmp = t_2 elif (a * b) <= 2.5e+101: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(c * i)) t_3 = Float64(z * Float64(t + Float64(Float64(a * b) / z))) tmp = 0.0 if (Float64(a * b) <= -3e+120) tmp = t_3; elseif (Float64(a * b) <= -7e-89) tmp = t_2; elseif (Float64(a * b) <= 1.08e-215) tmp = t_1; elseif (Float64(a * b) <= 3.9e-73) tmp = t_2; elseif (Float64(a * b) <= 2.5e+101) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = (x * y) + (c * i); t_3 = z * (t + ((a * b) / z)); tmp = 0.0; if ((a * b) <= -3e+120) tmp = t_3; elseif ((a * b) <= -7e-89) tmp = t_2; elseif ((a * b) <= 1.08e-215) tmp = t_1; elseif ((a * b) <= 3.9e-73) tmp = t_2; elseif ((a * b) <= 2.5e+101) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3e+120], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -7e-89], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1.08e-215], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.9e-73], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2.5e+101], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + c \cdot i\\
t_3 := z \cdot \left(t + \frac{a \cdot b}{z}\right)\\
\mathbf{if}\;a \cdot b \leq -3 \cdot 10^{+120}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq -7 \cdot 10^{-89}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 1.08 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 3.9 \cdot 10^{-73}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 a b) < -3e120 or 2.49999999999999994e101 < (*.f64 a b) Initial program 87.1%
Taylor expanded in x around 0 84.3%
Taylor expanded in z around inf 77.9%
Taylor expanded in c around 0 80.7%
if -3e120 < (*.f64 a b) < -6.9999999999999994e-89 or 1.08e-215 < (*.f64 a b) < 3.89999999999999982e-73Initial program 100.0%
Taylor expanded in x around inf 75.0%
if -6.9999999999999994e-89 < (*.f64 a b) < 1.08e-215 or 3.89999999999999982e-73 < (*.f64 a b) < 2.49999999999999994e101Initial program 96.7%
Taylor expanded in z around inf 74.0%
Final simplification76.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i)))
(t_2 (+ (* c i) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* a b) -2.55e+120)
t_3
(if (<= (* a b) -5.5e-77)
t_1
(if (<= (* a b) 3.2e-209)
t_2
(if (<= (* a b) 5.8e-72) t_1 (if (<= (* a b) 1.4e+130) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double t_2 = (c * i) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -2.55e+120) {
tmp = t_3;
} else if ((a * b) <= -5.5e-77) {
tmp = t_1;
} else if ((a * b) <= 3.2e-209) {
tmp = t_2;
} else if ((a * b) <= 5.8e-72) {
tmp = t_1;
} else if ((a * b) <= 1.4e+130) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x * y) + (c * i)
t_2 = (c * i) + (z * t)
t_3 = (a * b) + (c * i)
if ((a * b) <= (-2.55d+120)) then
tmp = t_3
else if ((a * b) <= (-5.5d-77)) then
tmp = t_1
else if ((a * b) <= 3.2d-209) then
tmp = t_2
else if ((a * b) <= 5.8d-72) then
tmp = t_1
else if ((a * b) <= 1.4d+130) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double t_2 = (c * i) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -2.55e+120) {
tmp = t_3;
} else if ((a * b) <= -5.5e-77) {
tmp = t_1;
} else if ((a * b) <= 3.2e-209) {
tmp = t_2;
} else if ((a * b) <= 5.8e-72) {
tmp = t_1;
} else if ((a * b) <= 1.4e+130) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) t_2 = (c * i) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (a * b) <= -2.55e+120: tmp = t_3 elif (a * b) <= -5.5e-77: tmp = t_1 elif (a * b) <= 3.2e-209: tmp = t_2 elif (a * b) <= 5.8e-72: tmp = t_1 elif (a * b) <= 1.4e+130: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(c * i)) t_2 = Float64(Float64(c * i) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -2.55e+120) tmp = t_3; elseif (Float64(a * b) <= -5.5e-77) tmp = t_1; elseif (Float64(a * b) <= 3.2e-209) tmp = t_2; elseif (Float64(a * b) <= 5.8e-72) tmp = t_1; elseif (Float64(a * b) <= 1.4e+130) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (c * i); t_2 = (c * i) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -2.55e+120) tmp = t_3; elseif ((a * b) <= -5.5e-77) tmp = t_1; elseif ((a * b) <= 3.2e-209) tmp = t_2; elseif ((a * b) <= 5.8e-72) tmp = t_1; elseif ((a * b) <= 1.4e+130) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.55e+120], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -5.5e-77], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.2e-209], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 5.8e-72], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.4e+130], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
t_2 := c \cdot i + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -2.55 \cdot 10^{+120}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq -5.5 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{-209}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.4 \cdot 10^{+130}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 a b) < -2.55000000000000014e120 or 1.3999999999999999e130 < (*.f64 a b) Initial program 85.9%
Taylor expanded in a around inf 78.1%
if -2.55000000000000014e120 < (*.f64 a b) < -5.49999999999999998e-77 or 3.2000000000000001e-209 < (*.f64 a b) < 5.79999999999999995e-72Initial program 100.0%
Taylor expanded in x around inf 75.0%
if -5.49999999999999998e-77 < (*.f64 a b) < 3.2000000000000001e-209 or 5.79999999999999995e-72 < (*.f64 a b) < 1.3999999999999999e130Initial program 96.8%
Taylor expanded in z around inf 73.7%
Final simplification75.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1e+89)
(* c i)
(if (<= (* c i) -5e-38)
(* x y)
(if (<= (* c i) 1e-94) (* z t) (if (<= (* c i) 5e-7) (* x y) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1e+89) {
tmp = c * i;
} else if ((c * i) <= -5e-38) {
tmp = x * y;
} else if ((c * i) <= 1e-94) {
tmp = z * t;
} else if ((c * i) <= 5e-7) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1d+89)) then
tmp = c * i
else if ((c * i) <= (-5d-38)) then
tmp = x * y
else if ((c * i) <= 1d-94) then
tmp = z * t
else if ((c * i) <= 5d-7) then
tmp = x * y
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1e+89) {
tmp = c * i;
} else if ((c * i) <= -5e-38) {
tmp = x * y;
} else if ((c * i) <= 1e-94) {
tmp = z * t;
} else if ((c * i) <= 5e-7) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1e+89: tmp = c * i elif (c * i) <= -5e-38: tmp = x * y elif (c * i) <= 1e-94: tmp = z * t elif (c * i) <= 5e-7: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1e+89) tmp = Float64(c * i); elseif (Float64(c * i) <= -5e-38) tmp = Float64(x * y); elseif (Float64(c * i) <= 1e-94) tmp = Float64(z * t); elseif (Float64(c * i) <= 5e-7) tmp = Float64(x * y); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1e+89) tmp = c * i; elseif ((c * i) <= -5e-38) tmp = x * y; elseif ((c * i) <= 1e-94) tmp = z * t; elseif ((c * i) <= 5e-7) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1e+89], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-38], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e-94], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e-7], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+89}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-38}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 10^{-94}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -9.99999999999999995e88 or 4.99999999999999977e-7 < (*.f64 c i) Initial program 93.3%
Taylor expanded in c around inf 56.6%
if -9.99999999999999995e88 < (*.f64 c i) < -5.00000000000000033e-38 or 9.9999999999999996e-95 < (*.f64 c i) < 4.99999999999999977e-7Initial program 95.7%
Taylor expanded in z around inf 87.7%
Taylor expanded in a around 0 76.0%
Taylor expanded in x around inf 49.3%
if -5.00000000000000033e-38 < (*.f64 c i) < 9.9999999999999996e-95Initial program 96.1%
Taylor expanded in z around inf 86.8%
Taylor expanded in a around 0 66.2%
Taylor expanded in z around inf 45.7%
Final simplification50.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= z -3.05e+239)
(* z t)
(if (<= z -5.5e-17)
t_1
(if (<= z -4.5e-36) (* x y) (if (<= z 8.8e-51) t_1 (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if (z <= -3.05e+239) {
tmp = z * t;
} else if (z <= -5.5e-17) {
tmp = t_1;
} else if (z <= -4.5e-36) {
tmp = x * y;
} else if (z <= 8.8e-51) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if (z <= (-3.05d+239)) then
tmp = z * t
else if (z <= (-5.5d-17)) then
tmp = t_1
else if (z <= (-4.5d-36)) then
tmp = x * y
else if (z <= 8.8d-51) then
tmp = t_1
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if (z <= -3.05e+239) {
tmp = z * t;
} else if (z <= -5.5e-17) {
tmp = t_1;
} else if (z <= -4.5e-36) {
tmp = x * y;
} else if (z <= 8.8e-51) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if z <= -3.05e+239: tmp = z * t elif z <= -5.5e-17: tmp = t_1 elif z <= -4.5e-36: tmp = x * y elif z <= 8.8e-51: tmp = t_1 else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (z <= -3.05e+239) tmp = Float64(z * t); elseif (z <= -5.5e-17) tmp = t_1; elseif (z <= -4.5e-36) tmp = Float64(x * y); elseif (z <= 8.8e-51) tmp = t_1; else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if (z <= -3.05e+239) tmp = z * t; elseif (z <= -5.5e-17) tmp = t_1; elseif (z <= -4.5e-36) tmp = x * y; elseif (z <= 8.8e-51) tmp = t_1; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.05e+239], N[(z * t), $MachinePrecision], If[LessEqual[z, -5.5e-17], t$95$1, If[LessEqual[z, -4.5e-36], N[(x * y), $MachinePrecision], If[LessEqual[z, 8.8e-51], t$95$1, N[(z * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+239}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if z < -3.0500000000000002e239 or 8.8000000000000001e-51 < z Initial program 93.6%
Taylor expanded in z around inf 91.5%
Taylor expanded in a around 0 78.7%
Taylor expanded in z around inf 51.1%
if -3.0500000000000002e239 < z < -5.50000000000000001e-17 or -4.50000000000000024e-36 < z < 8.8000000000000001e-51Initial program 96.1%
Taylor expanded in a around inf 54.1%
if -5.50000000000000001e-17 < z < -4.50000000000000024e-36Initial program 83.3%
Taylor expanded in z around inf 67.8%
Taylor expanded in a around 0 67.8%
Taylor expanded in x around inf 66.8%
Final simplification53.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.8e+223) (not (<= (* x y) 1.8e+177))) (+ (* x y) (* c i)) (+ (* c i) (+ (* a b) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4.8e+223) || !((x * y) <= 1.8e+177)) {
tmp = (x * y) + (c * i);
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-4.8d+223)) .or. (.not. ((x * y) <= 1.8d+177))) then
tmp = (x * y) + (c * i)
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4.8e+223) || !((x * y) <= 1.8e+177)) {
tmp = (x * y) + (c * i);
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -4.8e+223) or not ((x * y) <= 1.8e+177): tmp = (x * y) + (c * i) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -4.8e+223) || !(Float64(x * y) <= 1.8e+177)) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -4.8e+223) || ~(((x * y) <= 1.8e+177))) tmp = (x * y) + (c * i); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4.8e+223], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.8e+177]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+223} \lor \neg \left(x \cdot y \leq 1.8 \cdot 10^{+177}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.80000000000000022e223 or 1.80000000000000001e177 < (*.f64 x y) Initial program 89.8%
Taylor expanded in x around inf 83.5%
if -4.80000000000000022e223 < (*.f64 x y) < 1.80000000000000001e177Initial program 96.4%
Taylor expanded in x around 0 84.8%
Final simplification84.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1e+121) (not (<= (* a b) 2e+136))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1e+121) || !((a * b) <= 2e+136)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1d+121)) .or. (.not. ((a * b) <= 2d+136))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1e+121) || !((a * b) <= 2e+136)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1e+121) or not ((a * b) <= 2e+136): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1e+121) || !(Float64(a * b) <= 2e+136)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1e+121) || ~(((a * b) <= 2e+136))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+121], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+136]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+121} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+136}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e121 or 2.00000000000000012e136 < (*.f64 a b) Initial program 85.4%
Taylor expanded in x around 0 85.5%
if -1.00000000000000004e121 < (*.f64 a b) < 2.00000000000000012e136Initial program 97.9%
Taylor expanded in a around 0 92.4%
Final simplification90.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.6e+185) (not (<= (* a b) 4.5e+130))) (+ (* a b) (* c i)) (+ (* c i) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.6e+185) || !((a * b) <= 4.5e+130)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1.6d+185)) .or. (.not. ((a * b) <= 4.5d+130))) then
tmp = (a * b) + (c * i)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.6e+185) || !((a * b) <= 4.5e+130)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.6e+185) or not ((a * b) <= 4.5e+130): tmp = (a * b) + (c * i) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.6e+185) || !(Float64(a * b) <= 4.5e+130)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.6e+185) || ~(((a * b) <= 4.5e+130))) tmp = (a * b) + (c * i); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.6e+185], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.5e+130]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+185} \lor \neg \left(a \cdot b \leq 4.5 \cdot 10^{+130}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -1.60000000000000003e185 or 4.50000000000000039e130 < (*.f64 a b) Initial program 86.4%
Taylor expanded in a around inf 82.7%
if -1.60000000000000003e185 < (*.f64 a b) < 4.50000000000000039e130Initial program 97.4%
Taylor expanded in z around inf 65.4%
Final simplification69.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -31000000.0)
(* z (+ t (/ (* a b) z)))
(if (<= t 1.65e+79)
(+ (* c i) (+ (* a b) (* x y)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -31000000.0) {
tmp = z * (t + ((a * b) / z));
} else if (t <= 1.65e+79) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (t <= (-31000000.0d0)) then
tmp = z * (t + ((a * b) / z))
else if (t <= 1.65d+79) then
tmp = (c * i) + ((a * b) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -31000000.0) {
tmp = z * (t + ((a * b) / z));
} else if (t <= 1.65e+79) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -31000000.0: tmp = z * (t + ((a * b) / z)) elif t <= 1.65e+79: tmp = (c * i) + ((a * b) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -31000000.0) tmp = Float64(z * Float64(t + Float64(Float64(a * b) / z))); elseif (t <= 1.65e+79) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -31000000.0) tmp = z * (t + ((a * b) / z)); elseif (t <= 1.65e+79) tmp = (c * i) + ((a * b) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -31000000.0], N[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+79], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -31000000:\\
\;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\right)\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+79}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if t < -3.1e7Initial program 91.8%
Taylor expanded in x around 0 82.6%
Taylor expanded in z around inf 76.5%
Taylor expanded in c around 0 63.8%
if -3.1e7 < t < 1.6500000000000001e79Initial program 97.7%
Taylor expanded in z around 0 88.2%
if 1.6500000000000001e79 < t Initial program 91.6%
Taylor expanded in x around 0 81.7%
Final simplification79.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -7e-64) (not (<= t 1.3e+79))) (* z t) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -7e-64) || !(t <= 1.3e+79)) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-7d-64)) .or. (.not. (t <= 1.3d+79))) then
tmp = z * t
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -7e-64) || !(t <= 1.3e+79)) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -7e-64) or not (t <= 1.3e+79): tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -7e-64) || !(t <= 1.3e+79)) tmp = Float64(z * t); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -7e-64) || ~((t <= 1.3e+79))) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -7e-64], N[Not[LessEqual[t, 1.3e+79]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-64} \lor \neg \left(t \leq 1.3 \cdot 10^{+79}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if t < -7.0000000000000006e-64 or 1.30000000000000007e79 < t Initial program 92.9%
Taylor expanded in z around inf 82.7%
Taylor expanded in a around 0 72.4%
Taylor expanded in z around inf 47.6%
if -7.0000000000000006e-64 < t < 1.30000000000000007e79Initial program 97.4%
Taylor expanded in c around inf 37.7%
Final simplification43.2%
(FPCore (x y z t a b c i) :precision binary64 (* c i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return c * i;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = c * i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return c * i;
}
def code(x, y, z, t, a, b, c, i): return c * i
function code(x, y, z, t, a, b, c, i) return Float64(c * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = c * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i), $MachinePrecision]
\begin{array}{l}
\\
c \cdot i
\end{array}
Initial program 94.9%
Taylor expanded in c around inf 28.0%
Final simplification28.0%
herbie shell --seed 2024079
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))