
(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 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma c i (fma a b (fma x y (* z t)))) (* x (+ (+ y (* a (/ b x))) (* t (/ z x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) + ((x * y) + (z * t))) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = x * ((y + (a * (b / x))) + (t * (z / x)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) <= Inf) tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = Float64(x * Float64(Float64(y + Float64(a * Float64(b / x))) + Float64(t * Float64(z / x)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + N[(a * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y + a \cdot \frac{b}{x}\right) + t \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.4%
+-commutative98.4%
fma-define99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
+-commutative0.0%
fma-define0.0%
+-commutative0.0%
fma-define25.0%
fma-define25.0%
Simplified25.0%
Taylor expanded in c around 0 0.0%
Taylor expanded in x around inf 0.0%
associate-/l*12.5%
Simplified12.5%
Taylor expanded in x around inf 62.5%
associate-+r+62.5%
associate-/l*87.5%
associate-*r/100.0%
Simplified100.0%
Final simplification99.2%
(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 95.3%
+-commutative95.3%
fma-define96.1%
associate-+l+96.1%
fma-define98.0%
fma-define98.0%
Simplified98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* a b) t_1)))
(if (<= (* a b) (- INFINITY))
(* x (+ (+ y (* a (/ b x))) (* t (/ z x))))
(if (<= (* a b) -2e+65)
t_2
(if (<= (* a b) 2e+37)
(+ (* c i) t_1)
(if (<= (* a b) 2e+121) (+ (* x y) (+ (* a b) (* c i))) 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) + (z * t);
double t_2 = (a * b) + t_1;
double tmp;
if ((a * b) <= -((double) INFINITY)) {
tmp = x * ((y + (a * (b / x))) + (t * (z / x)));
} else if ((a * b) <= -2e+65) {
tmp = t_2;
} else if ((a * b) <= 2e+37) {
tmp = (c * i) + t_1;
} else if ((a * b) <= 2e+121) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = t_2;
}
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;
double tmp;
if ((a * b) <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y + (a * (b / x))) + (t * (z / x)));
} else if ((a * b) <= -2e+65) {
tmp = t_2;
} else if ((a * b) <= 2e+37) {
tmp = (c * i) + t_1;
} else if ((a * b) <= 2e+121) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + t_1 tmp = 0 if (a * b) <= -math.inf: tmp = x * ((y + (a * (b / x))) + (t * (z / x))) elif (a * b) <= -2e+65: tmp = t_2 elif (a * b) <= 2e+37: tmp = (c * i) + t_1 elif (a * b) <= 2e+121: tmp = (x * y) + ((a * b) + (c * i)) else: tmp = t_2 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(a * b) + t_1) tmp = 0.0 if (Float64(a * b) <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y + Float64(a * Float64(b / x))) + Float64(t * Float64(z / x)))); elseif (Float64(a * b) <= -2e+65) tmp = t_2; elseif (Float64(a * b) <= 2e+37) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(a * b) <= 2e+121) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); else tmp = t_2; 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; tmp = 0.0; if ((a * b) <= -Inf) tmp = x * ((y + (a * (b / x))) + (t * (z / x))); elseif ((a * b) <= -2e+65) tmp = t_2; elseif ((a * b) <= 2e+37) tmp = (c * i) + t_1; elseif ((a * b) <= 2e+121) tmp = (x * y) + ((a * b) + (c * i)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], (-Infinity)], N[(x * N[(N[(y + N[(a * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e+65], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e+37], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+121], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + t\_1\\
\mathbf{if}\;a \cdot b \leq -\infty:\\
\;\;\;\;x \cdot \left(\left(y + a \cdot \frac{b}{x}\right) + t \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+37}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+121}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -inf.0Initial program 68.4%
+-commutative68.4%
fma-define68.4%
+-commutative68.4%
fma-define78.9%
fma-define78.9%
Simplified78.9%
Taylor expanded in c around 0 68.4%
Taylor expanded in x around inf 63.2%
associate-/l*63.2%
Simplified63.2%
Taylor expanded in x around inf 84.2%
associate-+r+84.2%
associate-/l*94.7%
associate-*r/94.7%
Simplified94.7%
if -inf.0 < (*.f64 a b) < -2e65 or 2.00000000000000007e121 < (*.f64 a b) Initial program 96.2%
+-commutative96.2%
fma-define97.4%
+-commutative97.4%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in c around 0 93.5%
if -2e65 < (*.f64 a b) < 1.99999999999999991e37Initial program 97.8%
+-commutative97.8%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in a around 0 94.4%
if 1.99999999999999991e37 < (*.f64 a b) < 2.00000000000000007e121Initial program 100.0%
associate-+l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 94.4%
Final simplification94.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* a b) t_1)))
(if (<= (* a b) (- INFINITY))
(* a b)
(if (<= (* a b) -1.45e+64)
t_2
(if (<= (* a b) 7.7e+37)
(+ (* c i) t_1)
(if (<= (* a b) 2.1e+125) (+ (* x y) (+ (* a b) (* c i))) 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) + (z * t);
double t_2 = (a * b) + t_1;
double tmp;
if ((a * b) <= -((double) INFINITY)) {
tmp = a * b;
} else if ((a * b) <= -1.45e+64) {
tmp = t_2;
} else if ((a * b) <= 7.7e+37) {
tmp = (c * i) + t_1;
} else if ((a * b) <= 2.1e+125) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = t_2;
}
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;
double tmp;
if ((a * b) <= -Double.POSITIVE_INFINITY) {
tmp = a * b;
} else if ((a * b) <= -1.45e+64) {
tmp = t_2;
} else if ((a * b) <= 7.7e+37) {
tmp = (c * i) + t_1;
} else if ((a * b) <= 2.1e+125) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + t_1 tmp = 0 if (a * b) <= -math.inf: tmp = a * b elif (a * b) <= -1.45e+64: tmp = t_2 elif (a * b) <= 7.7e+37: tmp = (c * i) + t_1 elif (a * b) <= 2.1e+125: tmp = (x * y) + ((a * b) + (c * i)) else: tmp = t_2 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(a * b) + t_1) tmp = 0.0 if (Float64(a * b) <= Float64(-Inf)) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.45e+64) tmp = t_2; elseif (Float64(a * b) <= 7.7e+37) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(a * b) <= 2.1e+125) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); else tmp = t_2; 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; tmp = 0.0; if ((a * b) <= -Inf) tmp = a * b; elseif ((a * b) <= -1.45e+64) tmp = t_2; elseif ((a * b) <= 7.7e+37) tmp = (c * i) + t_1; elseif ((a * b) <= 2.1e+125) tmp = (x * y) + ((a * b) + (c * i)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], (-Infinity)], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.45e+64], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 7.7e+37], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.1e+125], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + t\_1\\
\mathbf{if}\;a \cdot b \leq -\infty:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.45 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 7.7 \cdot 10^{+37}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{elif}\;a \cdot b \leq 2.1 \cdot 10^{+125}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -inf.0Initial program 68.4%
+-commutative68.4%
fma-define68.4%
+-commutative68.4%
fma-define78.9%
fma-define78.9%
Simplified78.9%
Taylor expanded in a around inf 89.5%
if -inf.0 < (*.f64 a b) < -1.44999999999999997e64 or 2.1000000000000001e125 < (*.f64 a b) Initial program 96.2%
+-commutative96.2%
fma-define97.4%
+-commutative97.4%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in c around 0 93.5%
if -1.44999999999999997e64 < (*.f64 a b) < 7.70000000000000022e37Initial program 97.8%
+-commutative97.8%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in a around 0 94.4%
if 7.70000000000000022e37 < (*.f64 a b) < 2.1000000000000001e125Initial program 100.0%
associate-+l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around inf 94.4%
Final simplification93.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -8.5e+121)
(* x y)
(if (<= (* x y) -5.5e+23)
(* c i)
(if (<= (* x y) -8e-298)
(* a b)
(if (<= (* x y) 0.0)
(* c i)
(if (<= (* x y) 5.5e+61) (* 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+121) {
tmp = x * y;
} else if ((x * y) <= -5.5e+23) {
tmp = c * i;
} else if ((x * y) <= -8e-298) {
tmp = a * b;
} else if ((x * y) <= 0.0) {
tmp = c * i;
} else if ((x * y) <= 5.5e+61) {
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+121)) then
tmp = x * y
else if ((x * y) <= (-5.5d+23)) then
tmp = c * i
else if ((x * y) <= (-8d-298)) then
tmp = a * b
else if ((x * y) <= 0.0d0) then
tmp = c * i
else if ((x * y) <= 5.5d+61) 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+121) {
tmp = x * y;
} else if ((x * y) <= -5.5e+23) {
tmp = c * i;
} else if ((x * y) <= -8e-298) {
tmp = a * b;
} else if ((x * y) <= 0.0) {
tmp = c * i;
} else if ((x * y) <= 5.5e+61) {
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+121: tmp = x * y elif (x * y) <= -5.5e+23: tmp = c * i elif (x * y) <= -8e-298: tmp = a * b elif (x * y) <= 0.0: tmp = c * i elif (x * y) <= 5.5e+61: 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+121) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.5e+23) tmp = Float64(c * i); elseif (Float64(x * y) <= -8e-298) tmp = Float64(a * b); elseif (Float64(x * y) <= 0.0) tmp = Float64(c * i); elseif (Float64(x * y) <= 5.5e+61) 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+121) tmp = x * y; elseif ((x * y) <= -5.5e+23) tmp = c * i; elseif ((x * y) <= -8e-298) tmp = a * b; elseif ((x * y) <= 0.0) tmp = c * i; elseif ((x * y) <= 5.5e+61) 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+121], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.5e+23], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -8e-298], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+61], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+121}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{+23}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq -8 \cdot 10^{-298}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+61}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.5e121 or 5.50000000000000036e61 < (*.f64 x y) Initial program 90.3%
+-commutative90.3%
fma-define91.4%
+-commutative91.4%
fma-define93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in c around 0 87.5%
Taylor expanded in x around inf 86.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 91.9%
associate-+r+91.9%
associate-/l*91.9%
associate-*r/92.9%
Simplified92.9%
Taylor expanded in y around inf 65.3%
if -8.5e121 < (*.f64 x y) < -5.50000000000000004e23 or -7.9999999999999993e-298 < (*.f64 x y) < 0.0Initial program 96.0%
+-commutative96.0%
fma-define98.0%
+-commutative98.0%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around inf 56.1%
if -5.50000000000000004e23 < (*.f64 x y) < -7.9999999999999993e-298 or 0.0 < (*.f64 x y) < 5.50000000000000036e61Initial program 99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in a around inf 47.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+145)
(* x (+ y (/ (* z t) x)))
(if (<= (* x y) -1e+27)
(+ (* x y) (* c i))
(if (<= (* x y) -2e-81)
(+ (* a b) (* z t))
(if (<= (* x y) 5e+57)
(+ (* a b) (* c i))
(* x (+ y (/ (* a b) x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+145) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= -1e+27) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= -2e-81) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e+57) {
tmp = (a * b) + (c * i);
} else {
tmp = x * (y + ((a * b) / x));
}
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) <= (-1d+145)) then
tmp = x * (y + ((z * t) / x))
else if ((x * y) <= (-1d+27)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= (-2d-81)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 5d+57) then
tmp = (a * b) + (c * i)
else
tmp = x * (y + ((a * b) / x))
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) <= -1e+145) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= -1e+27) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= -2e-81) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e+57) {
tmp = (a * b) + (c * i);
} else {
tmp = x * (y + ((a * b) / x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+145: tmp = x * (y + ((z * t) / x)) elif (x * y) <= -1e+27: tmp = (x * y) + (c * i) elif (x * y) <= -2e-81: tmp = (a * b) + (z * t) elif (x * y) <= 5e+57: tmp = (a * b) + (c * i) else: tmp = x * (y + ((a * b) / x)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+145) tmp = Float64(x * Float64(y + Float64(Float64(z * t) / x))); elseif (Float64(x * y) <= -1e+27) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= -2e-81) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 5e+57) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+145) tmp = x * (y + ((z * t) / x)); elseif ((x * y) <= -1e+27) tmp = (x * y) + (c * i); elseif ((x * y) <= -2e-81) tmp = (a * b) + (z * t); elseif ((x * y) <= 5e+57) tmp = (a * b) + (c * i); else tmp = x * (y + ((a * b) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+145], N[(x * N[(y + N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+27], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-81], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+57], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+27}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-81}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+57}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999999e144Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in c around 0 95.0%
Taylor expanded in x around inf 92.9%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in x around inf 95.0%
associate-+r+95.0%
associate-/l*95.0%
associate-*r/95.0%
Simplified95.0%
Taylor expanded in a around 0 84.6%
if -9.9999999999999999e144 < (*.f64 x y) < -1e27Initial program 95.2%
+-commutative95.2%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.8%
Taylor expanded in t around 0 81.2%
*-commutative81.2%
Simplified81.2%
if -1e27 < (*.f64 x y) < -1.9999999999999999e-81Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.2%
Taylor expanded in t around inf 81.7%
if -1.9999999999999999e-81 < (*.f64 x y) < 4.99999999999999972e57Initial program 98.3%
associate-+l+98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in x around inf 79.6%
Taylor expanded in x around 0 75.7%
if 4.99999999999999972e57 < (*.f64 x y) Initial program 82.9%
+-commutative82.9%
fma-define85.1%
+-commutative85.1%
fma-define89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in c around 0 80.3%
Taylor expanded in t around 0 64.2%
*-commutative67.1%
Simplified64.2%
Taylor expanded in x around inf 74.7%
Final simplification78.0%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* x (+ (+ y (* a (/ b x))) (* t (/ z x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((y + (a * (b / x))) + (t * (z / x)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((y + (a * (b / x))) + (t * (z / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((y + (a * (b / x))) + (t * (z / x))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(y + Float64(a * Float64(b / x))) + Float64(t * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x * ((y + (a * (b / x))) + (t * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(y + N[(a * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y + a \cdot \frac{b}{x}\right) + t \cdot \frac{z}{x}\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%
+-commutative0.0%
fma-define16.7%
+-commutative16.7%
fma-define33.3%
fma-define33.3%
Simplified33.3%
Taylor expanded in c around 0 16.7%
Taylor expanded in x around inf 16.7%
associate-/l*25.0%
Simplified25.0%
Taylor expanded in x around inf 58.3%
associate-+r+58.3%
associate-/l*75.0%
associate-*r/83.3%
Simplified83.3%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) (- INFINITY))
(* a b)
(if (or (<= (* a b) -1.02e+64) (not (<= (* a b) 1.6e+124)))
(+ (* a b) t_1)
(+ (* c i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -((double) INFINITY)) {
tmp = a * b;
} else if (((a * b) <= -1.02e+64) || !((a * b) <= 1.6e+124)) {
tmp = (a * b) + t_1;
} 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 tmp;
if ((a * b) <= -Double.POSITIVE_INFINITY) {
tmp = a * b;
} else if (((a * b) <= -1.02e+64) || !((a * b) <= 1.6e+124)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -math.inf: tmp = a * b elif ((a * b) <= -1.02e+64) or not ((a * b) <= 1.6e+124): tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= Float64(-Inf)) tmp = Float64(a * b); elseif ((Float64(a * b) <= -1.02e+64) || !(Float64(a * b) <= 1.6e+124)) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -Inf) tmp = a * b; elseif (((a * b) <= -1.02e+64) || ~(((a * b) <= 1.6e+124))) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], (-Infinity)], N[(a * b), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.02e+64], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.6e+124]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -\infty:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.02 \cdot 10^{+64} \lor \neg \left(a \cdot b \leq 1.6 \cdot 10^{+124}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -inf.0Initial program 68.4%
+-commutative68.4%
fma-define68.4%
+-commutative68.4%
fma-define78.9%
fma-define78.9%
Simplified78.9%
Taylor expanded in a around inf 89.5%
if -inf.0 < (*.f64 a b) < -1.01999999999999996e64 or 1.59999999999999996e124 < (*.f64 a b) Initial program 96.2%
+-commutative96.2%
fma-define97.4%
+-commutative97.4%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in c around 0 93.5%
if -1.01999999999999996e64 < (*.f64 a b) < 1.59999999999999996e124Initial program 98.1%
+-commutative98.1%
fma-define98.7%
+-commutative98.7%
fma-define98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in a around 0 91.7%
Final simplification92.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+27)
(+ (* x y) (* c i))
(if (<= (* x y) -2e-81)
(+ (* a b) (* z t))
(if (<= (* x y) 5e+57) (+ (* a b) (* c i)) (* x (+ y (/ (* a b) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+27) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= -2e-81) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e+57) {
tmp = (a * b) + (c * i);
} else {
tmp = x * (y + ((a * b) / x));
}
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) <= (-1d+27)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= (-2d-81)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 5d+57) then
tmp = (a * b) + (c * i)
else
tmp = x * (y + ((a * b) / x))
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) <= -1e+27) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= -2e-81) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e+57) {
tmp = (a * b) + (c * i);
} else {
tmp = x * (y + ((a * b) / x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+27: tmp = (x * y) + (c * i) elif (x * y) <= -2e-81: tmp = (a * b) + (z * t) elif (x * y) <= 5e+57: tmp = (a * b) + (c * i) else: tmp = x * (y + ((a * b) / x)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+27) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= -2e-81) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 5e+57) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+27) tmp = (x * y) + (c * i); elseif ((x * y) <= -2e-81) tmp = (a * b) + (z * t); elseif ((x * y) <= 5e+57) tmp = (a * b) + (c * i); else tmp = x * (y + ((a * b) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+27], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-81], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+57], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+27}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-81}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+57}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1e27Initial program 97.0%
+-commutative97.0%
fma-define98.5%
+-commutative98.5%
fma-define98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in a around 0 88.4%
Taylor expanded in t around 0 75.4%
*-commutative75.4%
Simplified75.4%
if -1e27 < (*.f64 x y) < -1.9999999999999999e-81Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.2%
Taylor expanded in t around inf 81.7%
if -1.9999999999999999e-81 < (*.f64 x y) < 4.99999999999999972e57Initial program 98.3%
associate-+l+98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in x around inf 79.6%
Taylor expanded in x around 0 75.7%
if 4.99999999999999972e57 < (*.f64 x y) Initial program 82.9%
+-commutative82.9%
fma-define85.1%
+-commutative85.1%
fma-define89.4%
fma-define89.4%
Simplified89.4%
Taylor expanded in c around 0 80.3%
Taylor expanded in t around 0 64.2%
*-commutative67.1%
Simplified64.2%
Taylor expanded in x around inf 74.7%
Final simplification75.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -6.5e+112)
t_1
(if (<= (* c i) -8.5e-164)
(+ (* a b) (* z t))
(if (<= (* c i) 3e+133) (+ (* a b) (* x y)) 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) + (c * i);
double tmp;
if ((c * i) <= -6.5e+112) {
tmp = t_1;
} else if ((c * i) <= -8.5e-164) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 3e+133) {
tmp = (a * b) + (x * y);
} 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) :: tmp
t_1 = (a * b) + (c * i)
if ((c * i) <= (-6.5d+112)) then
tmp = t_1
else if ((c * i) <= (-8.5d-164)) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 3d+133) then
tmp = (a * b) + (x * y)
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) + (c * i);
double tmp;
if ((c * i) <= -6.5e+112) {
tmp = t_1;
} else if ((c * i) <= -8.5e-164) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 3e+133) {
tmp = (a * b) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -6.5e+112: tmp = t_1 elif (c * i) <= -8.5e-164: tmp = (a * b) + (z * t) elif (c * i) <= 3e+133: tmp = (a * b) + (x * y) else: tmp = t_1 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) <= -6.5e+112) tmp = t_1; elseif (Float64(c * i) <= -8.5e-164) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 3e+133) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = t_1; 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) <= -6.5e+112) tmp = t_1; elseif ((c * i) <= -8.5e-164) tmp = (a * b) + (z * t); elseif ((c * i) <= 3e+133) tmp = (a * b) + (x * y); 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -6.5e+112], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -8.5e-164], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+133], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-164}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+133}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -6.4999999999999998e112 or 3.00000000000000007e133 < (*.f64 c i) Initial program 93.0%
associate-+l+93.0%
fma-define93.0%
Simplified93.0%
Taylor expanded in x around inf 88.0%
Taylor expanded in x around 0 81.4%
if -6.4999999999999998e112 < (*.f64 c i) < -8.50000000000000035e-164Initial program 94.0%
+-commutative94.0%
fma-define94.0%
+-commutative94.0%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around 0 88.2%
Taylor expanded in t around inf 68.2%
if -8.50000000000000035e-164 < (*.f64 c i) < 3.00000000000000007e133Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in c around 0 90.9%
Taylor expanded in t around 0 70.1%
*-commutative48.3%
Simplified70.1%
Final simplification73.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.42e+122)
(* x y)
(if (<= (* x y) 2.25e+52)
(+ (* a b) (* c i))
(if (<= (* x y) 2.3e+239) (+ (* a b) (* z t)) (* 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) <= -1.42e+122) {
tmp = x * y;
} else if ((x * y) <= 2.25e+52) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2.3e+239) {
tmp = (a * b) + (z * t);
} 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) <= (-1.42d+122)) then
tmp = x * y
else if ((x * y) <= 2.25d+52) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 2.3d+239) then
tmp = (a * b) + (z * t)
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) <= -1.42e+122) {
tmp = x * y;
} else if ((x * y) <= 2.25e+52) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2.3e+239) {
tmp = (a * b) + (z * t);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.42e+122: tmp = x * y elif (x * y) <= 2.25e+52: tmp = (a * b) + (c * i) elif (x * y) <= 2.3e+239: tmp = (a * b) + (z * t) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.42e+122) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.25e+52) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 2.3e+239) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) <= -1.42e+122) tmp = x * y; elseif ((x * y) <= 2.25e+52) tmp = (a * b) + (c * i); elseif ((x * y) <= 2.3e+239) tmp = (a * b) + (z * t); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.42e+122], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.25e+52], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.3e+239], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.42 \cdot 10^{+122}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+52}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.3 \cdot 10^{+239}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.42000000000000005e122 or 2.3000000000000002e239 < (*.f64 x y) Initial program 89.0%
+-commutative89.0%
fma-define89.0%
+-commutative89.0%
fma-define91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in c around 0 87.2%
Taylor expanded in x around inf 85.9%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in x around inf 92.7%
associate-+r+92.7%
associate-/l*95.5%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in y around inf 73.1%
if -1.42000000000000005e122 < (*.f64 x y) < 2.25e52Initial program 98.1%
associate-+l+98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in x around inf 77.7%
Taylor expanded in x around 0 71.1%
if 2.25e52 < (*.f64 x y) < 2.3000000000000002e239Initial program 95.8%
+-commutative95.8%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.5%
Taylor expanded in t around inf 56.8%
Final simplification70.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -6.2e+126) (not (<= (* c i) 5.6e+134))) (+ (* a b) (* 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) {
double tmp;
if (((c * i) <= -6.2e+126) || !((c * i) <= 5.6e+134)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-6.2d+126)) .or. (.not. ((c * i) <= 5.6d+134))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -6.2e+126) || !((c * i) <= 5.6e+134)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -6.2e+126) or not ((c * i) <= 5.6e+134): tmp = (a * b) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -6.2e+126) || !(Float64(c * i) <= 5.6e+134)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -6.2e+126) || ~(((c * i) <= 5.6e+134))) tmp = (a * b) + (c * i); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -6.2e+126], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.6e+134]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.2 \cdot 10^{+126} \lor \neg \left(c \cdot i \leq 5.6 \cdot 10^{+134}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -6.2e126 or 5.5999999999999997e134 < (*.f64 c i) Initial program 92.8%
associate-+l+92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in x around inf 88.0%
Taylor expanded in x around 0 83.5%
if -6.2e126 < (*.f64 c i) < 5.5999999999999997e134Initial program 96.5%
+-commutative96.5%
fma-define96.5%
+-commutative96.5%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in c around 0 89.7%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.25e+61)
(* a b)
(if (<= (* a b) 3e-163)
(* c i)
(if (<= (* a b) 1.02e+228) (* z t) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.25e+61) {
tmp = a * b;
} else if ((a * b) <= 3e-163) {
tmp = c * i;
} else if ((a * b) <= 1.02e+228) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.25d+61)) then
tmp = a * b
else if ((a * b) <= 3d-163) then
tmp = c * i
else if ((a * b) <= 1.02d+228) then
tmp = z * t
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.25e+61) {
tmp = a * b;
} else if ((a * b) <= 3e-163) {
tmp = c * i;
} else if ((a * b) <= 1.02e+228) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.25e+61: tmp = a * b elif (a * b) <= 3e-163: tmp = c * i elif (a * b) <= 1.02e+228: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.25e+61) tmp = Float64(a * b); elseif (Float64(a * b) <= 3e-163) tmp = Float64(c * i); elseif (Float64(a * b) <= 1.02e+228) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.25e+61) tmp = a * b; elseif ((a * b) <= 3e-163) tmp = c * i; elseif ((a * b) <= 1.02e+228) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.25e+61], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3e-163], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.02e+228], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+61}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3 \cdot 10^{-163}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.02 \cdot 10^{+228}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.25000000000000004e61 or 1.02e228 < (*.f64 a b) Initial program 89.5%
+-commutative89.5%
fma-define90.7%
+-commutative90.7%
fma-define93.0%
fma-define93.0%
Simplified93.0%
Taylor expanded in a around inf 70.6%
if -1.25000000000000004e61 < (*.f64 a b) < 3.0000000000000002e-163Initial program 98.2%
+-commutative98.2%
fma-define98.2%
+-commutative98.2%
fma-define98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in c around inf 42.1%
if 3.0000000000000002e-163 < (*.f64 a b) < 1.02e228Initial program 98.2%
+-commutative98.2%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 80.5%
Taylor expanded in t around inf 47.5%
Taylor expanded in a around 0 34.2%
Final simplification50.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.3e+65) (not (<= (* a b) 6.5e+94))) (+ (* a b) (* z t)) (+ (* x y) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.3e+65) || !((a * b) <= 6.5e+94)) {
tmp = (a * b) + (z * t);
} 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) :: tmp
if (((a * b) <= (-1.3d+65)) .or. (.not. ((a * b) <= 6.5d+94))) then
tmp = (a * b) + (z * t)
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 tmp;
if (((a * b) <= -1.3e+65) || !((a * b) <= 6.5e+94)) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.3e+65) or not ((a * b) <= 6.5e+94): tmp = (a * b) + (z * t) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.3e+65) || !(Float64(a * b) <= 6.5e+94)) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) tmp = 0.0; if (((a * b) <= -1.3e+65) || ~(((a * b) <= 6.5e+94))) tmp = (a * b) + (z * t); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.3e+65], N[Not[LessEqual[N[(a * b), $MachinePrecision], 6.5e+94]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.3 \cdot 10^{+65} \lor \neg \left(a \cdot b \leq 6.5 \cdot 10^{+94}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.30000000000000001e65 or 6.49999999999999976e94 < (*.f64 a b) Initial program 91.4%
+-commutative91.4%
fma-define92.4%
+-commutative92.4%
fma-define94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in c around 0 86.6%
Taylor expanded in t around inf 78.6%
if -1.30000000000000001e65 < (*.f64 a b) < 6.49999999999999976e94Initial program 98.0%
+-commutative98.0%
fma-define98.7%
+-commutative98.7%
fma-define98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in a around 0 93.3%
Taylor expanded in t around 0 71.4%
*-commutative71.4%
Simplified71.4%
Final simplification74.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.7e+122) (not (<= (* x y) 1.55e+64))) (* 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.7e+122) || !((x * y) <= 1.55e+64)) {
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.7d+122)) .or. (.not. ((x * y) <= 1.55d+64))) 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.7e+122) || !((x * y) <= 1.55e+64)) {
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.7e+122) or not ((x * y) <= 1.55e+64): 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.7e+122) || !(Float64(x * y) <= 1.55e+64)) 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.7e+122) || ~(((x * y) <= 1.55e+64))) 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.7e+122], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.55e+64]], $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.7 \cdot 10^{+122} \lor \neg \left(x \cdot y \leq 1.55 \cdot 10^{+64}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.7e122 or 1.55e64 < (*.f64 x y) Initial program 90.3%
+-commutative90.3%
fma-define91.4%
+-commutative91.4%
fma-define93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in c around 0 87.5%
Taylor expanded in x around inf 86.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 91.9%
associate-+r+91.9%
associate-/l*91.9%
associate-*r/92.9%
Simplified92.9%
Taylor expanded in y around inf 65.3%
if -1.7e122 < (*.f64 x y) < 1.55e64Initial program 98.1%
associate-+l+98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in x around inf 77.1%
Taylor expanded in x around 0 70.6%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.65e+65) (not (<= (* a b) 1.2e+93))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.65e+65) || !((a * b) <= 1.2e+93)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1.65d+65)) .or. (.not. ((a * b) <= 1.2d+93))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.65e+65) || !((a * b) <= 1.2e+93)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.65e+65) or not ((a * b) <= 1.2e+93): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.65e+65) || !(Float64(a * b) <= 1.2e+93)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.65e+65) || ~(((a * b) <= 1.2e+93))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.65e+65], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.2e+93]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.65 \cdot 10^{+65} \lor \neg \left(a \cdot b \leq 1.2 \cdot 10^{+93}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.65000000000000012e65 or 1.20000000000000005e93 < (*.f64 a b) Initial program 91.4%
+-commutative91.4%
fma-define92.4%
+-commutative92.4%
fma-define94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in a around inf 62.4%
if -1.65000000000000012e65 < (*.f64 a b) < 1.20000000000000005e93Initial program 98.0%
+-commutative98.0%
fma-define98.7%
+-commutative98.7%
fma-define98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around inf 37.8%
Final simplification47.9%
(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 95.3%
+-commutative95.3%
fma-define96.1%
+-commutative96.1%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in a around inf 29.6%
herbie shell --seed 2024143
(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)))