
(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 17 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 97.6%
+-commutative97.6%
fma-def98.0%
associate-+l+98.0%
fma-def98.8%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(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 97.6%
+-commutative97.6%
fma-def98.0%
+-commutative98.0%
fma-def98.4%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (+ (* a b) (* 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(x, y, ((a * b) + (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, Float64(Float64(a * b) + Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b + z \cdot t\right)\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.0%
associate-+l+98.0%
fma-def98.8%
fma-def99.2%
Simplified99.2%
fma-udef98.8%
Applied egg-rr98.8%
Final simplification98.8%
(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 (fma a b (* c i)))))
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 = fma(a, b, (c * i));
}
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 = fma(a, b, Float64(c * i)); end return 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[(a * b + N[(c * i), $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}:\\
\;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\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 0 16.7%
Taylor expanded in x around 0 50.0%
fma-def66.7%
Simplified66.7%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma a b (* c i)) (* z t)) (* x y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma(a, b, (c * i)) + (z * t)) + (x * y);
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(a, b, Float64(c * i)) + Float64(z * t)) + Float64(x * y)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(a, b, c \cdot i\right) + z \cdot t\right) + x \cdot y
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.0%
+-commutative98.0%
fma-def98.4%
fma-def99.2%
Simplified99.2%
fma-udef98.8%
fma-udef98.4%
associate-+r+98.4%
+-commutative98.4%
fma-def97.6%
+-commutative97.6%
associate-+r+97.6%
fma-def98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (fma 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 fma(x, y, (z * t)) + ((a * b) + (c * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\end{array}
Initial program 97.6%
associate-+l+97.6%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.2e+128)
(* a b)
(if (<= (* a b) -3.4e-27)
(* c i)
(if (<= (* a b) -7.8e-162)
(* x y)
(if (<= (* a b) -6.2e-240)
(* c i)
(if (<= (* a b) 3.6e-308)
(* x y)
(if (<= (* a b) 3.2e-226)
(* c i)
(if (<= (* a b) 2.2e-170)
(* z t)
(if (<= (* a b) 4.6e+127) (* x y) (* 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) <= -2.2e+128) {
tmp = a * b;
} else if ((a * b) <= -3.4e-27) {
tmp = c * i;
} else if ((a * b) <= -7.8e-162) {
tmp = x * y;
} else if ((a * b) <= -6.2e-240) {
tmp = c * i;
} else if ((a * b) <= 3.6e-308) {
tmp = x * y;
} else if ((a * b) <= 3.2e-226) {
tmp = c * i;
} else if ((a * b) <= 2.2e-170) {
tmp = z * t;
} else if ((a * b) <= 4.6e+127) {
tmp = x * y;
} 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) <= (-2.2d+128)) then
tmp = a * b
else if ((a * b) <= (-3.4d-27)) then
tmp = c * i
else if ((a * b) <= (-7.8d-162)) then
tmp = x * y
else if ((a * b) <= (-6.2d-240)) then
tmp = c * i
else if ((a * b) <= 3.6d-308) then
tmp = x * y
else if ((a * b) <= 3.2d-226) then
tmp = c * i
else if ((a * b) <= 2.2d-170) then
tmp = z * t
else if ((a * b) <= 4.6d+127) then
tmp = x * y
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) <= -2.2e+128) {
tmp = a * b;
} else if ((a * b) <= -3.4e-27) {
tmp = c * i;
} else if ((a * b) <= -7.8e-162) {
tmp = x * y;
} else if ((a * b) <= -6.2e-240) {
tmp = c * i;
} else if ((a * b) <= 3.6e-308) {
tmp = x * y;
} else if ((a * b) <= 3.2e-226) {
tmp = c * i;
} else if ((a * b) <= 2.2e-170) {
tmp = z * t;
} else if ((a * b) <= 4.6e+127) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.2e+128: tmp = a * b elif (a * b) <= -3.4e-27: tmp = c * i elif (a * b) <= -7.8e-162: tmp = x * y elif (a * b) <= -6.2e-240: tmp = c * i elif (a * b) <= 3.6e-308: tmp = x * y elif (a * b) <= 3.2e-226: tmp = c * i elif (a * b) <= 2.2e-170: tmp = z * t elif (a * b) <= 4.6e+127: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.2e+128) tmp = Float64(a * b); elseif (Float64(a * b) <= -3.4e-27) tmp = Float64(c * i); elseif (Float64(a * b) <= -7.8e-162) tmp = Float64(x * y); elseif (Float64(a * b) <= -6.2e-240) tmp = Float64(c * i); elseif (Float64(a * b) <= 3.6e-308) tmp = Float64(x * y); elseif (Float64(a * b) <= 3.2e-226) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.2e-170) tmp = Float64(z * t); elseif (Float64(a * b) <= 4.6e+127) tmp = Float64(x * y); 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) <= -2.2e+128) tmp = a * b; elseif ((a * b) <= -3.4e-27) tmp = c * i; elseif ((a * b) <= -7.8e-162) tmp = x * y; elseif ((a * b) <= -6.2e-240) tmp = c * i; elseif ((a * b) <= 3.6e-308) tmp = x * y; elseif ((a * b) <= 3.2e-226) tmp = c * i; elseif ((a * b) <= 2.2e-170) tmp = z * t; elseif ((a * b) <= 4.6e+127) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.2e+128], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.4e-27], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -7.8e-162], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -6.2e-240], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.6e-308], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.2e-226], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.2e-170], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.6e+127], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-27}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -7.8 \cdot 10^{-162}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -6.2 \cdot 10^{-240}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{-308}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{-226}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.2 \cdot 10^{-170}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.6 \cdot 10^{+127}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.20000000000000017e128 or 4.6000000000000003e127 < (*.f64 a b) Initial program 94.9%
Taylor expanded in a around inf 79.2%
if -2.20000000000000017e128 < (*.f64 a b) < -3.3999999999999997e-27 or -7.7999999999999999e-162 < (*.f64 a b) < -6.20000000000000034e-240 or 3.5999999999999999e-308 < (*.f64 a b) < 3.19999999999999982e-226Initial program 98.1%
Taylor expanded in c around inf 53.1%
if -3.3999999999999997e-27 < (*.f64 a b) < -7.7999999999999999e-162 or -6.20000000000000034e-240 < (*.f64 a b) < 3.5999999999999999e-308 or 2.20000000000000015e-170 < (*.f64 a b) < 4.6000000000000003e127Initial program 99.1%
Taylor expanded in x around inf 41.0%
if 3.19999999999999982e-226 < (*.f64 a b) < 2.20000000000000015e-170Initial program 100.0%
Taylor expanded in z around inf 79.1%
Final simplification56.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -7.9e+135)
(* x y)
(if (<= (* x y) -3e-45)
t_1
(if (<= (* x y) -3.4e-67)
(* z t)
(if (<= (* x y) -3.3e-126)
t_1
(if (<= (* x y) -2.15e-195)
(* z t)
(if (<= (* x y) 8.5e+197) 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) <= -7.9e+135) {
tmp = x * y;
} else if ((x * y) <= -3e-45) {
tmp = t_1;
} else if ((x * y) <= -3.4e-67) {
tmp = z * t;
} else if ((x * y) <= -3.3e-126) {
tmp = t_1;
} else if ((x * y) <= -2.15e-195) {
tmp = z * t;
} else if ((x * y) <= 8.5e+197) {
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) <= (-7.9d+135)) then
tmp = x * y
else if ((x * y) <= (-3d-45)) then
tmp = t_1
else if ((x * y) <= (-3.4d-67)) then
tmp = z * t
else if ((x * y) <= (-3.3d-126)) then
tmp = t_1
else if ((x * y) <= (-2.15d-195)) then
tmp = z * t
else if ((x * y) <= 8.5d+197) 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) <= -7.9e+135) {
tmp = x * y;
} else if ((x * y) <= -3e-45) {
tmp = t_1;
} else if ((x * y) <= -3.4e-67) {
tmp = z * t;
} else if ((x * y) <= -3.3e-126) {
tmp = t_1;
} else if ((x * y) <= -2.15e-195) {
tmp = z * t;
} else if ((x * y) <= 8.5e+197) {
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) <= -7.9e+135: tmp = x * y elif (x * y) <= -3e-45: tmp = t_1 elif (x * y) <= -3.4e-67: tmp = z * t elif (x * y) <= -3.3e-126: tmp = t_1 elif (x * y) <= -2.15e-195: tmp = z * t elif (x * y) <= 8.5e+197: 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) <= -7.9e+135) tmp = Float64(x * y); elseif (Float64(x * y) <= -3e-45) tmp = t_1; elseif (Float64(x * y) <= -3.4e-67) tmp = Float64(z * t); elseif (Float64(x * y) <= -3.3e-126) tmp = t_1; elseif (Float64(x * y) <= -2.15e-195) tmp = Float64(z * t); elseif (Float64(x * y) <= 8.5e+197) 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) <= -7.9e+135) tmp = x * y; elseif ((x * y) <= -3e-45) tmp = t_1; elseif ((x * y) <= -3.4e-67) tmp = z * t; elseif ((x * y) <= -3.3e-126) tmp = t_1; elseif ((x * y) <= -2.15e-195) tmp = z * t; elseif ((x * y) <= 8.5e+197) 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], -7.9e+135], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3e-45], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e-67], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.3e-126], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.15e-195], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.5e+197], 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 -7.9 \cdot 10^{+135}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-67}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.15 \cdot 10^{-195}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{+197}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.90000000000000017e135 or 8.5000000000000001e197 < (*.f64 x y) Initial program 96.5%
Taylor expanded in x around inf 73.6%
if -7.90000000000000017e135 < (*.f64 x y) < -3.00000000000000011e-45 or -3.4000000000000001e-67 < (*.f64 x y) < -3.3000000000000001e-126 or -2.1500000000000002e-195 < (*.f64 x y) < 8.5000000000000001e197Initial program 97.8%
Taylor expanded in z around 0 78.7%
Taylor expanded in x around 0 67.1%
if -3.00000000000000011e-45 < (*.f64 x y) < -3.4000000000000001e-67 or -3.3000000000000001e-126 < (*.f64 x y) < -2.1500000000000002e-195Initial program 100.0%
Taylor expanded in z around inf 90.5%
Final simplification69.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 (+ (* c i) (* z t)))))
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 = (c * i) + (z * t);
}
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 = (c * i) + (z * t);
}
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 = (c * i) + (z * t) 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(Float64(c * i) + Float64(z * t)); 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 = (c * i) + (z * t); 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[(N[(c * i), $MachinePrecision] + N[(z * t), $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}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\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 a around 0 33.3%
Taylor expanded in x around 0 66.7%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* c i) -4.1e+152)
(and (not (<= (* c i) -5.4e-24))
(or (<= (* c i) -4.3e-106) (not (<= (* c i) 3.2e+133)))))
(+ (* c i) (* z t))
(+ (* a b) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.1e+152) || (!((c * i) <= -5.4e-24) && (((c * i) <= -4.3e-106) || !((c * i) <= 3.2e+133)))) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (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) :: tmp
if (((c * i) <= (-4.1d+152)) .or. (.not. ((c * i) <= (-5.4d-24))) .and. ((c * i) <= (-4.3d-106)) .or. (.not. ((c * i) <= 3.2d+133))) then
tmp = (c * i) + (z * t)
else
tmp = (a * b) + (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 tmp;
if (((c * i) <= -4.1e+152) || (!((c * i) <= -5.4e-24) && (((c * i) <= -4.3e-106) || !((c * i) <= 3.2e+133)))) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -4.1e+152) or (not ((c * i) <= -5.4e-24) and (((c * i) <= -4.3e-106) or not ((c * i) <= 3.2e+133))): tmp = (c * i) + (z * t) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -4.1e+152) || (!(Float64(c * i) <= -5.4e-24) && ((Float64(c * i) <= -4.3e-106) || !(Float64(c * i) <= 3.2e+133)))) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -4.1e+152) || (~(((c * i) <= -5.4e-24)) && (((c * i) <= -4.3e-106) || ~(((c * i) <= 3.2e+133))))) tmp = (c * i) + (z * t); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -4.1e+152], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], -5.4e-24]], $MachinePrecision], Or[LessEqual[N[(c * i), $MachinePrecision], -4.3e-106], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.2e+133]], $MachinePrecision]]]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.1 \cdot 10^{+152} \lor \neg \left(c \cdot i \leq -5.4 \cdot 10^{-24}\right) \land \left(c \cdot i \leq -4.3 \cdot 10^{-106} \lor \neg \left(c \cdot i \leq 3.2 \cdot 10^{+133}\right)\right):\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -4.0999999999999998e152 or -5.40000000000000014e-24 < (*.f64 c i) < -4.3000000000000002e-106 or 3.19999999999999997e133 < (*.f64 c i) Initial program 94.5%
Taylor expanded in a around 0 84.9%
Taylor expanded in x around 0 80.0%
if -4.0999999999999998e152 < (*.f64 c i) < -5.40000000000000014e-24 or -4.3000000000000002e-106 < (*.f64 c i) < 3.19999999999999997e133Initial program 99.4%
+-commutative99.4%
fma-def99.4%
associate-+l+99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
fma-udef99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 79.4%
Taylor expanded in c around 0 72.7%
Final simplification75.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -1.2e+149)
t_2
(if (<= (* c i) -5.4e-24)
t_1
(if (<= (* c i) -5.2e-79)
(* z t)
(if (<= (* c i) 2.1e+137) 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) + (x * y);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.2e+149) {
tmp = t_2;
} else if ((c * i) <= -5.4e-24) {
tmp = t_1;
} else if ((c * i) <= -5.2e-79) {
tmp = z * t;
} else if ((c * i) <= 2.1e+137) {
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) + (x * y)
t_2 = (a * b) + (c * i)
if ((c * i) <= (-1.2d+149)) then
tmp = t_2
else if ((c * i) <= (-5.4d-24)) then
tmp = t_1
else if ((c * i) <= (-5.2d-79)) then
tmp = z * t
else if ((c * i) <= 2.1d+137) 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) + (x * y);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.2e+149) {
tmp = t_2;
} else if ((c * i) <= -5.4e-24) {
tmp = t_1;
} else if ((c * i) <= -5.2e-79) {
tmp = z * t;
} else if ((c * i) <= 2.1e+137) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.2e+149: tmp = t_2 elif (c * i) <= -5.4e-24: tmp = t_1 elif (c * i) <= -5.2e-79: tmp = z * t elif (c * i) <= 2.1e+137: 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(x * y)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.2e+149) tmp = t_2; elseif (Float64(c * i) <= -5.4e-24) tmp = t_1; elseif (Float64(c * i) <= -5.2e-79) tmp = Float64(z * t); elseif (Float64(c * i) <= 2.1e+137) 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) + (x * y); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -1.2e+149) tmp = t_2; elseif ((c * i) <= -5.4e-24) tmp = t_1; elseif ((c * i) <= -5.2e-79) tmp = z * t; elseif ((c * i) <= 2.1e+137) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.2e+149], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -5.4e-24], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5.2e-79], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.1e+137], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.2 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -5.2 \cdot 10^{-79}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.20000000000000006e149 or 2.0999999999999999e137 < (*.f64 c i) Initial program 94.5%
Taylor expanded in z around 0 81.9%
Taylor expanded in x around 0 79.0%
if -1.20000000000000006e149 < (*.f64 c i) < -5.40000000000000014e-24 or -5.19999999999999987e-79 < (*.f64 c i) < 2.0999999999999999e137Initial program 99.4%
+-commutative99.4%
fma-def99.4%
associate-+l+99.4%
fma-def99.4%
fma-def99.4%
Simplified99.4%
fma-udef99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 78.6%
Taylor expanded in c around 0 72.0%
if -5.40000000000000014e-24 < (*.f64 c i) < -5.19999999999999987e-79Initial program 93.2%
Taylor expanded in z around inf 67.2%
Final simplification73.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.2e+128)
(* a b)
(if (<= (* a b) -2.1e-305)
(* c i)
(if (<= (* a b) 2.4e-122)
(* z t)
(if (<= (* a b) 2.5e+128) (* c i) (* 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) <= -4.2e+128) {
tmp = a * b;
} else if ((a * b) <= -2.1e-305) {
tmp = c * i;
} else if ((a * b) <= 2.4e-122) {
tmp = z * t;
} else if ((a * b) <= 2.5e+128) {
tmp = c * i;
} 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) <= (-4.2d+128)) then
tmp = a * b
else if ((a * b) <= (-2.1d-305)) then
tmp = c * i
else if ((a * b) <= 2.4d-122) then
tmp = z * t
else if ((a * b) <= 2.5d+128) then
tmp = c * i
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) <= -4.2e+128) {
tmp = a * b;
} else if ((a * b) <= -2.1e-305) {
tmp = c * i;
} else if ((a * b) <= 2.4e-122) {
tmp = z * t;
} else if ((a * b) <= 2.5e+128) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.2e+128: tmp = a * b elif (a * b) <= -2.1e-305: tmp = c * i elif (a * b) <= 2.4e-122: tmp = z * t elif (a * b) <= 2.5e+128: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4.2e+128) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.1e-305) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.4e-122) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.5e+128) tmp = Float64(c * i); 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) <= -4.2e+128) tmp = a * b; elseif ((a * b) <= -2.1e-305) tmp = c * i; elseif ((a * b) <= 2.4e-122) tmp = z * t; elseif ((a * b) <= 2.5e+128) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4.2e+128], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.1e-305], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.4e-122], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.5e+128], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.1 \cdot 10^{-305}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.4 \cdot 10^{-122}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -4.1999999999999999e128 or 2.5e128 < (*.f64 a b) Initial program 94.9%
Taylor expanded in a around inf 79.2%
if -4.1999999999999999e128 < (*.f64 a b) < -2.1e-305 or 2.39999999999999987e-122 < (*.f64 a b) < 2.5e128Initial program 98.4%
Taylor expanded in c around inf 38.2%
if -2.1e-305 < (*.f64 a b) < 2.39999999999999987e-122Initial program 100.0%
Taylor expanded in z around inf 45.4%
Final simplification52.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -1.1e+135) (not (<= (* a b) 4.6e+74)))
(+ (* a b) t_1)
(+ (* c i) t_1))))
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) <= -1.1e+135) || !((a * b) <= 4.6e+74)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
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) <= (-1.1d+135)) .or. (.not. ((a * b) <= 4.6d+74))) then
tmp = (a * b) + t_1
else
tmp = (c * i) + t_1
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) <= -1.1e+135) || !((a * b) <= 4.6e+74)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((a * b) <= -1.1e+135) or not ((a * b) <= 4.6e+74): tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 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) <= -1.1e+135) || !(Float64(a * b) <= 4.6e+74)) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); 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) <= -1.1e+135) || ~(((a * b) <= 4.6e+74))) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; 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[Or[LessEqual[N[(a * b), $MachinePrecision], -1.1e+135], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.6e+74]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+135} \lor \neg \left(a \cdot b \leq 4.6 \cdot 10^{+74}\right):\\
\;\;\;\;a \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.1e135 or 4.5999999999999997e74 < (*.f64 a b) Initial program 95.4%
Taylor expanded in c around 0 92.0%
if -1.1e135 < (*.f64 a b) < 4.5999999999999997e74Initial program 98.8%
Taylor expanded in a around 0 91.8%
Final simplification91.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.05e+153)
(+ (* c i) (* z t))
(if (<= (* c i) 5e+248)
(+ (* 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) <= -3.05e+153) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 5e+248) {
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) <= (-3.05d+153)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 5d+248) 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) <= -3.05e+153) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 5e+248) {
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) <= -3.05e+153: tmp = (c * i) + (z * t) elif (c * i) <= 5e+248: 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) <= -3.05e+153) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 5e+248) 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) <= -3.05e+153) tmp = (c * i) + (z * t); elseif ((c * i) <= 5e+248) 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], -3.05e+153], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+248], 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 -3.05 \cdot 10^{+153}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+248}:\\
\;\;\;\;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) < -3.0499999999999999e153Initial program 95.0%
Taylor expanded in a around 0 87.9%
Taylor expanded in x around 0 87.2%
if -3.0499999999999999e153 < (*.f64 c i) < 4.9999999999999996e248Initial program 98.9%
Taylor expanded in c around 0 90.0%
if 4.9999999999999996e248 < (*.f64 c i) Initial program 88.2%
Taylor expanded in z around 0 88.2%
Taylor expanded in x around 0 94.1%
Final simplification89.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.3e+267) (* z t) (if (<= z 2e-37) (+ (* a b) (+ (* c i) (* x y))) (+ (* 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 (z <= -2.3e+267) {
tmp = z * t;
} else if (z <= 2e-37) {
tmp = (a * b) + ((c * i) + (x * y));
} 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 (z <= (-2.3d+267)) then
tmp = z * t
else if (z <= 2d-37) then
tmp = (a * b) + ((c * i) + (x * y))
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 (z <= -2.3e+267) {
tmp = z * t;
} else if (z <= 2e-37) {
tmp = (a * b) + ((c * i) + (x * y));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.3e+267: tmp = z * t elif z <= 2e-37: tmp = (a * b) + ((c * i) + (x * y)) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.3e+267) tmp = Float64(z * t); elseif (z <= 2e-37) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(x * y))); 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 (z <= -2.3e+267) tmp = z * t; elseif (z <= 2e-37) tmp = (a * b) + ((c * i) + (x * y)); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.3e+267], N[(z * t), $MachinePrecision], If[LessEqual[z, 2e-37], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+267}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-37}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if z < -2.30000000000000021e267Initial program 88.9%
Taylor expanded in z around inf 100.0%
if -2.30000000000000021e267 < z < 2.00000000000000013e-37Initial program 99.9%
Taylor expanded in z around 0 86.3%
if 2.00000000000000013e-37 < z Initial program 93.0%
Taylor expanded in a around 0 72.3%
Taylor expanded in x around 0 59.5%
Final simplification79.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.15e+126) (not (<= (* a b) 3.3e+127))) (* 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.15e+126) || !((a * b) <= 3.3e+127)) {
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.15d+126)) .or. (.not. ((a * b) <= 3.3d+127))) 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.15e+126) || !((a * b) <= 3.3e+127)) {
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.15e+126) or not ((a * b) <= 3.3e+127): 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.15e+126) || !(Float64(a * b) <= 3.3e+127)) 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.15e+126) || ~(((a * b) <= 3.3e+127))) 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.15e+126], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3.3e+127]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.15 \cdot 10^{+126} \lor \neg \left(a \cdot b \leq 3.3 \cdot 10^{+127}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.15e126 or 3.29999999999999977e127 < (*.f64 a b) Initial program 94.9%
Taylor expanded in a around inf 79.2%
if -1.15e126 < (*.f64 a b) < 3.29999999999999977e127Initial program 98.8%
Taylor expanded in c around inf 34.3%
Final simplification48.0%
(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 97.6%
Taylor expanded in a around inf 30.3%
Final simplification30.3%
herbie shell --seed 2023333
(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)))