
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define98.0%
associate-+l+98.0%
fma-define98.8%
fma-define99.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 96.5%
+-commutative96.5%
fma-define98.0%
+-commutative98.0%
fma-define98.0%
fma-define98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -8.5e+181)
(* x y)
(if (<= (* x y) -5.6e-34)
(* c i)
(if (<= (* x y) -1.05e-55)
(* z t)
(if (<= (* x y) -2.8e-85)
(* c i)
(if (<= (* x y) -1.9e-154)
(* a b)
(if (<= (* x y) -3.5e-241)
(* z t)
(if (<= (* x y) 5.5e+128) (* 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 ((x * y) <= -8.5e+181) {
tmp = x * y;
} else if ((x * y) <= -5.6e-34) {
tmp = c * i;
} else if ((x * y) <= -1.05e-55) {
tmp = z * t;
} else if ((x * y) <= -2.8e-85) {
tmp = c * i;
} else if ((x * y) <= -1.9e-154) {
tmp = a * b;
} else if ((x * y) <= -3.5e-241) {
tmp = z * t;
} else if ((x * y) <= 5.5e+128) {
tmp = a * b;
} 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) <= (-8.5d+181)) then
tmp = x * y
else if ((x * y) <= (-5.6d-34)) then
tmp = c * i
else if ((x * y) <= (-1.05d-55)) then
tmp = z * t
else if ((x * y) <= (-2.8d-85)) then
tmp = c * i
else if ((x * y) <= (-1.9d-154)) then
tmp = a * b
else if ((x * y) <= (-3.5d-241)) then
tmp = z * t
else if ((x * y) <= 5.5d+128) then
tmp = a * b
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) <= -8.5e+181) {
tmp = x * y;
} else if ((x * y) <= -5.6e-34) {
tmp = c * i;
} else if ((x * y) <= -1.05e-55) {
tmp = z * t;
} else if ((x * y) <= -2.8e-85) {
tmp = c * i;
} else if ((x * y) <= -1.9e-154) {
tmp = a * b;
} else if ((x * y) <= -3.5e-241) {
tmp = z * t;
} else if ((x * y) <= 5.5e+128) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -8.5e+181: tmp = x * y elif (x * y) <= -5.6e-34: tmp = c * i elif (x * y) <= -1.05e-55: tmp = z * t elif (x * y) <= -2.8e-85: tmp = c * i elif (x * y) <= -1.9e-154: tmp = a * b elif (x * y) <= -3.5e-241: tmp = z * t elif (x * y) <= 5.5e+128: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -8.5e+181) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.6e-34) tmp = Float64(c * i); elseif (Float64(x * y) <= -1.05e-55) tmp = Float64(z * t); elseif (Float64(x * y) <= -2.8e-85) tmp = Float64(c * i); elseif (Float64(x * y) <= -1.9e-154) tmp = Float64(a * b); elseif (Float64(x * y) <= -3.5e-241) tmp = Float64(z * t); elseif (Float64(x * y) <= 5.5e+128) tmp = Float64(a * b); 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) <= -8.5e+181) tmp = x * y; elseif ((x * y) <= -5.6e-34) tmp = c * i; elseif ((x * y) <= -1.05e-55) tmp = z * t; elseif ((x * y) <= -2.8e-85) tmp = c * i; elseif ((x * y) <= -1.9e-154) tmp = a * b; elseif ((x * y) <= -3.5e-241) tmp = z * t; elseif ((x * y) <= 5.5e+128) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+181], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.6e-34], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-55], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-85], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.9e-154], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-241], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+128], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+181}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-34}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-55}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-85}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-154}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-241}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.49999999999999966e181 or 5.4999999999999998e128 < (*.f64 x y) Initial program 94.3%
Taylor expanded in x around inf 76.6%
if -8.49999999999999966e181 < (*.f64 x y) < -5.59999999999999994e-34 or -1.0500000000000001e-55 < (*.f64 x y) < -2.80000000000000017e-85Initial program 100.0%
Taylor expanded in c around inf 44.9%
if -5.59999999999999994e-34 < (*.f64 x y) < -1.0500000000000001e-55 or -1.90000000000000005e-154 < (*.f64 x y) < -3.4999999999999999e-241Initial program 100.0%
Taylor expanded in z around inf 73.4%
if -2.80000000000000017e-85 < (*.f64 x y) < -1.90000000000000005e-154 or -3.4999999999999999e-241 < (*.f64 x y) < 5.4999999999999998e128Initial program 95.8%
Taylor expanded in a around inf 44.9%
Final simplification56.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.15e+182)
(* x y)
(if (<= (* x y) -3.5e-36)
t_1
(if (<= (* x y) -1.9e-55)
(* z t)
(if (<= (* x y) -1.05e-170)
t_1
(if (<= (* x y) -5e-241)
(* z t)
(if (<= (* x y) 6.5e+140) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.15e+182) {
tmp = x * y;
} else if ((x * y) <= -3.5e-36) {
tmp = t_1;
} else if ((x * y) <= -1.9e-55) {
tmp = z * t;
} else if ((x * y) <= -1.05e-170) {
tmp = t_1;
} else if ((x * y) <= -5e-241) {
tmp = z * t;
} else if ((x * y) <= 6.5e+140) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-1.15d+182)) then
tmp = x * y
else if ((x * y) <= (-3.5d-36)) then
tmp = t_1
else if ((x * y) <= (-1.9d-55)) then
tmp = z * t
else if ((x * y) <= (-1.05d-170)) then
tmp = t_1
else if ((x * y) <= (-5d-241)) then
tmp = z * t
else if ((x * y) <= 6.5d+140) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.15e+182) {
tmp = x * y;
} else if ((x * y) <= -3.5e-36) {
tmp = t_1;
} else if ((x * y) <= -1.9e-55) {
tmp = z * t;
} else if ((x * y) <= -1.05e-170) {
tmp = t_1;
} else if ((x * y) <= -5e-241) {
tmp = z * t;
} else if ((x * y) <= 6.5e+140) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.15e+182: tmp = x * y elif (x * y) <= -3.5e-36: tmp = t_1 elif (x * y) <= -1.9e-55: tmp = z * t elif (x * y) <= -1.05e-170: tmp = t_1 elif (x * y) <= -5e-241: tmp = z * t elif (x * y) <= 6.5e+140: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.15e+182) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.5e-36) tmp = t_1; elseif (Float64(x * y) <= -1.9e-55) tmp = Float64(z * t); elseif (Float64(x * y) <= -1.05e-170) tmp = t_1; elseif (Float64(x * y) <= -5e-241) tmp = Float64(z * t); elseif (Float64(x * y) <= 6.5e+140) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -1.15e+182) tmp = x * y; elseif ((x * y) <= -3.5e-36) tmp = t_1; elseif ((x * y) <= -1.9e-55) tmp = z * t; elseif ((x * y) <= -1.05e-170) tmp = t_1; elseif ((x * y) <= -5e-241) tmp = z * t; elseif ((x * y) <= 6.5e+140) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.15e+182], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-36], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.9e-55], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-170], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-241], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+140], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-55}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-241}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15e182 or 6.4999999999999999e140 < (*.f64 x y) Initial program 94.3%
Taylor expanded in x around inf 76.6%
if -1.15e182 < (*.f64 x y) < -3.5e-36 or -1.8999999999999998e-55 < (*.f64 x y) < -1.05e-170 or -4.9999999999999998e-241 < (*.f64 x y) < 6.4999999999999999e140Initial program 97.0%
Taylor expanded in y around inf 84.6%
associate-/l*81.0%
associate-/l*77.5%
Simplified77.5%
Taylor expanded in a around inf 65.9%
if -3.5e-36 < (*.f64 x y) < -1.8999999999999998e-55 or -1.05e-170 < (*.f64 x y) < -4.9999999999999998e-241Initial program 100.0%
Taylor expanded in z around inf 88.4%
Final simplification70.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* a b) (* z t))))
(if (<= (* x y) -8.5e+182)
t_1
(if (<= (* x y) -2.45e-85)
(+ (* c i) (* z t))
(if (<= (* x y) 1.4e-176)
t_2
(if (<= (* x y) 1.7e-114)
(+ (* a b) (* c i))
(if (<= (* x y) 200000.0) t_2 t_1)))))))
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) + (z * t);
double tmp;
if ((x * y) <= -8.5e+182) {
tmp = t_1;
} else if ((x * y) <= -2.45e-85) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.4e-176) {
tmp = t_2;
} else if ((x * y) <= 1.7e-114) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 200000.0) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = (a * b) + (x * y)
t_2 = (a * b) + (z * t)
if ((x * y) <= (-8.5d+182)) then
tmp = t_1
else if ((x * y) <= (-2.45d-85)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1.4d-176) then
tmp = t_2
else if ((x * y) <= 1.7d-114) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 200000.0d0) then
tmp = t_2
else
tmp = 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 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -8.5e+182) {
tmp = t_1;
} else if ((x * y) <= -2.45e-85) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.4e-176) {
tmp = t_2;
} else if ((x * y) <= 1.7e-114) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 200000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (z * t) tmp = 0 if (x * y) <= -8.5e+182: tmp = t_1 elif (x * y) <= -2.45e-85: tmp = (c * i) + (z * t) elif (x * y) <= 1.4e-176: tmp = t_2 elif (x * y) <= 1.7e-114: tmp = (a * b) + (c * i) elif (x * y) <= 200000.0: tmp = t_2 else: tmp = t_1 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(z * t)) tmp = 0.0 if (Float64(x * y) <= -8.5e+182) tmp = t_1; elseif (Float64(x * y) <= -2.45e-85) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1.4e-176) tmp = t_2; elseif (Float64(x * y) <= 1.7e-114) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 200000.0) tmp = t_2; else tmp = t_1; 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) + (z * t); tmp = 0.0; if ((x * y) <= -8.5e+182) tmp = t_1; elseif ((x * y) <= -2.45e-85) tmp = (c * i) + (z * t); elseif ((x * y) <= 1.4e-176) tmp = t_2; elseif ((x * y) <= 1.7e-114) tmp = (a * b) + (c * i); elseif ((x * y) <= 200000.0) tmp = t_2; else tmp = t_1; 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+182], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.45e-85], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-176], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.7e-114], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{-85}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{-114}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -8.5e182 or 2e5 < (*.f64 x y) Initial program 94.8%
Taylor expanded in z around 0 86.8%
Taylor expanded in c around 0 78.0%
if -8.5e182 < (*.f64 x y) < -2.45000000000000007e-85Initial program 100.0%
Taylor expanded in y around inf 96.6%
associate-/l*96.6%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in t around inf 71.2%
if -2.45000000000000007e-85 < (*.f64 x y) < 1.4000000000000001e-176 or 1.69999999999999991e-114 < (*.f64 x y) < 2e5Initial program 95.8%
Taylor expanded in x around 0 92.8%
Taylor expanded in c around 0 74.2%
if 1.4000000000000001e-176 < (*.f64 x y) < 1.69999999999999991e-114Initial program 100.0%
Taylor expanded in y around inf 89.1%
associate-/l*78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in a around inf 100.0%
Final simplification75.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -5e+185)
(* y (+ x (/ (* a b) y)))
(if (<= (* x y) -5e-85)
(+ (* c i) (* z t))
(if (<= (* x y) 1e-176)
t_1
(if (<= (* x y) 4e-115)
(+ (* a b) (* c i))
(if (<= (* x y) 200.0) t_1 (+ (* a b) (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -5e+185) {
tmp = y * (x + ((a * b) / y));
} else if ((x * y) <= -5e-85) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1e-176) {
tmp = t_1;
} else if ((x * y) <= 4e-115) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 200.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((x * y) <= (-5d+185)) then
tmp = y * (x + ((a * b) / y))
else if ((x * y) <= (-5d-85)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1d-176) then
tmp = t_1
else if ((x * y) <= 4d-115) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 200.0d0) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -5e+185) {
tmp = y * (x + ((a * b) / y));
} else if ((x * y) <= -5e-85) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1e-176) {
tmp = t_1;
} else if ((x * y) <= 4e-115) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 200.0) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -5e+185: tmp = y * (x + ((a * b) / y)) elif (x * y) <= -5e-85: tmp = (c * i) + (z * t) elif (x * y) <= 1e-176: tmp = t_1 elif (x * y) <= 4e-115: tmp = (a * b) + (c * i) elif (x * y) <= 200.0: tmp = t_1 else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -5e+185) tmp = Float64(y * Float64(x + Float64(Float64(a * b) / y))); elseif (Float64(x * y) <= -5e-85) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1e-176) tmp = t_1; elseif (Float64(x * y) <= 4e-115) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 200.0) tmp = t_1; 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) t_1 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -5e+185) tmp = y * (x + ((a * b) / y)); elseif ((x * y) <= -5e-85) tmp = (c * i) + (z * t); elseif ((x * y) <= 1e-176) tmp = t_1; elseif ((x * y) <= 4e-115) tmp = (a * b) + (c * i); elseif ((x * y) <= 200.0) tmp = t_1; else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+185], N[(y * N[(x + N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e-85], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-176], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-115], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200.0], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+185}:\\
\;\;\;\;y \cdot \left(x + \frac{a \cdot b}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-85}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 10^{-176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-115}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 200:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e185Initial program 87.5%
Taylor expanded in z around 0 79.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in y around inf 84.0%
if -4.9999999999999999e185 < (*.f64 x y) < -5.0000000000000002e-85Initial program 100.0%
Taylor expanded in y around inf 96.6%
associate-/l*96.6%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in t around inf 71.2%
if -5.0000000000000002e-85 < (*.f64 x y) < 1e-176 or 4.0000000000000002e-115 < (*.f64 x y) < 200Initial program 95.8%
Taylor expanded in x around 0 92.8%
Taylor expanded in c around 0 74.2%
if 1e-176 < (*.f64 x y) < 4.0000000000000002e-115Initial program 100.0%
Taylor expanded in y around inf 89.1%
associate-/l*78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in a around inf 100.0%
if 200 < (*.f64 x y) Initial program 97.2%
Taylor expanded in z around 0 89.3%
Taylor expanded in c around 0 76.1%
Final simplification75.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* a b) (* x y))))
(if (<= (* x y) -9e+52)
t_2
(if (<= (* x y) 5.8e-173)
t_1
(if (<= (* x y) 2.7e-114)
(+ (* a b) (* c i))
(if (<= (* x y) 2100000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -9e+52) {
tmp = t_2;
} else if ((x * y) <= 5.8e-173) {
tmp = t_1;
} else if ((x * y) <= 2.7e-114) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2100000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (a * b) + (x * y)
if ((x * y) <= (-9d+52)) then
tmp = t_2
else if ((x * y) <= 5.8d-173) then
tmp = t_1
else if ((x * y) <= 2.7d-114) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 2100000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -9e+52) {
tmp = t_2;
} else if ((x * y) <= 5.8e-173) {
tmp = t_1;
} else if ((x * y) <= 2.7e-114) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2100000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (a * b) + (x * y) tmp = 0 if (x * y) <= -9e+52: tmp = t_2 elif (x * y) <= 5.8e-173: tmp = t_1 elif (x * y) <= 2.7e-114: tmp = (a * b) + (c * i) elif (x * y) <= 2100000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -9e+52) tmp = t_2; elseif (Float64(x * y) <= 5.8e-173) tmp = t_1; elseif (Float64(x * y) <= 2.7e-114) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 2100000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -9e+52) tmp = t_2; elseif ((x * y) <= 5.8e-173) tmp = t_1; elseif ((x * y) <= 2.7e-114) tmp = (a * b) + (c * i); elseif ((x * y) <= 2100000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9e+52], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.8e-173], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.7e-114], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2100000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-114}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2100000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -8.9999999999999999e52 or 2.1e6 < (*.f64 x y) Initial program 95.6%
Taylor expanded in z around 0 86.9%
Taylor expanded in c around 0 73.3%
if -8.9999999999999999e52 < (*.f64 x y) < 5.7999999999999997e-173 or 2.7e-114 < (*.f64 x y) < 2.1e6Initial program 97.0%
Taylor expanded in x around 0 94.2%
Taylor expanded in c around 0 72.0%
if 5.7999999999999997e-173 < (*.f64 x y) < 2.7e-114Initial program 100.0%
Taylor expanded in y around inf 89.1%
associate-/l*78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in a around inf 100.0%
Final simplification73.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* z (+ t (/ (* a b) z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((a * b) / z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((a * b) / z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((a * b) / z)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(a * b) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + ((a * b) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 33.3%
Taylor expanded in z around inf 44.4%
Taylor expanded in c around 0 67.1%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -6e+152)
(* c i)
(if (<= (* c i) -5.8e+29)
(* z t)
(if (<= (* c i) 6.6e-224)
(* a b)
(if (<= (* c i) 2.4e+97) (* z t) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -6e+152) {
tmp = c * i;
} else if ((c * i) <= -5.8e+29) {
tmp = z * t;
} else if ((c * i) <= 6.6e-224) {
tmp = a * b;
} else if ((c * i) <= 2.4e+97) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-6d+152)) then
tmp = c * i
else if ((c * i) <= (-5.8d+29)) then
tmp = z * t
else if ((c * i) <= 6.6d-224) then
tmp = a * b
else if ((c * i) <= 2.4d+97) then
tmp = z * t
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -6e+152) {
tmp = c * i;
} else if ((c * i) <= -5.8e+29) {
tmp = z * t;
} else if ((c * i) <= 6.6e-224) {
tmp = a * b;
} else if ((c * i) <= 2.4e+97) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6e+152: tmp = c * i elif (c * i) <= -5.8e+29: tmp = z * t elif (c * i) <= 6.6e-224: tmp = a * b elif (c * i) <= 2.4e+97: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -6e+152) tmp = Float64(c * i); elseif (Float64(c * i) <= -5.8e+29) tmp = Float64(z * t); elseif (Float64(c * i) <= 6.6e-224) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.4e+97) tmp = Float64(z * t); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -6e+152) tmp = c * i; elseif ((c * i) <= -5.8e+29) tmp = z * t; elseif ((c * i) <= 6.6e-224) tmp = a * b; elseif ((c * i) <= 2.4e+97) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -6e+152], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5.8e+29], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.6e-224], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.4e+97], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+152}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -5.8 \cdot 10^{+29}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-224}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+97}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -5.99999999999999981e152 or 2.4e97 < (*.f64 c i) Initial program 90.0%
Taylor expanded in c around inf 67.0%
if -5.99999999999999981e152 < (*.f64 c i) < -5.7999999999999999e29 or 6.6000000000000003e-224 < (*.f64 c i) < 2.4e97Initial program 98.7%
Taylor expanded in z around inf 39.9%
if -5.7999999999999999e29 < (*.f64 c i) < 6.6000000000000003e-224Initial program 100.0%
Taylor expanded in a around inf 46.3%
Final simplification50.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+62) (not (<= (* x y) 200.0))) (+ (* 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 (((x * y) <= -5e+62) || !((x * y) <= 200.0)) {
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 (((x * y) <= (-5d+62)) .or. (.not. ((x * y) <= 200.0d0))) 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 (((x * y) <= -5e+62) || !((x * y) <= 200.0)) {
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 ((x * y) <= -5e+62) or not ((x * y) <= 200.0): 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(x * y) <= -5e+62) || !(Float64(x * y) <= 200.0)) 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 (((x * y) <= -5e+62) || ~(((x * y) <= 200.0))) 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[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+62], N[Not[LessEqual[N[(x * y), $MachinePrecision], 200.0]], $MachinePrecision]], 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}\;x \cdot y \leq -5 \cdot 10^{+62} \lor \neg \left(x \cdot y \leq 200\right):\\
\;\;\;\;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 x y) < -5.00000000000000029e62 or 200 < (*.f64 x y) Initial program 95.5%
Taylor expanded in z around 0 86.8%
if -5.00000000000000029e62 < (*.f64 x y) < 200Initial program 97.2%
Taylor expanded in x around 0 94.6%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+185)
(* y (+ x (/ (* a b) y)))
(if (<= (* x y) 2e+121)
(+ (* c i) (+ (* a b) (* 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 ((x * y) <= -5e+185) {
tmp = y * (x + ((a * b) / y));
} else if ((x * y) <= 2e+121) {
tmp = (c * i) + ((a * b) + (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 ((x * y) <= (-5d+185)) then
tmp = y * (x + ((a * b) / y))
else if ((x * y) <= 2d+121) then
tmp = (c * i) + ((a * b) + (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 ((x * y) <= -5e+185) {
tmp = y * (x + ((a * b) / y));
} else if ((x * y) <= 2e+121) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+185: tmp = y * (x + ((a * b) / y)) elif (x * y) <= 2e+121: tmp = (c * i) + ((a * b) + (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(x * y) <= -5e+185) tmp = Float64(y * Float64(x + Float64(Float64(a * b) / y))); elseif (Float64(x * y) <= 2e+121) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + 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 ((x * y) <= -5e+185) tmp = y * (x + ((a * b) / y)); elseif ((x * y) <= 2e+121) tmp = (c * i) + ((a * b) + (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[(x * y), $MachinePrecision], -5e+185], N[(y * N[(x + N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+121], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $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}\;x \cdot y \leq -5 \cdot 10^{+185}:\\
\;\;\;\;y \cdot \left(x + \frac{a \cdot b}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+121}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e185Initial program 87.5%
Taylor expanded in z around 0 79.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in y around inf 84.0%
if -4.9999999999999999e185 < (*.f64 x y) < 2.00000000000000007e121Initial program 97.3%
Taylor expanded in x around 0 90.4%
if 2.00000000000000007e121 < (*.f64 x y) Initial program 97.8%
Taylor expanded in z around 0 93.8%
Taylor expanded in c around 0 85.5%
Final simplification88.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+62)
(+ (* c i) (* y (+ x (/ (* a b) y))))
(if (<= (* x y) 200.0)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* 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 ((x * y) <= -5e+62) {
tmp = (c * i) + (y * (x + ((a * b) / y)));
} else if ((x * y) <= 200.0) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 ((x * y) <= (-5d+62)) then
tmp = (c * i) + (y * (x + ((a * b) / y)))
else if ((x * y) <= 200.0d0) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((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 ((x * y) <= -5e+62) {
tmp = (c * i) + (y * (x + ((a * b) / y)));
} else if ((x * y) <= 200.0) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+62: tmp = (c * i) + (y * (x + ((a * b) / y))) elif (x * y) <= 200.0: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+62) tmp = Float64(Float64(c * i) + Float64(y * Float64(x + Float64(Float64(a * b) / y)))); elseif (Float64(x * y) <= 200.0) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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 ((x * y) <= -5e+62) tmp = (c * i) + (y * (x + ((a * b) / y))); elseif ((x * y) <= 200.0) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+62], N[(N[(c * i), $MachinePrecision] + N[(y * N[(x + N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200.0], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+62}:\\
\;\;\;\;c \cdot i + y \cdot \left(x + \frac{a \cdot b}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 200:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000029e62Initial program 92.3%
Taylor expanded in y around inf 95.1%
associate-/l*95.1%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in t around 0 82.5%
if -5.00000000000000029e62 < (*.f64 x y) < 200Initial program 97.2%
Taylor expanded in x around 0 94.6%
if 200 < (*.f64 x y) Initial program 97.2%
Taylor expanded in z around 0 89.3%
Final simplification91.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.4e+153) (not (<= (* c i) 1.2e+95))) (+ (* a b) (* c i)) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.4e+153) || !((c * i) <= 1.2e+95)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-1.4d+153)) .or. (.not. ((c * i) <= 1.2d+95))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.4e+153) || !((c * i) <= 1.2e+95)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.4e+153) or not ((c * i) <= 1.2e+95): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.4e+153) || !(Float64(c * i) <= 1.2e+95)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1.4e+153) || ~(((c * i) <= 1.2e+95))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.4e+153], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.2e+95]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+153} \lor \neg \left(c \cdot i \leq 1.2 \cdot 10^{+95}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -1.39999999999999993e153 or 1.2e95 < (*.f64 c i) Initial program 90.0%
Taylor expanded in y around inf 82.9%
associate-/l*80.4%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in a around inf 75.6%
if -1.39999999999999993e153 < (*.f64 c i) < 1.2e95Initial program 99.4%
Taylor expanded in x around 0 69.8%
Taylor expanded in c around 0 65.6%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1e+39) (not (<= (* c i) 1.58e+118))) (* 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) <= -1e+39) || !((c * i) <= 1.58e+118)) {
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) <= (-1d+39)) .or. (.not. ((c * i) <= 1.58d+118))) 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) <= -1e+39) || !((c * i) <= 1.58e+118)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1e+39) or not ((c * i) <= 1.58e+118): 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) <= -1e+39) || !(Float64(c * i) <= 1.58e+118)) 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) <= -1e+39) || ~(((c * i) <= 1.58e+118))) 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], -1e+39], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.58e+118]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 1.58 \cdot 10^{+118}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -9.9999999999999994e38 or 1.58000000000000002e118 < (*.f64 c i) Initial program 92.0%
Taylor expanded in c around inf 58.1%
if -9.9999999999999994e38 < (*.f64 c i) < 1.58000000000000002e118Initial program 99.3%
Taylor expanded in a around inf 39.4%
Final simplification46.7%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.5%
Taylor expanded in a around inf 30.6%
Final simplification30.6%
herbie shell --seed 2024078
(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)))