
(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 98.8%
+-commutative98.8%
fma-define99.2%
associate-+l+99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Final simplification99.2%
(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 98.8%
associate-+l+98.8%
fma-define98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i)))
(t_2 (+ (* a b) (* z t)))
(t_3 (+ (* a b) (* x y))))
(if (<= (* x y) -6.8e+92)
t_3
(if (<= (* x y) -4.45e-11)
t_1
(if (<= (* x y) -1.7e-64)
t_2
(if (<= (* x y) 1.8e-288)
t_1
(if (<= (* x y) 5.4e-226)
t_2
(if (<= (* x y) 280000000000.0) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -6.8e+92) {
tmp = t_3;
} else if ((x * y) <= -4.45e-11) {
tmp = t_1;
} else if ((x * y) <= -1.7e-64) {
tmp = t_2;
} else if ((x * y) <= 1.8e-288) {
tmp = t_1;
} else if ((x * y) <= 5.4e-226) {
tmp = t_2;
} else if ((x * y) <= 280000000000.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) + (c * i)
t_2 = (a * b) + (z * t)
t_3 = (a * b) + (x * y)
if ((x * y) <= (-6.8d+92)) then
tmp = t_3
else if ((x * y) <= (-4.45d-11)) then
tmp = t_1
else if ((x * y) <= (-1.7d-64)) then
tmp = t_2
else if ((x * y) <= 1.8d-288) then
tmp = t_1
else if ((x * y) <= 5.4d-226) then
tmp = t_2
else if ((x * y) <= 280000000000.0d0) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -6.8e+92) {
tmp = t_3;
} else if ((x * y) <= -4.45e-11) {
tmp = t_1;
} else if ((x * y) <= -1.7e-64) {
tmp = t_2;
} else if ((x * y) <= 1.8e-288) {
tmp = t_1;
} else if ((x * y) <= 5.4e-226) {
tmp = t_2;
} else if ((x * y) <= 280000000000.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = (a * b) + (z * t) t_3 = (a * b) + (x * y) tmp = 0 if (x * y) <= -6.8e+92: tmp = t_3 elif (x * y) <= -4.45e-11: tmp = t_1 elif (x * y) <= -1.7e-64: tmp = t_2 elif (x * y) <= 1.8e-288: tmp = t_1 elif (x * y) <= 5.4e-226: tmp = t_2 elif (x * y) <= 280000000000.0: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -6.8e+92) tmp = t_3; elseif (Float64(x * y) <= -4.45e-11) tmp = t_1; elseif (Float64(x * y) <= -1.7e-64) tmp = t_2; elseif (Float64(x * y) <= 1.8e-288) tmp = t_1; elseif (Float64(x * y) <= 5.4e-226) tmp = t_2; elseif (Float64(x * y) <= 280000000000.0) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); t_2 = (a * b) + (z * t); t_3 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -6.8e+92) tmp = t_3; elseif ((x * y) <= -4.45e-11) tmp = t_1; elseif ((x * y) <= -1.7e-64) tmp = t_2; elseif ((x * y) <= 1.8e-288) tmp = t_1; elseif ((x * y) <= 5.4e-226) tmp = t_2; elseif ((x * y) <= 280000000000.0) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.8e+92], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -4.45e-11], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-64], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.8e-288], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.4e-226], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 280000000000.0], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + z \cdot t\\
t_3 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -6.8 \cdot 10^{+92}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -4.45 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{-288}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{-226}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 280000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -6.7999999999999996e92 or 2.8e11 < (*.f64 x y) Initial program 97.8%
Taylor expanded in z around 0 85.4%
Taylor expanded in c around 0 74.5%
if -6.7999999999999996e92 < (*.f64 x y) < -4.45e-11 or -1.70000000000000006e-64 < (*.f64 x y) < 1.8000000000000001e-288 or 5.40000000000000029e-226 < (*.f64 x y) < 2.8e11Initial program 100.0%
Taylor expanded in z around 0 75.9%
Taylor expanded in x around 0 70.1%
if -4.45e-11 < (*.f64 x y) < -1.70000000000000006e-64 or 1.8000000000000001e-288 < (*.f64 x y) < 5.40000000000000029e-226Initial program 94.4%
Taylor expanded in z around inf 94.4%
Taylor expanded in t around inf 94.4%
Taylor expanded in c around 0 84.0%
Final simplification72.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* x y) -2.8e+175)
(and (not (<= (* x y) 280000000000.0))
(or (<= (* x y) 2.4e+140) (not (<= (* x y) 2e+251)))))
(* x y)
(+ (* 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 (((x * y) <= -2.8e+175) || (!((x * y) <= 280000000000.0) && (((x * y) <= 2.4e+140) || !((x * y) <= 2e+251)))) {
tmp = x * y;
} 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 (((x * y) <= (-2.8d+175)) .or. (.not. ((x * y) <= 280000000000.0d0)) .and. ((x * y) <= 2.4d+140) .or. (.not. ((x * y) <= 2d+251))) then
tmp = x * y
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 (((x * y) <= -2.8e+175) || (!((x * y) <= 280000000000.0) && (((x * y) <= 2.4e+140) || !((x * y) <= 2e+251)))) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2.8e+175) or (not ((x * y) <= 280000000000.0) and (((x * y) <= 2.4e+140) or not ((x * y) <= 2e+251))): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2.8e+175) || (!(Float64(x * y) <= 280000000000.0) && ((Float64(x * y) <= 2.4e+140) || !(Float64(x * y) <= 2e+251)))) tmp = Float64(x * y); 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 (((x * y) <= -2.8e+175) || (~(((x * y) <= 280000000000.0)) && (((x * y) <= 2.4e+140) || ~(((x * y) <= 2e+251))))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.8e+175], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 280000000000.0]], $MachinePrecision], Or[LessEqual[N[(x * y), $MachinePrecision], 2.4e+140], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+251]], $MachinePrecision]]]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.8 \cdot 10^{+175} \lor \neg \left(x \cdot y \leq 280000000000\right) \land \left(x \cdot y \leq 2.4 \cdot 10^{+140} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+251}\right)\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.8000000000000001e175 or 2.8e11 < (*.f64 x y) < 2.4e140 or 2.0000000000000001e251 < (*.f64 x y) Initial program 96.9%
Taylor expanded in x around inf 74.6%
if -2.8000000000000001e175 < (*.f64 x y) < 2.8e11 or 2.4e140 < (*.f64 x y) < 2.0000000000000001e251Initial program 99.4%
Taylor expanded in z around 0 74.6%
Taylor expanded in x around 0 64.4%
Final simplification67.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -5.6e+141)
t_1
(if (<= (* c i) -1.25e+37)
(* x y)
(if (or (<= (* c i) -23500000000.0) (not (<= (* c i) 5.5e+88)))
t_1
(+ (* 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 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.6e+141) {
tmp = t_1;
} else if ((c * i) <= -1.25e+37) {
tmp = x * y;
} else if (((c * i) <= -23500000000.0) || !((c * i) <= 5.5e+88)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((c * i) <= (-5.6d+141)) then
tmp = t_1
else if ((c * i) <= (-1.25d+37)) then
tmp = x * y
else if (((c * i) <= (-23500000000.0d0)) .or. (.not. ((c * i) <= 5.5d+88))) then
tmp = t_1
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 t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.6e+141) {
tmp = t_1;
} else if ((c * i) <= -1.25e+37) {
tmp = x * y;
} else if (((c * i) <= -23500000000.0) || !((c * i) <= 5.5e+88)) {
tmp = t_1;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -5.6e+141: tmp = t_1 elif (c * i) <= -1.25e+37: tmp = x * y elif ((c * i) <= -23500000000.0) or not ((c * i) <= 5.5e+88): tmp = t_1 else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -5.6e+141) tmp = t_1; elseif (Float64(c * i) <= -1.25e+37) tmp = Float64(x * y); elseif ((Float64(c * i) <= -23500000000.0) || !(Float64(c * i) <= 5.5e+88)) tmp = t_1; 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) t_1 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -5.6e+141) tmp = t_1; elseif ((c * i) <= -1.25e+37) tmp = x * y; elseif (((c * i) <= -23500000000.0) || ~(((c * i) <= 5.5e+88))) tmp = t_1; else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5.6e+141], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+37], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], -23500000000.0], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.5e+88]], $MachinePrecision]], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -5.6 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -1.25 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -23500000000 \lor \neg \left(c \cdot i \leq 5.5 \cdot 10^{+88}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -5.59999999999999982e141 or -1.24999999999999997e37 < (*.f64 c i) < -2.35e10 or 5.5e88 < (*.f64 c i) Initial program 97.9%
Taylor expanded in z around 0 89.4%
Taylor expanded in x around 0 76.9%
if -5.59999999999999982e141 < (*.f64 c i) < -1.24999999999999997e37Initial program 99.8%
Taylor expanded in x around inf 52.0%
if -2.35e10 < (*.f64 c i) < 5.5e88Initial program 99.3%
Taylor expanded in z around inf 91.3%
Taylor expanded in t around inf 71.6%
Taylor expanded in c around 0 65.3%
Final simplification68.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4e+93)
(* x y)
(if (<= (* x y) 1.1e-285)
(* c i)
(if (<= (* x y) 3.4e-155)
(* z t)
(if (<= (* x y) 225000000000.0) (* c i) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4e+93) {
tmp = x * y;
} else if ((x * y) <= 1.1e-285) {
tmp = c * i;
} else if ((x * y) <= 3.4e-155) {
tmp = z * t;
} else if ((x * y) <= 225000000000.0) {
tmp = c * i;
} 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) :: tmp
if ((x * y) <= (-4d+93)) then
tmp = x * y
else if ((x * y) <= 1.1d-285) then
tmp = c * i
else if ((x * y) <= 3.4d-155) then
tmp = z * t
else if ((x * y) <= 225000000000.0d0) then
tmp = c * i
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 tmp;
if ((x * y) <= -4e+93) {
tmp = x * y;
} else if ((x * y) <= 1.1e-285) {
tmp = c * i;
} else if ((x * y) <= 3.4e-155) {
tmp = z * t;
} else if ((x * y) <= 225000000000.0) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4e+93: tmp = x * y elif (x * y) <= 1.1e-285: tmp = c * i elif (x * y) <= 3.4e-155: tmp = z * t elif (x * y) <= 225000000000.0: tmp = c * i else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4e+93) tmp = Float64(x * y); elseif (Float64(x * y) <= 1.1e-285) tmp = Float64(c * i); elseif (Float64(x * y) <= 3.4e-155) tmp = Float64(z * t); elseif (Float64(x * y) <= 225000000000.0) tmp = Float64(c * i); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -4e+93) tmp = x * y; elseif ((x * y) <= 1.1e-285) tmp = c * i; elseif ((x * y) <= 3.4e-155) tmp = z * t; elseif ((x * y) <= 225000000000.0) tmp = c * i; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+93], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.1e-285], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e-155], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 225000000000.0], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+93}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{-285}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{-155}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 225000000000:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000017e93 or 2.25e11 < (*.f64 x y) Initial program 97.8%
Taylor expanded in x around inf 62.2%
if -4.00000000000000017e93 < (*.f64 x y) < 1.1e-285 or 3.4e-155 < (*.f64 x y) < 2.25e11Initial program 100.0%
Taylor expanded in c around inf 45.4%
if 1.1e-285 < (*.f64 x y) < 3.4e-155Initial program 95.2%
Taylor expanded in z around inf 54.4%
Final simplification52.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2e-26)
(+ (* c i) (* x y))
(if (<= (* c i) 1e-274)
(+ (* a b) (* z t))
(if (<= (* c i) 2e+51) (+ (* a b) (* 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 ((c * i) <= -2e-26) {
tmp = (c * i) + (x * y);
} else if ((c * i) <= 1e-274) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2e+51) {
tmp = (a * b) + (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 ((c * i) <= (-2d-26)) then
tmp = (c * i) + (x * y)
else if ((c * i) <= 1d-274) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 2d+51) then
tmp = (a * b) + (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 ((c * i) <= -2e-26) {
tmp = (c * i) + (x * y);
} else if ((c * i) <= 1e-274) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2e+51) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2e-26: tmp = (c * i) + (x * y) elif (c * i) <= 1e-274: tmp = (a * b) + (z * t) elif (c * i) <= 2e+51: tmp = (a * b) + (x * y) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2e-26) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(c * i) <= 1e-274) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 2e+51) tmp = Float64(Float64(a * b) + 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 ((c * i) <= -2e-26) tmp = (c * i) + (x * y); elseif ((c * i) <= 1e-274) tmp = (a * b) + (z * t); elseif ((c * i) <= 2e+51) tmp = (a * b) + (x * y); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2e-26], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e-274], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+51], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{-26}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 10^{-274}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+51}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.0000000000000001e-26Initial program 98.6%
Taylor expanded in a around 0 94.5%
Taylor expanded in t around 0 86.0%
if -2.0000000000000001e-26 < (*.f64 c i) < 9.99999999999999966e-275Initial program 100.0%
Taylor expanded in z around inf 91.6%
Taylor expanded in t around inf 74.1%
Taylor expanded in c around 0 70.4%
if 9.99999999999999966e-275 < (*.f64 c i) < 2e51Initial program 98.0%
Taylor expanded in z around 0 76.3%
Taylor expanded in c around 0 68.9%
if 2e51 < (*.f64 c i) Initial program 98.1%
Taylor expanded in a around 0 90.9%
Taylor expanded in x around 0 76.3%
Final simplification75.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -10000.0) (not (<= (* x y) 2e-14))) (+ (* c i) (+ (* 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) <= -10000.0) || !((x * y) <= 2e-14)) {
tmp = (c * i) + ((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) <= (-10000.0d0)) .or. (.not. ((x * y) <= 2d-14))) then
tmp = (c * i) + ((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) <= -10000.0) || !((x * y) <= 2e-14)) {
tmp = (c * i) + ((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) <= -10000.0) or not ((x * y) <= 2e-14): tmp = (c * i) + ((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) <= -10000.0) || !(Float64(x * y) <= 2e-14)) tmp = Float64(Float64(c * i) + 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) <= -10000.0) || ~(((x * y) <= 2e-14))) tmp = (c * i) + ((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], -10000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e-14]], $MachinePrecision]], N[(N[(c * i), $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 -10000 \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-14}\right):\\
\;\;\;\;c \cdot i + \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) < -1e4 or 2e-14 < (*.f64 x y) Initial program 98.3%
Taylor expanded in a around 0 86.5%
if -1e4 < (*.f64 x y) < 2e-14Initial program 99.2%
Taylor expanded in x around 0 97.2%
Final simplification92.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -6e+174)
(+ (* a b) (* z t))
(if (<= (* a b) 1.32e+195)
(+ (* c i) (+ (* x y) (* 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 ((a * b) <= -6e+174) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 1.32e+195) {
tmp = (c * i) + ((x * y) + (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 ((a * b) <= (-6d+174)) then
tmp = (a * b) + (z * t)
else if ((a * b) <= 1.32d+195) then
tmp = (c * i) + ((x * y) + (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 ((a * b) <= -6e+174) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 1.32e+195) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -6e+174: tmp = (a * b) + (z * t) elif (a * b) <= 1.32e+195: tmp = (c * i) + ((x * y) + (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(a * b) <= -6e+174) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(a * b) <= 1.32e+195) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + 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 ((a * b) <= -6e+174) tmp = (a * b) + (z * t); elseif ((a * b) <= 1.32e+195) tmp = (c * i) + ((x * y) + (z * t)); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -6e+174], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.32e+195], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6 \cdot 10^{+174}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.32 \cdot 10^{+195}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -6e174Initial program 100.0%
Taylor expanded in z around inf 87.8%
Taylor expanded in t around inf 92.2%
Taylor expanded in c around 0 83.7%
if -6e174 < (*.f64 a b) < 1.31999999999999993e195Initial program 98.5%
Taylor expanded in a around 0 90.2%
if 1.31999999999999993e195 < (*.f64 a b) Initial program 100.0%
Taylor expanded in z around 0 95.6%
Taylor expanded in c around 0 91.9%
Final simplification89.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -5e+69)
(+ (* c i) (+ (* x y) (* z t)))
(if (<= (* z t) 4e+19)
(+ (* c i) (+ (* a b) (* x y)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + ((x * y) + (z * t));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z * t) <= (-5d+69)) then
tmp = (c * i) + ((x * y) + (z * t))
else if ((z * t) <= 4d+19) then
tmp = (c * i) + ((a * b) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + ((x * y) + (z * t));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -5e+69: tmp = (c * i) + ((x * y) + (z * t)) elif (z * t) <= 4e+19: tmp = (c * i) + ((a * b) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+69) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); elseif (Float64(z * t) <= 4e+19) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z * t) <= -5e+69) tmp = (c * i) + ((x * y) + (z * t)); elseif ((z * t) <= 4e+19) tmp = (c * i) + ((a * b) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+69], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+19], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+69}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+19}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000036e69Initial program 96.1%
Taylor expanded in a around 0 90.7%
if -5.00000000000000036e69 < (*.f64 z t) < 4e19Initial program 99.3%
Taylor expanded in z around 0 94.8%
if 4e19 < (*.f64 z t) Initial program 100.0%
Taylor expanded in x around 0 92.3%
Final simplification93.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -5e+69)
(+ (* c i) (* t (+ z (* x (/ y t)))))
(if (<= (* z t) 4e+19)
(+ (* c i) (+ (* a b) (* x y)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + (t * (z + (x * (y / t))));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z * t) <= (-5d+69)) then
tmp = (c * i) + (t * (z + (x * (y / t))))
else if ((z * t) <= 4d+19) then
tmp = (c * i) + ((a * b) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + (t * (z + (x * (y / t))));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -5e+69: tmp = (c * i) + (t * (z + (x * (y / t)))) elif (z * t) <= 4e+19: tmp = (c * i) + ((a * b) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+69) tmp = Float64(Float64(c * i) + Float64(t * Float64(z + Float64(x * Float64(y / t))))); elseif (Float64(z * t) <= 4e+19) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z * t) <= -5e+69) tmp = (c * i) + (t * (z + (x * (y / t)))); elseif ((z * t) <= 4e+19) tmp = (c * i) + ((a * b) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+69], N[(N[(c * i), $MachinePrecision] + N[(t * N[(z + N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+19], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+69}:\\
\;\;\;\;c \cdot i + t \cdot \left(z + x \cdot \frac{y}{t}\right)\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+19}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000036e69Initial program 96.1%
Taylor expanded in z around inf 98.0%
Taylor expanded in a around 0 92.6%
Taylor expanded in t around inf 92.6%
associate-/l*90.7%
Simplified90.7%
if -5.00000000000000036e69 < (*.f64 z t) < 4e19Initial program 99.3%
Taylor expanded in z around 0 94.8%
if 4e19 < (*.f64 z t) Initial program 100.0%
Taylor expanded in x around 0 92.3%
Final simplification93.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -5e+69)
(+ (* c i) (* z (+ t (/ (* x y) z))))
(if (<= (* z t) 4e+19)
(+ (* c i) (+ (* a b) (* x y)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + (z * (t + ((x * y) / z)));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z * t) <= (-5d+69)) then
tmp = (c * i) + (z * (t + ((x * y) / z)))
else if ((z * t) <= 4d+19) then
tmp = (c * i) + ((a * b) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+69) {
tmp = (c * i) + (z * (t + ((x * y) / z)));
} else if ((z * t) <= 4e+19) {
tmp = (c * i) + ((a * b) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -5e+69: tmp = (c * i) + (z * (t + ((x * y) / z))) elif (z * t) <= 4e+19: tmp = (c * i) + ((a * b) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+69) tmp = Float64(Float64(c * i) + Float64(z * Float64(t + Float64(Float64(x * y) / z)))); elseif (Float64(z * t) <= 4e+19) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z * t) <= -5e+69) tmp = (c * i) + (z * (t + ((x * y) / z))); elseif ((z * t) <= 4e+19) tmp = (c * i) + ((a * b) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+69], N[(N[(c * i), $MachinePrecision] + N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+19], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+69}:\\
\;\;\;\;c \cdot i + z \cdot \left(t + \frac{x \cdot y}{z}\right)\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+19}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000036e69Initial program 96.1%
Taylor expanded in z around inf 98.0%
Taylor expanded in a around 0 92.6%
if -5.00000000000000036e69 < (*.f64 z t) < 4e19Initial program 99.3%
Taylor expanded in z around 0 94.8%
if 4e19 < (*.f64 z t) Initial program 100.0%
Taylor expanded in x around 0 92.3%
Final simplification93.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.5e+85)
(* c i)
(if (<= (* c i) 4.1e-308)
(* z t)
(if (<= (* c i) 3.8e+64) (* 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.5e+85) {
tmp = c * i;
} else if ((c * i) <= 4.1e-308) {
tmp = z * t;
} else if ((c * i) <= 3.8e+64) {
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 ((c * i) <= (-3.5d+85)) then
tmp = c * i
else if ((c * i) <= 4.1d-308) then
tmp = z * t
else if ((c * i) <= 3.8d+64) 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 ((c * i) <= -3.5e+85) {
tmp = c * i;
} else if ((c * i) <= 4.1e-308) {
tmp = z * t;
} else if ((c * i) <= 3.8e+64) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.5e+85: tmp = c * i elif (c * i) <= 4.1e-308: tmp = z * t elif (c * i) <= 3.8e+64: tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.5e+85) tmp = Float64(c * i); elseif (Float64(c * i) <= 4.1e-308) tmp = Float64(z * t); elseif (Float64(c * i) <= 3.8e+64) 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 ((c * i) <= -3.5e+85) tmp = c * i; elseif ((c * i) <= 4.1e-308) tmp = z * t; elseif ((c * i) <= 3.8e+64) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.5e+85], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.1e-308], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.8e+64], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.5 \cdot 10^{+85}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 4.1 \cdot 10^{-308}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3.8 \cdot 10^{+64}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.50000000000000005e85 or 3.8000000000000001e64 < (*.f64 c i) Initial program 98.0%
Taylor expanded in c around inf 67.4%
if -3.50000000000000005e85 < (*.f64 c i) < 4.09999999999999983e-308Initial program 100.0%
Taylor expanded in z around inf 36.5%
if 4.09999999999999983e-308 < (*.f64 c i) < 3.8000000000000001e64Initial program 98.3%
Taylor expanded in a around inf 38.3%
Final simplification49.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2.25e+126) (not (<= (* x y) 3.9e+36))) (+ (* a b) (* 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 (((x * y) <= -2.25e+126) || !((x * y) <= 3.9e+36)) {
tmp = (a * b) + (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 (((x * y) <= (-2.25d+126)) .or. (.not. ((x * y) <= 3.9d+36))) then
tmp = (a * b) + (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 (((x * y) <= -2.25e+126) || !((x * y) <= 3.9e+36)) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2.25e+126) or not ((x * y) <= 3.9e+36): tmp = (a * b) + (x * y) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2.25e+126) || !(Float64(x * y) <= 3.9e+36)) tmp = Float64(Float64(a * b) + 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 (((x * y) <= -2.25e+126) || ~(((x * y) <= 3.9e+36))) tmp = (a * b) + (x * y); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.25e+126], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.9e+36]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+126} \lor \neg \left(x \cdot y \leq 3.9 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -2.24999999999999987e126 or 3.90000000000000021e36 < (*.f64 x y) Initial program 97.7%
Taylor expanded in z around 0 86.5%
Taylor expanded in c around 0 76.8%
if -2.24999999999999987e126 < (*.f64 x y) < 3.90000000000000021e36Initial program 99.4%
Taylor expanded in a around 0 77.3%
Taylor expanded in x around 0 69.9%
Final simplification72.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2.4e-28) (not (<= (* c i) 3.8e+63))) (* 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 (((c * i) <= -2.4e-28) || !((c * i) <= 3.8e+63)) {
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 (((c * i) <= (-2.4d-28)) .or. (.not. ((c * i) <= 3.8d+63))) 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 (((c * i) <= -2.4e-28) || !((c * i) <= 3.8e+63)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -2.4e-28) or not ((c * i) <= 3.8e+63): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -2.4e-28) || !(Float64(c * i) <= 3.8e+63)) 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 (((c * i) <= -2.4e-28) || ~(((c * i) <= 3.8e+63))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -2.4e-28], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.8e+63]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.4 \cdot 10^{-28} \lor \neg \left(c \cdot i \leq 3.8 \cdot 10^{+63}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -2.4000000000000002e-28 or 3.8000000000000001e63 < (*.f64 c i) Initial program 98.3%
Taylor expanded in c around inf 60.7%
if -2.4000000000000002e-28 < (*.f64 c i) < 3.8000000000000001e63Initial program 99.2%
Taylor expanded in a around inf 35.4%
Final simplification47.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (c * i) + ((a * b) + ((x * y) + (z * t)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (c * i) + ((a * b) + ((x * y) + (z * t)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (c * i) + ((a * b) + ((x * y) + (z * t)));
}
def code(x, y, z, t, a, b, c, i): return (c * i) + ((a * b) + ((x * y) + (z * t)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (c * i) + ((a * b) + ((x * y) + (z * t))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)
\end{array}
Initial program 98.8%
Final simplification98.8%
(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 98.8%
Taylor expanded in a around inf 21.9%
Final simplification21.9%
herbie shell --seed 2024059
(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)))