
(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 16 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 (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 96.1%
+-commutative96.1%
fma-define98.0%
associate-+l+98.0%
fma-define98.4%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define98.0%
+-commutative98.0%
fma-define98.4%
fma-define98.4%
Simplified98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* c i))))
(if (<= (* x y) -2.8e+166)
t_2
(if (<= (* x y) -9e-272)
t_1
(if (<= (* x y) 2e-316)
(+ (* c i) (* z t))
(if (<= (* x y) 3.5e-108)
t_1
(if (<= (* x y) 1.55e+125)
(+ (* a b) (* c i))
(if (<= (* x y) 1.75e+207) (* z (+ t (/ (* x y) z))) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -2.8e+166) {
tmp = t_2;
} else if ((x * y) <= -9e-272) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 3.5e-108) {
tmp = t_1;
} else if ((x * y) <= 1.55e+125) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.75e+207) {
tmp = z * (t + ((x * y) / z));
} else {
tmp = t_2;
}
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) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (x * y) + (c * i)
if ((x * y) <= (-2.8d+166)) then
tmp = t_2
else if ((x * y) <= (-9d-272)) then
tmp = t_1
else if ((x * y) <= 2d-316) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 3.5d-108) then
tmp = t_1
else if ((x * y) <= 1.55d+125) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.75d+207) then
tmp = z * (t + ((x * y) / z))
else
tmp = t_2
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) + (z * t);
double t_2 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -2.8e+166) {
tmp = t_2;
} else if ((x * y) <= -9e-272) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 3.5e-108) {
tmp = t_1;
} else if ((x * y) <= 1.55e+125) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.75e+207) {
tmp = z * (t + ((x * y) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (c * i) tmp = 0 if (x * y) <= -2.8e+166: tmp = t_2 elif (x * y) <= -9e-272: tmp = t_1 elif (x * y) <= 2e-316: tmp = (c * i) + (z * t) elif (x * y) <= 3.5e-108: tmp = t_1 elif (x * y) <= 1.55e+125: tmp = (a * b) + (c * i) elif (x * y) <= 1.75e+207: tmp = z * (t + ((x * y) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -2.8e+166) tmp = t_2; elseif (Float64(x * y) <= -9e-272) tmp = t_1; elseif (Float64(x * y) <= 2e-316) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 3.5e-108) tmp = t_1; elseif (Float64(x * y) <= 1.55e+125) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.75e+207) tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (x * y) + (c * i); tmp = 0.0; if ((x * y) <= -2.8e+166) tmp = t_2; elseif ((x * y) <= -9e-272) tmp = t_1; elseif ((x * y) <= 2e-316) tmp = (c * i) + (z * t); elseif ((x * y) <= 3.5e-108) tmp = t_1; elseif ((x * y) <= 1.55e+125) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.75e+207) tmp = z * (t + ((x * y) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e+166], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -9e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-316], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.5e-108], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e+125], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.75e+207], N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -2.8 \cdot 10^{+166}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+125}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.75 \cdot 10^{+207}:\\
\;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.79999999999999996e166 or 1.75000000000000014e207 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 86.7%
Taylor expanded in t around 0 85.4%
if -2.79999999999999996e166 < (*.f64 x y) < -8.9999999999999995e-272 or 2.000000017e-316 < (*.f64 x y) < 3.4999999999999999e-108Initial program 97.0%
Taylor expanded in z around inf 92.2%
Taylor expanded in z around inf 88.0%
Taylor expanded in c around 0 77.7%
if -8.9999999999999995e-272 < (*.f64 x y) < 2.000000017e-316Initial program 94.9%
Taylor expanded in a around 0 82.6%
Taylor expanded in x around 0 82.6%
if 3.4999999999999999e-108 < (*.f64 x y) < 1.55e125Initial program 100.0%
Taylor expanded in b around inf 92.1%
associate-/l*86.5%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in b around inf 69.2%
if 1.55e125 < (*.f64 x y) < 1.75000000000000014e207Initial program 92.3%
Taylor expanded in z around inf 84.8%
Taylor expanded in a around 0 77.6%
Taylor expanded in c around 0 70.0%
Final simplification79.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* c i))))
(if (<= (* x y) -5.8e+165)
t_2
(if (<= (* x y) -7.5e-271)
t_1
(if (<= (* x y) 2e-316)
(+ (* c i) (* z t))
(if (<= (* x y) 3e-115)
t_1
(if (<= (* x y) 3.2e+149)
(+ (* a b) (* c i))
(if (<= (* x y) 1.9e+199) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -5.8e+165) {
tmp = t_2;
} else if ((x * y) <= -7.5e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 3e-115) {
tmp = t_1;
} else if ((x * y) <= 3.2e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.9e+199) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (x * y) + (c * i)
if ((x * y) <= (-5.8d+165)) then
tmp = t_2
else if ((x * y) <= (-7.5d-271)) then
tmp = t_1
else if ((x * y) <= 2d-316) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 3d-115) then
tmp = t_1
else if ((x * y) <= 3.2d+149) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.9d+199) 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 a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -5.8e+165) {
tmp = t_2;
} else if ((x * y) <= -7.5e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 3e-115) {
tmp = t_1;
} else if ((x * y) <= 3.2e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.9e+199) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (c * i) tmp = 0 if (x * y) <= -5.8e+165: tmp = t_2 elif (x * y) <= -7.5e-271: tmp = t_1 elif (x * y) <= 2e-316: tmp = (c * i) + (z * t) elif (x * y) <= 3e-115: tmp = t_1 elif (x * y) <= 3.2e+149: tmp = (a * b) + (c * i) elif (x * y) <= 1.9e+199: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -5.8e+165) tmp = t_2; elseif (Float64(x * y) <= -7.5e-271) tmp = t_1; elseif (Float64(x * y) <= 2e-316) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 3e-115) tmp = t_1; elseif (Float64(x * y) <= 3.2e+149) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.9e+199) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (x * y) + (c * i); tmp = 0.0; if ((x * y) <= -5.8e+165) tmp = t_2; elseif ((x * y) <= -7.5e-271) tmp = t_1; elseif ((x * y) <= 2e-316) tmp = (c * i) + (z * t); elseif ((x * y) <= 3e-115) tmp = t_1; elseif ((x * y) <= 3.2e+149) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.9e+199) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e+165], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -7.5e-271], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-316], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e-115], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+149], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.9e+199], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+165}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -7.5 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+149}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.80000000000000011e165 or 1.9e199 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 86.7%
Taylor expanded in t around 0 85.4%
if -5.80000000000000011e165 < (*.f64 x y) < -7.50000000000000031e-271 or 2.000000017e-316 < (*.f64 x y) < 3.0000000000000002e-115 or 3.2000000000000002e149 < (*.f64 x y) < 1.9e199Initial program 96.3%
Taylor expanded in z around inf 91.8%
Taylor expanded in z around inf 86.9%
Taylor expanded in c around 0 78.3%
if -7.50000000000000031e-271 < (*.f64 x y) < 2.000000017e-316Initial program 94.9%
Taylor expanded in a around 0 82.6%
Taylor expanded in x around 0 82.6%
if 3.0000000000000002e-115 < (*.f64 x y) < 3.2000000000000002e149Initial program 100.0%
Taylor expanded in b around inf 90.9%
associate-/l*86.0%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in b around inf 66.5%
Final simplification78.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -5e+225)
(* x y)
(if (<= (* x y) -5.2e-271)
t_1
(if (<= (* x y) 2e-316)
(+ (* c i) (* z t))
(if (<= (* x y) 1.95e-110)
t_1
(if (<= (* x y) 4.8e+148)
(+ (* a b) (* c i))
(if (<= (* x y) 1.02e+200) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -5e+225) {
tmp = x * y;
} else if ((x * y) <= -5.2e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.95e-110) {
tmp = t_1;
} else if ((x * y) <= 4.8e+148) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.02e+200) {
tmp = t_1;
} else {
tmp = x * y;
}
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) + (z * t)
if ((x * y) <= (-5d+225)) then
tmp = x * y
else if ((x * y) <= (-5.2d-271)) then
tmp = t_1
else if ((x * y) <= 2d-316) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1.95d-110) then
tmp = t_1
else if ((x * y) <= 4.8d+148) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.02d+200) then
tmp = t_1
else
tmp = x * y
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) + (z * t);
double tmp;
if ((x * y) <= -5e+225) {
tmp = x * y;
} else if ((x * y) <= -5.2e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.95e-110) {
tmp = t_1;
} else if ((x * y) <= 4.8e+148) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.02e+200) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -5e+225: tmp = x * y elif (x * y) <= -5.2e-271: tmp = t_1 elif (x * y) <= 2e-316: tmp = (c * i) + (z * t) elif (x * y) <= 1.95e-110: tmp = t_1 elif (x * y) <= 4.8e+148: tmp = (a * b) + (c * i) elif (x * y) <= 1.02e+200: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -5e+225) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.2e-271) tmp = t_1; elseif (Float64(x * y) <= 2e-316) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1.95e-110) tmp = t_1; elseif (Float64(x * y) <= 4.8e+148) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.02e+200) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -5e+225) tmp = x * y; elseif ((x * y) <= -5.2e-271) tmp = t_1; elseif ((x * y) <= 2e-316) tmp = (c * i) + (z * t); elseif ((x * y) <= 1.95e-110) tmp = t_1; elseif ((x * y) <= 4.8e+148) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.02e+200) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+225], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.2e-271], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-316], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.95e-110], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+148], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.02e+200], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+225}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.2 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.95 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+148}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.02 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999981e225 or 1.02000000000000001e200 < (*.f64 x y) Initial program 93.1%
Taylor expanded in x around inf 82.9%
if -4.99999999999999981e225 < (*.f64 x y) < -5.2e-271 or 2.000000017e-316 < (*.f64 x y) < 1.95e-110 or 4.79999999999999989e148 < (*.f64 x y) < 1.02000000000000001e200Initial program 96.6%
Taylor expanded in z around inf 90.1%
Taylor expanded in z around inf 85.7%
Taylor expanded in c around 0 75.9%
if -5.2e-271 < (*.f64 x y) < 2.000000017e-316Initial program 94.9%
Taylor expanded in a around 0 82.6%
Taylor expanded in x around 0 82.6%
if 1.95e-110 < (*.f64 x y) < 4.79999999999999989e148Initial program 100.0%
Taylor expanded in b around inf 90.9%
associate-/l*86.0%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in b around inf 66.5%
Final simplification77.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -6.2e+138)
(* a b)
(if (<= (* a b) -6.2e-176)
(* x y)
(if (<= (* a b) 1e-148)
(* z t)
(if (<= (* a b) 1.55e-64)
(* x y)
(if (<= (* a b) 7.8e+141) (* z t) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -6.2e+138) {
tmp = a * b;
} else if ((a * b) <= -6.2e-176) {
tmp = x * y;
} else if ((a * b) <= 1e-148) {
tmp = z * t;
} else if ((a * b) <= 1.55e-64) {
tmp = x * y;
} else if ((a * b) <= 7.8e+141) {
tmp = z * t;
} else {
tmp = a * b;
}
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) <= (-6.2d+138)) then
tmp = a * b
else if ((a * b) <= (-6.2d-176)) then
tmp = x * y
else if ((a * b) <= 1d-148) then
tmp = z * t
else if ((a * b) <= 1.55d-64) then
tmp = x * y
else if ((a * b) <= 7.8d+141) then
tmp = z * t
else
tmp = a * b
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) <= -6.2e+138) {
tmp = a * b;
} else if ((a * b) <= -6.2e-176) {
tmp = x * y;
} else if ((a * b) <= 1e-148) {
tmp = z * t;
} else if ((a * b) <= 1.55e-64) {
tmp = x * y;
} else if ((a * b) <= 7.8e+141) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -6.2e+138: tmp = a * b elif (a * b) <= -6.2e-176: tmp = x * y elif (a * b) <= 1e-148: tmp = z * t elif (a * b) <= 1.55e-64: tmp = x * y elif (a * b) <= 7.8e+141: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -6.2e+138) tmp = Float64(a * b); elseif (Float64(a * b) <= -6.2e-176) tmp = Float64(x * y); elseif (Float64(a * b) <= 1e-148) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.55e-64) tmp = Float64(x * y); elseif (Float64(a * b) <= 7.8e+141) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -6.2e+138) tmp = a * b; elseif ((a * b) <= -6.2e-176) tmp = x * y; elseif ((a * b) <= 1e-148) tmp = z * t; elseif ((a * b) <= 1.55e-64) tmp = x * y; elseif ((a * b) <= 7.8e+141) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -6.2e+138], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -6.2e-176], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-148], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.55e-64], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.8e+141], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.2 \cdot 10^{+138}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -6.2 \cdot 10^{-176}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 10^{-148}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{-64}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 7.8 \cdot 10^{+141}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -6.1999999999999995e138 or 7.79999999999999983e141 < (*.f64 a b) Initial program 92.3%
Taylor expanded in a around inf 74.0%
if -6.1999999999999995e138 < (*.f64 a b) < -6.19999999999999983e-176 or 9.99999999999999936e-149 < (*.f64 a b) < 1.55000000000000012e-64Initial program 98.5%
Taylor expanded in x around inf 50.8%
if -6.19999999999999983e-176 < (*.f64 a b) < 9.99999999999999936e-149 or 1.55000000000000012e-64 < (*.f64 a b) < 7.79999999999999983e141Initial program 97.3%
Taylor expanded in z around inf 45.8%
Final simplification55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.65e+225)
(* x y)
(if (<= (* x y) -1e-108)
t_1
(if (<= (* x y) -4.5e-169)
(* z t)
(if (<= (* x y) 2.6e+132) t_1 (* x y)))))))
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 ((x * y) <= -1.65e+225) {
tmp = x * y;
} else if ((x * y) <= -1e-108) {
tmp = t_1;
} else if ((x * y) <= -4.5e-169) {
tmp = z * t;
} else if ((x * y) <= 2.6e+132) {
tmp = t_1;
} else {
tmp = x * y;
}
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 ((x * y) <= (-1.65d+225)) then
tmp = x * y
else if ((x * y) <= (-1d-108)) then
tmp = t_1
else if ((x * y) <= (-4.5d-169)) then
tmp = z * t
else if ((x * y) <= 2.6d+132) then
tmp = t_1
else
tmp = x * y
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 ((x * y) <= -1.65e+225) {
tmp = x * y;
} else if ((x * y) <= -1e-108) {
tmp = t_1;
} else if ((x * y) <= -4.5e-169) {
tmp = z * t;
} else if ((x * y) <= 2.6e+132) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.65e+225: tmp = x * y elif (x * y) <= -1e-108: tmp = t_1 elif (x * y) <= -4.5e-169: tmp = z * t elif (x * y) <= 2.6e+132: tmp = t_1 else: tmp = x * y 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 (Float64(x * y) <= -1.65e+225) tmp = Float64(x * y); elseif (Float64(x * y) <= -1e-108) tmp = t_1; elseif (Float64(x * y) <= -4.5e-169) tmp = Float64(z * t); elseif (Float64(x * y) <= 2.6e+132) tmp = t_1; else tmp = Float64(x * y); 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 ((x * y) <= -1.65e+225) tmp = x * y; elseif ((x * y) <= -1e-108) tmp = t_1; elseif ((x * y) <= -4.5e-169) tmp = z * t; elseif ((x * y) <= 2.6e+132) tmp = t_1; else tmp = x * y; 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[N[(x * y), $MachinePrecision], -1.65e+225], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-108], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-169], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.6e+132], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.65 \cdot 10^{+225}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-169}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.6 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.65e225 or 2.6e132 < (*.f64 x y) Initial program 92.8%
Taylor expanded in x around inf 74.3%
if -1.65e225 < (*.f64 x y) < -1.00000000000000004e-108 or -4.4999999999999999e-169 < (*.f64 x y) < 2.6e132Initial program 97.7%
Taylor expanded in b around inf 89.6%
associate-/l*85.6%
associate-/l*84.5%
Simplified84.5%
Taylor expanded in b around inf 62.4%
if -1.00000000000000004e-108 < (*.f64 x y) < -4.4999999999999999e-169Initial program 90.9%
Taylor expanded in z around inf 82.3%
Final simplification66.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* z (+ t (/ (* x y) z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((x * y) / z)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + ((x * y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\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 z around inf 10.0%
Taylor expanded in a around 0 20.0%
Taylor expanded in c around 0 50.4%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4e+23)
(* a b)
(if (<= (* a b) 1.05e-8)
(* z t)
(if (<= (* a b) 9.8e+32)
(* c i)
(if (<= (* a b) 1.25e+140) (* z t) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4e+23) {
tmp = a * b;
} else if ((a * b) <= 1.05e-8) {
tmp = z * t;
} else if ((a * b) <= 9.8e+32) {
tmp = c * i;
} else if ((a * b) <= 1.25e+140) {
tmp = z * t;
} else {
tmp = a * b;
}
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) <= (-4d+23)) then
tmp = a * b
else if ((a * b) <= 1.05d-8) then
tmp = z * t
else if ((a * b) <= 9.8d+32) then
tmp = c * i
else if ((a * b) <= 1.25d+140) then
tmp = z * t
else
tmp = a * b
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) <= -4e+23) {
tmp = a * b;
} else if ((a * b) <= 1.05e-8) {
tmp = z * t;
} else if ((a * b) <= 9.8e+32) {
tmp = c * i;
} else if ((a * b) <= 1.25e+140) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4e+23: tmp = a * b elif (a * b) <= 1.05e-8: tmp = z * t elif (a * b) <= 9.8e+32: tmp = c * i elif (a * b) <= 1.25e+140: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4e+23) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.05e-8) tmp = Float64(z * t); elseif (Float64(a * b) <= 9.8e+32) tmp = Float64(c * i); elseif (Float64(a * b) <= 1.25e+140) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4e+23) tmp = a * b; elseif ((a * b) <= 1.05e-8) tmp = z * t; elseif ((a * b) <= 9.8e+32) tmp = c * i; elseif ((a * b) <= 1.25e+140) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4e+23], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e-8], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 9.8e+32], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.25e+140], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+23}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{-8}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 9.8 \cdot 10^{+32}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{+140}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -3.9999999999999997e23 or 1.25000000000000002e140 < (*.f64 a b) Initial program 93.7%
Taylor expanded in a around inf 64.5%
if -3.9999999999999997e23 < (*.f64 a b) < 1.04999999999999997e-8 or 9.8000000000000003e32 < (*.f64 a b) < 1.25000000000000002e140Initial program 97.3%
Taylor expanded in z around inf 40.8%
if 1.04999999999999997e-8 < (*.f64 a b) < 9.8000000000000003e32Initial program 100.0%
Taylor expanded in c around inf 64.8%
Final simplification50.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -1e-95)
(+ (* a b) t_1)
(if (<= (* a b) 2e+140)
(+ (* c i) t_1)
(+ (* c i) (* b (+ a (* x (/ y b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -1e-95) {
tmp = (a * b) + t_1;
} else if ((a * b) <= 2e+140) {
tmp = (c * i) + t_1;
} else {
tmp = (c * i) + (b * (a + (x * (y / b))));
}
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 = (x * y) + (z * t)
if ((a * b) <= (-1d-95)) then
tmp = (a * b) + t_1
else if ((a * b) <= 2d+140) then
tmp = (c * i) + t_1
else
tmp = (c * i) + (b * (a + (x * (y / b))))
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) + (z * t);
double tmp;
if ((a * b) <= -1e-95) {
tmp = (a * b) + t_1;
} else if ((a * b) <= 2e+140) {
tmp = (c * i) + t_1;
} else {
tmp = (c * i) + (b * (a + (x * (y / b))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -1e-95: tmp = (a * b) + t_1 elif (a * b) <= 2e+140: tmp = (c * i) + t_1 else: tmp = (c * i) + (b * (a + (x * (y / b)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1e-95) tmp = Float64(Float64(a * b) + t_1); elseif (Float64(a * b) <= 2e+140) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(c * i) + Float64(b * Float64(a + Float64(x * Float64(y / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -1e-95) tmp = (a * b) + t_1; elseif ((a * b) <= 2e+140) tmp = (c * i) + t_1; else tmp = (c * i) + (b * (a + (x * (y / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e-95], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+140], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(b * N[(a + N[(x * N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{-95}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+140}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + b \cdot \left(a + x \cdot \frac{y}{b}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999989e-96Initial program 94.5%
Taylor expanded in c around 0 86.7%
if -9.99999999999999989e-96 < (*.f64 a b) < 2.00000000000000012e140Initial program 97.8%
Taylor expanded in a around 0 94.4%
if 2.00000000000000012e140 < (*.f64 a b) Initial program 93.4%
Taylor expanded in b around inf 93.4%
associate-/l*95.6%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around 0 97.6%
associate-*r/97.6%
Simplified97.6%
Final simplification92.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.28e-12) (not (<= (* x y) 3.9e+56))) (+ (* a b) (+ (* x y) (* z t))) (+ (* 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) <= -1.28e-12) || !((x * y) <= 3.9e+56)) {
tmp = (a * b) + ((x * y) + (z * t));
} 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) <= (-1.28d-12)) .or. (.not. ((x * y) <= 3.9d+56))) then
tmp = (a * b) + ((x * y) + (z * t))
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) <= -1.28e-12) || !((x * y) <= 3.9e+56)) {
tmp = (a * b) + ((x * y) + (z * t));
} 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) <= -1.28e-12) or not ((x * y) <= 3.9e+56): tmp = (a * b) + ((x * y) + (z * t)) 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) <= -1.28e-12) || !(Float64(x * y) <= 3.9e+56)) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); 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) <= -1.28e-12) || ~(((x * y) <= 3.9e+56))) tmp = (a * b) + ((x * y) + (z * t)); 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], -1.28e-12], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.9e+56]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $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}\;x \cdot y \leq -1.28 \cdot 10^{-12} \lor \neg \left(x \cdot y \leq 3.9 \cdot 10^{+56}\right):\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.28e-12 or 3.89999999999999994e56 < (*.f64 x y) Initial program 95.5%
Taylor expanded in c around 0 88.5%
if -1.28e-12 < (*.f64 x y) < 3.89999999999999994e56Initial program 96.5%
Taylor expanded in x around 0 92.8%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* c i) -2e+119)
(+ (* c i) t_1)
(if (<= (* c i) 1e-52) (+ (* a b) t_1) (+ (* 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 t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -2e+119) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1e-52) {
tmp = (a * b) + t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((c * i) <= (-2d+119)) then
tmp = (c * i) + t_1
else if ((c * i) <= 1d-52) then
tmp = (a * b) + t_1
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 t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -2e+119) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1e-52) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (c * i) <= -2e+119: tmp = (c * i) + t_1 elif (c * i) <= 1e-52: tmp = (a * b) + t_1 else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -2e+119) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(c * i) <= 1e-52) tmp = Float64(Float64(a * b) + t_1); 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) t_1 = (x * y) + (z * t); tmp = 0.0; if ((c * i) <= -2e+119) tmp = (c * i) + t_1; elseif ((c * i) <= 1e-52) tmp = (a * b) + t_1; else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+119], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e-52], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+119}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{-52}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1.99999999999999989e119Initial program 92.5%
Taylor expanded in a around 0 85.3%
if -1.99999999999999989e119 < (*.f64 c i) < 1e-52Initial program 98.0%
Taylor expanded in c around 0 95.2%
if 1e-52 < (*.f64 c i) Initial program 93.5%
Taylor expanded in x around 0 84.3%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2e+119)
(+ (* x y) (* c i))
(if (<= (* c i) 2e+193)
(+ (* a b) (+ (* 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) {
double tmp;
if ((c * i) <= -2e+119) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 2e+193) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + (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) <= (-2d+119)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 2d+193) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (a * b) + (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) <= -2e+119) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 2e+193) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2e+119: tmp = (x * y) + (c * i) elif (c * i) <= 2e+193: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2e+119) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 2e+193) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(a * b) + 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) <= -2e+119) tmp = (x * y) + (c * i); elseif ((c * i) <= 2e+193) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2e+119], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+193], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+119}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+193}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.99999999999999989e119Initial program 92.5%
Taylor expanded in a around 0 85.3%
Taylor expanded in t around 0 80.6%
if -1.99999999999999989e119 < (*.f64 c i) < 2.00000000000000013e193Initial program 98.4%
Taylor expanded in c around 0 92.4%
if 2.00000000000000013e193 < (*.f64 c i) Initial program 86.6%
Taylor expanded in b around inf 83.3%
associate-/l*80.0%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in b around inf 83.7%
Final simplification89.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -6.8e+56) (not (<= (* c i) 9500000000.0))) (+ (* a b) (* 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 (((c * i) <= -6.8e+56) || !((c * i) <= 9500000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (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 (((c * i) <= (-6.8d+56)) .or. (.not. ((c * i) <= 9500000000.0d0))) then
tmp = (a * b) + (c * i)
else
tmp = (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 (((c * i) <= -6.8e+56) || !((c * i) <= 9500000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -6.8e+56) or not ((c * i) <= 9500000000.0): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -6.8e+56) || !(Float64(c * i) <= 9500000000.0)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = 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 (((c * i) <= -6.8e+56) || ~(((c * i) <= 9500000000.0))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -6.8e+56], N[Not[LessEqual[N[(c * i), $MachinePrecision], 9500000000.0]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.8 \cdot 10^{+56} \lor \neg \left(c \cdot i \leq 9500000000\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -6.80000000000000002e56 or 9.5e9 < (*.f64 c i) Initial program 93.1%
Taylor expanded in b around inf 87.5%
associate-/l*83.6%
associate-/l*81.7%
Simplified81.7%
Taylor expanded in b around inf 72.5%
if -6.80000000000000002e56 < (*.f64 c i) < 9.5e9Initial program 98.0%
Taylor expanded in z around inf 88.2%
Taylor expanded in z around inf 68.3%
Taylor expanded in c around 0 66.1%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.05e+24) (not (<= (* a b) 1.3e+125))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.05e+24) || !((a * b) <= 1.3e+125)) {
tmp = a * b;
} 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 (((a * b) <= (-1.05d+24)) .or. (.not. ((a * b) <= 1.3d+125))) then
tmp = a * b
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 (((a * b) <= -1.05e+24) || !((a * b) <= 1.3e+125)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.05e+24) or not ((a * b) <= 1.3e+125): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.05e+24) || !(Float64(a * b) <= 1.3e+125)) tmp = Float64(a * b); 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 (((a * b) <= -1.05e+24) || ~(((a * b) <= 1.3e+125))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.05e+24], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.3e+125]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.05 \cdot 10^{+24} \lor \neg \left(a \cdot b \leq 1.3 \cdot 10^{+125}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.0500000000000001e24 or 1.30000000000000002e125 < (*.f64 a b) Initial program 93.8%
Taylor expanded in a around inf 64.2%
if -1.0500000000000001e24 < (*.f64 a b) < 1.30000000000000002e125Initial program 97.5%
Taylor expanded in c around inf 30.9%
Final simplification43.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
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 = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
Taylor expanded in a around inf 28.6%
herbie shell --seed 2024096
(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)))