
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma a b (fma x y (fma c i (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(a, b, fma(x, y, fma(c, i, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(a, b, fma(x, y, fma(c, i, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b + N[(x * y + N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
associate-+l+96.5%
fma-def98.8%
associate-+l+98.8%
fma-def99.2%
+-commutative99.2%
fma-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (+ (* a b) t_1) (* c i)))) (if (<= t_2 INFINITY) t_2 (+ (* c i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = ((a * b) + t_1) + (c * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (c * i) + t_1;
}
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 = (x * y) + (z * t);
double t_2 = ((a * b) + t_1) + (c * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = ((a * b) + t_1) + (c * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(Float64(a * b) + t_1) + Float64(c * i)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = ((a * b) + t_1) + (c * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := \left(a \cdot b + t_1\right) + c \cdot i\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 66.7%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.4e+98)
(* c i)
(if (<= (* c i) -1.75e-183)
(* z t)
(if (<= (* c i) 0.0)
(* a b)
(if (<= (* c i) 2.05e-38)
(* z t)
(if (<= (* c i) 5.7e+76) (* 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) <= -1.4e+98) {
tmp = c * i;
} else if ((c * i) <= -1.75e-183) {
tmp = z * t;
} else if ((c * i) <= 0.0) {
tmp = a * b;
} else if ((c * i) <= 2.05e-38) {
tmp = z * t;
} else if ((c * i) <= 5.7e+76) {
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) <= (-1.4d+98)) then
tmp = c * i
else if ((c * i) <= (-1.75d-183)) then
tmp = z * t
else if ((c * i) <= 0.0d0) then
tmp = a * b
else if ((c * i) <= 2.05d-38) then
tmp = z * t
else if ((c * i) <= 5.7d+76) 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) <= -1.4e+98) {
tmp = c * i;
} else if ((c * i) <= -1.75e-183) {
tmp = z * t;
} else if ((c * i) <= 0.0) {
tmp = a * b;
} else if ((c * i) <= 2.05e-38) {
tmp = z * t;
} else if ((c * i) <= 5.7e+76) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.4e+98: tmp = c * i elif (c * i) <= -1.75e-183: tmp = z * t elif (c * i) <= 0.0: tmp = a * b elif (c * i) <= 2.05e-38: tmp = z * t elif (c * i) <= 5.7e+76: 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) <= -1.4e+98) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.75e-183) tmp = Float64(z * t); elseif (Float64(c * i) <= 0.0) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.05e-38) tmp = Float64(z * t); elseif (Float64(c * i) <= 5.7e+76) 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) <= -1.4e+98) tmp = c * i; elseif ((c * i) <= -1.75e-183) tmp = z * t; elseif ((c * i) <= 0.0) tmp = a * b; elseif ((c * i) <= 2.05e-38) tmp = z * t; elseif ((c * i) <= 5.7e+76) 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], -1.4e+98], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.75e-183], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 0.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.05e-38], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5.7e+76], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+98}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.75 \cdot 10^{-183}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.05 \cdot 10^{-38}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 5.7 \cdot 10^{+76}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.4e98 or 5.70000000000000004e76 < (*.f64 c i) Initial program 94.7%
Taylor expanded in c around inf 74.4%
if -1.4e98 < (*.f64 c i) < -1.74999999999999996e-183 or -0.0 < (*.f64 c i) < 2.0499999999999999e-38Initial program 97.7%
+-commutative97.7%
fma-def97.7%
associate-+l+97.7%
fma-def98.9%
fma-def98.9%
Simplified98.9%
fma-udef97.7%
fma-udef97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r+97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 39.3%
if -1.74999999999999996e-183 < (*.f64 c i) < -0.0 or 2.0499999999999999e-38 < (*.f64 c i) < 5.70000000000000004e76Initial program 97.3%
Taylor expanded in z around 0 81.1%
Taylor expanded in a around inf 46.5%
Final simplification54.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -7.5e+139)
(* x y)
(if (<= (* x y) -7.8e+29)
(+ (* a b) (* z t))
(if (<= (* x y) -8.2e+27)
(* x y)
(if (<= (* x y) 3e+140) (+ (* a b) (* c i)) (+ (* x y) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -7.5e+139) {
tmp = x * y;
} else if ((x * y) <= -7.8e+29) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= -8.2e+27) {
tmp = x * y;
} else if ((x * y) <= 3e+140) {
tmp = (a * b) + (c * i);
} else {
tmp = (x * y) + (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 ((x * y) <= (-7.5d+139)) then
tmp = x * y
else if ((x * y) <= (-7.8d+29)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= (-8.2d+27)) then
tmp = x * y
else if ((x * y) <= 3d+140) then
tmp = (a * b) + (c * i)
else
tmp = (x * y) + (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 ((x * y) <= -7.5e+139) {
tmp = x * y;
} else if ((x * y) <= -7.8e+29) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= -8.2e+27) {
tmp = x * y;
} else if ((x * y) <= 3e+140) {
tmp = (a * b) + (c * i);
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -7.5e+139: tmp = x * y elif (x * y) <= -7.8e+29: tmp = (a * b) + (z * t) elif (x * y) <= -8.2e+27: tmp = x * y elif (x * y) <= 3e+140: tmp = (a * b) + (c * i) else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -7.5e+139) tmp = Float64(x * y); elseif (Float64(x * y) <= -7.8e+29) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= -8.2e+27) tmp = Float64(x * y); elseif (Float64(x * y) <= 3e+140) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -7.5e+139) tmp = x * y; elseif ((x * y) <= -7.8e+29) tmp = (a * b) + (z * t); elseif ((x * y) <= -8.2e+27) tmp = x * y; elseif ((x * y) <= 3e+140) tmp = (a * b) + (c * i); else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.5e+139], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -7.8e+29], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -8.2e+27], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e+140], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+139}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -7.8 \cdot 10^{+29}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{+27}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{+140}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -7.49999999999999992e139 or -7.79999999999999937e29 < (*.f64 x y) < -8.2000000000000005e27Initial program 93.3%
Taylor expanded in z around 0 86.6%
Taylor expanded in x around inf 82.6%
if -7.49999999999999992e139 < (*.f64 x y) < -7.79999999999999937e29Initial program 95.2%
Taylor expanded in x around 0 90.5%
*-commutative90.5%
fma-def95.3%
*-commutative95.3%
Applied egg-rr95.3%
Taylor expanded in c around 0 76.8%
if -8.2000000000000005e27 < (*.f64 x y) < 2.99999999999999997e140Initial program 98.7%
Taylor expanded in a around inf 66.8%
if 2.99999999999999997e140 < (*.f64 x y) Initial program 92.1%
Taylor expanded in z around 0 92.1%
Taylor expanded in c around 0 85.1%
Final simplification73.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))) (t_2 (+ (* c i) (* z t))))
(if (<= (* c i) -33000000.0)
t_2
(if (<= (* c i) 9.5e-300)
t_1
(if (<= (* c i) 7e-220)
(+ (* a b) (* z t))
(if (<= (* c i) 8.5e+138) 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 = (x * y) + (a * b);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -33000000.0) {
tmp = t_2;
} else if ((c * i) <= 9.5e-300) {
tmp = t_1;
} else if ((c * i) <= 7e-220) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 8.5e+138) {
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 = (x * y) + (a * b)
t_2 = (c * i) + (z * t)
if ((c * i) <= (-33000000.0d0)) then
tmp = t_2
else if ((c * i) <= 9.5d-300) then
tmp = t_1
else if ((c * i) <= 7d-220) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 8.5d+138) 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 = (x * y) + (a * b);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -33000000.0) {
tmp = t_2;
} else if ((c * i) <= 9.5e-300) {
tmp = t_1;
} else if ((c * i) <= 7e-220) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 8.5e+138) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) t_2 = (c * i) + (z * t) tmp = 0 if (c * i) <= -33000000.0: tmp = t_2 elif (c * i) <= 9.5e-300: tmp = t_1 elif (c * i) <= 7e-220: tmp = (a * b) + (z * t) elif (c * i) <= 8.5e+138: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -33000000.0) tmp = t_2; elseif (Float64(c * i) <= 9.5e-300) tmp = t_1; elseif (Float64(c * i) <= 7e-220) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 8.5e+138) 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 = (x * y) + (a * b); t_2 = (c * i) + (z * t); tmp = 0.0; if ((c * i) <= -33000000.0) tmp = t_2; elseif ((c * i) <= 9.5e-300) tmp = t_1; elseif ((c * i) <= 7e-220) tmp = (a * b) + (z * t); elseif ((c * i) <= 8.5e+138) 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[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -33000000.0], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 9.5e-300], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 7e-220], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.5e+138], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -33000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 7 \cdot 10^{-220}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 c i) < -3.3e7 or 8.5000000000000006e138 < (*.f64 c i) Initial program 95.0%
Taylor expanded in z around inf 83.9%
if -3.3e7 < (*.f64 c i) < 9.5000000000000007e-300 or 6.99999999999999975e-220 < (*.f64 c i) < 8.5000000000000006e138Initial program 97.3%
Taylor expanded in z around 0 75.9%
Taylor expanded in c around 0 70.3%
if 9.5000000000000007e-300 < (*.f64 c i) < 6.99999999999999975e-220Initial program 100.0%
Taylor expanded in x around 0 92.8%
*-commutative92.8%
fma-def92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in c around 0 80.1%
Final simplification75.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= (* c i) -33000000.0)
(+ (* c i) (* z t))
(if (<= (* c i) 8.5e-300)
t_1
(if (<= (* c i) 1.05e-220)
(+ (* a b) (* z t))
(if (<= (* c i) 2.7e+75) t_1 (+ (* x y) (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -33000000.0) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 8.5e-300) {
tmp = t_1;
} else if ((c * i) <= 1.05e-220) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2.7e+75) {
tmp = t_1;
} else {
tmp = (x * y) + (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) :: t_1
real(8) :: tmp
t_1 = (x * y) + (a * b)
if ((c * i) <= (-33000000.0d0)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 8.5d-300) then
tmp = t_1
else if ((c * i) <= 1.05d-220) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 2.7d+75) then
tmp = t_1
else
tmp = (x * y) + (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 t_1 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -33000000.0) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 8.5e-300) {
tmp = t_1;
} else if ((c * i) <= 1.05e-220) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2.7e+75) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) tmp = 0 if (c * i) <= -33000000.0: tmp = (c * i) + (z * t) elif (c * i) <= 8.5e-300: tmp = t_1 elif (c * i) <= 1.05e-220: tmp = (a * b) + (z * t) elif (c * i) <= 2.7e+75: tmp = t_1 else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(c * i) <= -33000000.0) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 8.5e-300) tmp = t_1; elseif (Float64(c * i) <= 1.05e-220) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 2.7e+75) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (a * b); tmp = 0.0; if ((c * i) <= -33000000.0) tmp = (c * i) + (z * t); elseif ((c * i) <= 8.5e-300) tmp = t_1; elseif ((c * i) <= 1.05e-220) tmp = (a * b) + (z * t); elseif ((c * i) <= 2.7e+75) tmp = t_1; else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -33000000.0], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.5e-300], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.05e-220], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.7e+75], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -33000000:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{-220}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.3e7Initial program 96.9%
Taylor expanded in z around inf 82.2%
if -3.3e7 < (*.f64 c i) < 8.4999999999999995e-300 or 1.04999999999999996e-220 < (*.f64 c i) < 2.69999999999999998e75Initial program 97.1%
Taylor expanded in z around 0 75.7%
Taylor expanded in c around 0 71.6%
if 8.4999999999999995e-300 < (*.f64 c i) < 1.04999999999999996e-220Initial program 100.0%
Taylor expanded in x around 0 92.8%
*-commutative92.8%
fma-def92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in c around 0 80.1%
if 2.69999999999999998e75 < (*.f64 c i) Initial program 93.5%
Taylor expanded in x around inf 85.2%
Final simplification76.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -6.8e+139)
(+ (* x y) (* c i))
(if (<= (* x y) 2.5e+140)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* x y) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.8e+139) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 2.5e+140) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (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 ((x * y) <= (-6.8d+139)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= 2.5d+140) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (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 ((x * y) <= -6.8e+139) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 2.5e+140) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -6.8e+139: tmp = (x * y) + (c * i) elif (x * y) <= 2.5e+140: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -6.8e+139) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= 2.5e+140) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -6.8e+139) tmp = (x * y) + (c * i); elseif ((x * y) <= 2.5e+140) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.8e+139], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+140], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.8 \cdot 10^{+139}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+140}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -6.8000000000000005e139Initial program 92.7%
Taylor expanded in x around inf 92.8%
if -6.8000000000000005e139 < (*.f64 x y) < 2.50000000000000004e140Initial program 98.3%
Taylor expanded in x around 0 90.5%
if 2.50000000000000004e140 < (*.f64 x y) Initial program 92.1%
Taylor expanded in z around 0 92.1%
Taylor expanded in c around 0 85.1%
Final simplification90.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.75e+139)
(+ (* x y) (* c i))
(if (<= (* x y) 7.5e+139)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* x y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.75e+139) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 7.5e+139) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (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 ((x * y) <= (-1.75d+139)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= 7.5d+139) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (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 ((x * y) <= -1.75e+139) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 7.5e+139) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.75e+139: tmp = (x * y) + (c * i) elif (x * y) <= 7.5e+139: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (a * b)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.75e+139) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= 7.5e+139) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1.75e+139) tmp = (x * y) + (c * i); elseif ((x * y) <= 7.5e+139) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.75e+139], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.5e+139], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.75 \cdot 10^{+139}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+139}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.74999999999999989e139Initial program 92.7%
Taylor expanded in x around inf 92.8%
if -1.74999999999999989e139 < (*.f64 x y) < 7.49999999999999992e139Initial program 98.3%
Taylor expanded in x around 0 90.5%
if 7.49999999999999992e139 < (*.f64 x y) Initial program 92.1%
Taylor expanded in z around 0 92.1%
Final simplification91.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4.1e+138)
(+ (* c i) (+ (* x y) (* z t)))
(if (<= (* x y) 6.8e+139)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* x y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4.1e+138) {
tmp = (c * i) + ((x * y) + (z * t));
} else if ((x * y) <= 6.8e+139) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (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 ((x * y) <= (-4.1d+138)) then
tmp = (c * i) + ((x * y) + (z * t))
else if ((x * y) <= 6.8d+139) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (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 ((x * y) <= -4.1e+138) {
tmp = (c * i) + ((x * y) + (z * t));
} else if ((x * y) <= 6.8e+139) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4.1e+138: tmp = (c * i) + ((x * y) + (z * t)) elif (x * y) <= 6.8e+139: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (a * b)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4.1e+138) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); elseif (Float64(x * y) <= 6.8e+139) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -4.1e+138) tmp = (c * i) + ((x * y) + (z * t)); elseif ((x * y) <= 6.8e+139) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.1e+138], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.8e+139], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.1 \cdot 10^{+138}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{+139}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0999999999999998e138Initial program 92.7%
Taylor expanded in a around 0 100.0%
if -4.0999999999999998e138 < (*.f64 x y) < 6.8000000000000005e139Initial program 98.3%
Taylor expanded in x around 0 90.5%
if 6.8000000000000005e139 < (*.f64 x y) Initial program 92.1%
Taylor expanded in z around 0 92.1%
Final simplification92.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -3.8e+138)
(* x y)
(if (<= (* x y) -5.9e+46)
(* a b)
(if (<= (* x y) 3.4e+131) (* 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) <= -3.8e+138) {
tmp = x * y;
} else if ((x * y) <= -5.9e+46) {
tmp = a * b;
} else if ((x * y) <= 3.4e+131) {
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) <= (-3.8d+138)) then
tmp = x * y
else if ((x * y) <= (-5.9d+46)) then
tmp = a * b
else if ((x * y) <= 3.4d+131) 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) <= -3.8e+138) {
tmp = x * y;
} else if ((x * y) <= -5.9e+46) {
tmp = a * b;
} else if ((x * y) <= 3.4e+131) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -3.8e+138: tmp = x * y elif (x * y) <= -5.9e+46: tmp = a * b elif (x * y) <= 3.4e+131: 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) <= -3.8e+138) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.9e+46) tmp = Float64(a * b); elseif (Float64(x * y) <= 3.4e+131) 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) <= -3.8e+138) tmp = x * y; elseif ((x * y) <= -5.9e+46) tmp = a * b; elseif ((x * y) <= 3.4e+131) 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], -3.8e+138], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.9e+46], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e+131], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+138}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.9 \cdot 10^{+46}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{+131}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.80000000000000012e138 or 3.39999999999999986e131 < (*.f64 x y) Initial program 92.6%
Taylor expanded in z around 0 87.7%
Taylor expanded in x around inf 73.9%
if -3.80000000000000012e138 < (*.f64 x y) < -5.8999999999999999e46Initial program 93.3%
Taylor expanded in z around 0 67.6%
Taylor expanded in a around inf 54.0%
if -5.8999999999999999e46 < (*.f64 x y) < 3.39999999999999986e131Initial program 98.7%
Taylor expanded in c around inf 42.9%
Final simplification53.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.04e+139) (not (<= (* x y) 3.6e+141))) (* 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) <= -1.04e+139) || !((x * y) <= 3.6e+141)) {
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) <= (-1.04d+139)) .or. (.not. ((x * y) <= 3.6d+141))) 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) <= -1.04e+139) || !((x * y) <= 3.6e+141)) {
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) <= -1.04e+139) or not ((x * y) <= 3.6e+141): 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) <= -1.04e+139) || !(Float64(x * y) <= 3.6e+141)) 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) <= -1.04e+139) || ~(((x * y) <= 3.6e+141))) 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], -1.04e+139], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.6e+141]], $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 -1.04 \cdot 10^{+139} \lor \neg \left(x \cdot y \leq 3.6 \cdot 10^{+141}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.04e139 or 3.6000000000000001e141 < (*.f64 x y) Initial program 92.4%
Taylor expanded in z around 0 88.7%
Taylor expanded in x around inf 75.8%
if -1.04e139 < (*.f64 x y) < 3.6000000000000001e141Initial program 98.3%
Taylor expanded in a around inf 65.4%
Final simplification68.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -950000.0) (not (<= (* c i) 9.5e+75))) (* 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) <= -950000.0) || !((c * i) <= 9.5e+75)) {
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) <= (-950000.0d0)) .or. (.not. ((c * i) <= 9.5d+75))) 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) <= -950000.0) || !((c * i) <= 9.5e+75)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -950000.0) or not ((c * i) <= 9.5e+75): 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) <= -950000.0) || !(Float64(c * i) <= 9.5e+75)) 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) <= -950000.0) || ~(((c * i) <= 9.5e+75))) 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], -950000.0], N[Not[LessEqual[N[(c * i), $MachinePrecision], 9.5e+75]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -950000 \lor \neg \left(c \cdot i \leq 9.5 \cdot 10^{+75}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -9.5e5 or 9.50000000000000061e75 < (*.f64 c i) Initial program 95.5%
Taylor expanded in c around inf 66.9%
if -9.5e5 < (*.f64 c i) < 9.50000000000000061e75Initial program 97.2%
Taylor expanded in z around 0 73.4%
Taylor expanded in a around inf 34.0%
Final simplification48.2%
(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 z around 0 78.0%
Taylor expanded in a around inf 24.1%
Final simplification24.1%
herbie shell --seed 2023318
(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)))