
(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 (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* c (+ i (/ (* a b) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = c * (i + ((a * b) / c));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(c * Float64(i + Float64(Float64(a * b) / c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(i + N[(N[(a * b), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(i + \frac{a \cdot b}{c}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 99.9%
associate-+l+99.9%
fma-define100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
fma-define0.0%
Simplified0.0%
Taylor expanded in x around inf 27.3%
Taylor expanded in x around 0 46.4%
Taylor expanded in c around inf 55.5%
Final simplification98.0%
(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.7%
+-commutative95.7%
fma-define96.4%
associate-+l+96.4%
fma-define96.8%
fma-define97.2%
Simplified97.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 95.7%
+-commutative95.7%
fma-define96.4%
+-commutative96.4%
fma-define97.2%
fma-define97.2%
Simplified97.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* a b) -5e+69)
(+ (* a b) (* z t))
(if (<= (* a b) -1e-91)
(+ (* x y) (* z t))
(if (<= (* a b) -5e-209)
t_1
(if (<= (* a b) 1e-308)
(+ (* x y) (* c i))
(if (<= (* a b) 1e-6) t_1 (+ (* a b) (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -5e+69) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= -1e-91) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= -5e-209) {
tmp = t_1;
} else if ((a * b) <= 1e-308) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1e-6) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if ((a * b) <= (-5d+69)) then
tmp = (a * b) + (z * t)
else if ((a * b) <= (-1d-91)) then
tmp = (x * y) + (z * t)
else if ((a * b) <= (-5d-209)) then
tmp = t_1
else if ((a * b) <= 1d-308) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 1d-6) then
tmp = t_1
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -5e+69) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= -1e-91) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= -5e-209) {
tmp = t_1;
} else if ((a * b) <= 1e-308) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1e-6) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if (a * b) <= -5e+69: tmp = (a * b) + (z * t) elif (a * b) <= -1e-91: tmp = (x * y) + (z * t) elif (a * b) <= -5e-209: tmp = t_1 elif (a * b) <= 1e-308: tmp = (x * y) + (c * i) elif (a * b) <= 1e-6: tmp = t_1 else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+69) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(a * b) <= -1e-91) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= -5e-209) tmp = t_1; elseif (Float64(a * b) <= 1e-308) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 1e-6) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); tmp = 0.0; if ((a * b) <= -5e+69) tmp = (a * b) + (z * t); elseif ((a * b) <= -1e-91) tmp = (x * y) + (z * t); elseif ((a * b) <= -5e-209) tmp = t_1; elseif ((a * b) <= 1e-308) tmp = (x * y) + (c * i); elseif ((a * b) <= 1e-6) tmp = t_1; else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+69], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-91], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -5e-209], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-308], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-6], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+69}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-91}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-308}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000036e69Initial program 95.1%
+-commutative95.1%
fma-define97.6%
+-commutative97.6%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.3%
Taylor expanded in t around inf 79.5%
if -5.00000000000000036e69 < (*.f64 a b) < -1.00000000000000002e-91Initial program 97.0%
+-commutative97.0%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 95.1%
Taylor expanded in c around 0 78.5%
if -1.00000000000000002e-91 < (*.f64 a b) < -5.0000000000000005e-209 or 9.9999999999999991e-309 < (*.f64 a b) < 9.99999999999999955e-7Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 98.1%
Taylor expanded in x around 0 83.0%
if -5.0000000000000005e-209 < (*.f64 a b) < 9.9999999999999991e-309Initial program 94.1%
associate-+l+94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in x around inf 75.9%
Taylor expanded in a around 0 75.9%
if 9.99999999999999955e-7 < (*.f64 a b) Initial program 93.1%
+-commutative93.1%
fma-define93.1%
+-commutative93.1%
fma-define94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in c around 0 83.8%
Taylor expanded in t around 0 74.4%
Final simplification77.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.78e+68)
(* a b)
(if (<= (* a b) -4e-227)
(* z t)
(if (<= (* a b) 3.5e-308)
(* x y)
(if (<= (* a b) 1.7e-20)
(* z t)
(if (<= (* a b) 1.55e+116) (* x y) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.78e+68) {
tmp = a * b;
} else if ((a * b) <= -4e-227) {
tmp = z * t;
} else if ((a * b) <= 3.5e-308) {
tmp = x * y;
} else if ((a * b) <= 1.7e-20) {
tmp = z * t;
} else if ((a * b) <= 1.55e+116) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.78d+68)) then
tmp = a * b
else if ((a * b) <= (-4d-227)) then
tmp = z * t
else if ((a * b) <= 3.5d-308) then
tmp = x * y
else if ((a * b) <= 1.7d-20) then
tmp = z * t
else if ((a * b) <= 1.55d+116) then
tmp = x * y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.78e+68) {
tmp = a * b;
} else if ((a * b) <= -4e-227) {
tmp = z * t;
} else if ((a * b) <= 3.5e-308) {
tmp = x * y;
} else if ((a * b) <= 1.7e-20) {
tmp = z * t;
} else if ((a * b) <= 1.55e+116) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.78e+68: tmp = a * b elif (a * b) <= -4e-227: tmp = z * t elif (a * b) <= 3.5e-308: tmp = x * y elif (a * b) <= 1.7e-20: tmp = z * t elif (a * b) <= 1.55e+116: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.78e+68) tmp = Float64(a * b); elseif (Float64(a * b) <= -4e-227) tmp = Float64(z * t); elseif (Float64(a * b) <= 3.5e-308) tmp = Float64(x * y); elseif (Float64(a * b) <= 1.7e-20) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.55e+116) tmp = Float64(x * y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.78e+68) tmp = a * b; elseif ((a * b) <= -4e-227) tmp = z * t; elseif ((a * b) <= 3.5e-308) tmp = x * y; elseif ((a * b) <= 1.7e-20) tmp = z * t; elseif ((a * b) <= 1.55e+116) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.78e+68], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4e-227], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.5e-308], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.7e-20], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.55e+116], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.78 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-227}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.7 \cdot 10^{-20}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{+116}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.77999999999999997e68 or 1.54999999999999998e116 < (*.f64 a b) Initial program 93.5%
+-commutative93.5%
fma-define94.5%
+-commutative94.5%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in a around inf 69.8%
if -1.77999999999999997e68 < (*.f64 a b) < -3.99999999999999978e-227 or 3.5e-308 < (*.f64 a b) < 1.6999999999999999e-20Initial program 98.8%
+-commutative98.8%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in c around 0 69.8%
Taylor expanded in t around inf 47.5%
Taylor expanded in a around 0 45.7%
if -3.99999999999999978e-227 < (*.f64 a b) < 3.5e-308 or 1.6999999999999999e-20 < (*.f64 a b) < 1.54999999999999998e116Initial program 94.5%
associate-+l+94.5%
fma-define94.6%
Simplified94.6%
Taylor expanded in x around inf 77.9%
Taylor expanded in a around 0 71.6%
Taylor expanded in c around 0 48.1%
Final simplification55.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* a b) -3.5e+68)
(+ (* a b) (* z t))
(if (<= (* a b) -1.9e-210)
t_1
(if (<= (* a b) 1.2e-308)
(+ (* x y) (* c i))
(if (<= (* a b) 3.8e-6) t_1 (+ (* a b) (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -3.5e+68) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= -1.9e-210) {
tmp = t_1;
} else if ((a * b) <= 1.2e-308) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 3.8e-6) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if ((a * b) <= (-3.5d+68)) then
tmp = (a * b) + (z * t)
else if ((a * b) <= (-1.9d-210)) then
tmp = t_1
else if ((a * b) <= 1.2d-308) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 3.8d-6) then
tmp = t_1
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -3.5e+68) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= -1.9e-210) {
tmp = t_1;
} else if ((a * b) <= 1.2e-308) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 3.8e-6) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if (a * b) <= -3.5e+68: tmp = (a * b) + (z * t) elif (a * b) <= -1.9e-210: tmp = t_1 elif (a * b) <= 1.2e-308: tmp = (x * y) + (c * i) elif (a * b) <= 3.8e-6: tmp = t_1 else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -3.5e+68) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(a * b) <= -1.9e-210) tmp = t_1; elseif (Float64(a * b) <= 1.2e-308) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 3.8e-6) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); tmp = 0.0; if ((a * b) <= -3.5e+68) tmp = (a * b) + (z * t); elseif ((a * b) <= -1.9e-210) tmp = t_1; elseif ((a * b) <= 1.2e-308) tmp = (x * y) + (c * i); elseif ((a * b) <= 3.8e-6) tmp = t_1; else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.5e+68], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.9e-210], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.2e-308], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.8e-6], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -3.5 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -1.9 \cdot 10^{-210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-308}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -3.49999999999999977e68Initial program 95.1%
+-commutative95.1%
fma-define97.6%
+-commutative97.6%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.3%
Taylor expanded in t around inf 79.5%
if -3.49999999999999977e68 < (*.f64 a b) < -1.90000000000000002e-210 or 1.1999999999999998e-308 < (*.f64 a b) < 3.8e-6Initial program 98.8%
+-commutative98.8%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 96.9%
Taylor expanded in x around 0 73.9%
if -1.90000000000000002e-210 < (*.f64 a b) < 1.1999999999999998e-308Initial program 94.1%
associate-+l+94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in x around inf 75.9%
Taylor expanded in a around 0 75.9%
if 3.8e-6 < (*.f64 a b) Initial program 93.1%
+-commutative93.1%
fma-define93.1%
+-commutative93.1%
fma-define94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in c around 0 83.8%
Taylor expanded in t around 0 74.4%
Final simplification75.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* c (+ i (/ (* a b) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = c * (i + ((a * b) / c));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = c * (i + ((a * b) / c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = c * (i + ((a * b) / c)) 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(c * Float64(i + Float64(Float64(a * b) / c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = c * (i + ((a * b) / c)); 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[(c * N[(i + N[(N[(a * b), $MachinePrecision] / c), $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}:\\
\;\;\;\;c \cdot \left(i + \frac{a \cdot b}{c}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 99.9%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
fma-define0.0%
Simplified0.0%
Taylor expanded in x around inf 27.3%
Taylor expanded in x around 0 46.4%
Taylor expanded in c around inf 55.5%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -5e+69) (not (<= (* a b) 5e+51))) (* b (+ a (+ (/ (* z t) b) (/ (* x y) b)))) (+ (* c i) (+ (* 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 (((a * b) <= -5e+69) || !((a * b) <= 5e+51)) {
tmp = b * (a + (((z * t) / b) + ((x * y) / b)));
} else {
tmp = (c * i) + ((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 (((a * b) <= (-5d+69)) .or. (.not. ((a * b) <= 5d+51))) then
tmp = b * (a + (((z * t) / b) + ((x * y) / b)))
else
tmp = (c * i) + ((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 (((a * b) <= -5e+69) || !((a * b) <= 5e+51)) {
tmp = b * (a + (((z * t) / b) + ((x * y) / b)));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -5e+69) or not ((a * b) <= 5e+51): tmp = b * (a + (((z * t) / b) + ((x * y) / b))) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -5e+69) || !(Float64(a * b) <= 5e+51)) tmp = Float64(b * Float64(a + Float64(Float64(Float64(z * t) / b) + Float64(Float64(x * y) / b)))); else tmp = Float64(Float64(c * i) + 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 (((a * b) <= -5e+69) || ~(((a * b) <= 5e+51))) tmp = b * (a + (((z * t) / b) + ((x * y) / b))); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+69], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+51]], $MachinePrecision]], N[(b * N[(a + N[(N[(N[(z * t), $MachinePrecision] / b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+69} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+51}\right):\\
\;\;\;\;b \cdot \left(a + \left(\frac{z \cdot t}{b} + \frac{x \cdot y}{b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000036e69 or 5e51 < (*.f64 a b) Initial program 93.1%
+-commutative93.1%
fma-define94.1%
+-commutative94.1%
fma-define96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in c around 0 85.9%
Taylor expanded in b around inf 86.0%
if -5.00000000000000036e69 < (*.f64 a b) < 5e51Initial program 97.3%
+-commutative97.3%
fma-define98.0%
+-commutative98.0%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in a around 0 94.2%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -4.6e+91)
t_1
(if (<= (* c i) 1e-308)
(+ (* a b) (* z t))
(if (<= (* c i) 2.5e+111) (+ (* 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) <= -4.6e+91) {
tmp = t_1;
} else if ((c * i) <= 1e-308) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2.5e+111) {
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) <= (-4.6d+91)) then
tmp = t_1
else if ((c * i) <= 1d-308) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 2.5d+111) 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) <= -4.6e+91) {
tmp = t_1;
} else if ((c * i) <= 1e-308) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 2.5e+111) {
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) <= -4.6e+91: tmp = t_1 elif (c * i) <= 1e-308: tmp = (a * b) + (z * t) elif (c * i) <= 2.5e+111: 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) <= -4.6e+91) tmp = t_1; elseif (Float64(c * i) <= 1e-308) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 2.5e+111) 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) <= -4.6e+91) tmp = t_1; elseif ((c * i) <= 1e-308) tmp = (a * b) + (z * t); elseif ((c * i) <= 2.5e+111) 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], -4.6e+91], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1e-308], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.5e+111], 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 -4.6 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{-308}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -4.59999999999999982e91 or 2.4999999999999998e111 < (*.f64 c i) Initial program 90.8%
associate-+l+90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in x around inf 82.3%
Taylor expanded in x around 0 73.8%
if -4.59999999999999982e91 < (*.f64 c i) < 9.9999999999999991e-309Initial program 97.1%
+-commutative97.1%
fma-define97.1%
+-commutative97.1%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around 0 93.3%
Taylor expanded in t around inf 69.4%
if 9.9999999999999991e-309 < (*.f64 c i) < 2.4999999999999998e111Initial program 99.9%
+-commutative99.9%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 91.2%
Taylor expanded in t around 0 73.0%
Final simplification71.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -5e+69) (not (<= (* a b) 1e-6)))
(+ (* 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) <= -5e+69) || !((a * b) <= 1e-6)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (((a * b) <= (-5d+69)) .or. (.not. ((a * b) <= 1d-6))) then
tmp = (a * b) + t_1
else
tmp = (c * i) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) <= -5e+69) || !((a * b) <= 1e-6)) {
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) <= -5e+69) or not ((a * b) <= 1e-6): 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) <= -5e+69) || !(Float64(a * b) <= 1e-6)) 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) <= -5e+69) || ~(((a * b) <= 1e-6))) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+69], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-6]], $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 -5 \cdot 10^{+69} \lor \neg \left(a \cdot b \leq 10^{-6}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000036e69 or 9.99999999999999955e-7 < (*.f64 a b) Initial program 93.8%
+-commutative93.8%
fma-define94.7%
+-commutative94.7%
fma-define96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in c around 0 84.7%
if -5.00000000000000036e69 < (*.f64 a b) < 9.99999999999999955e-7Initial program 97.1%
+-commutative97.1%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.9%
Simplified97.9%
Taylor expanded in a around 0 95.9%
Final simplification90.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2e+140) (not (<= (* c i) 5e+100))) (* c (+ i (/ (* a b) c))) (+ (* 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) <= -2e+140) || !((c * i) <= 5e+100)) {
tmp = c * (i + ((a * b) / c));
} 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) <= (-2d+140)) .or. (.not. ((c * i) <= 5d+100))) then
tmp = c * (i + ((a * b) / c))
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) <= -2e+140) || !((c * i) <= 5e+100)) {
tmp = c * (i + ((a * b) / c));
} 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) <= -2e+140) or not ((c * i) <= 5e+100): tmp = c * (i + ((a * b) / c)) 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) <= -2e+140) || !(Float64(c * i) <= 5e+100)) tmp = Float64(c * Float64(i + Float64(Float64(a * b) / c))); 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) <= -2e+140) || ~(((c * i) <= 5e+100))) tmp = c * (i + ((a * b) / c)); 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], -2e+140], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5e+100]], $MachinePrecision]], N[(c * N[(i + N[(N[(a * b), $MachinePrecision] / c), $MachinePrecision]), $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 -2 \cdot 10^{+140} \lor \neg \left(c \cdot i \leq 5 \cdot 10^{+100}\right):\\
\;\;\;\;c \cdot \left(i + \frac{a \cdot b}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -2.00000000000000012e140 or 4.9999999999999999e100 < (*.f64 c i) Initial program 89.7%
associate-+l+89.7%
fma-define89.7%
Simplified89.7%
Taylor expanded in x around inf 81.5%
Taylor expanded in x around 0 75.5%
Taylor expanded in c around inf 76.8%
if -2.00000000000000012e140 < (*.f64 c i) < 4.9999999999999999e100Initial program 98.3%
+-commutative98.3%
fma-define98.3%
+-commutative98.3%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in c around 0 91.8%
Final simplification87.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7.5e+94) (not (<= (* c i) 7.6e+99))) (+ (* a b) (* c i)) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -7.5e+94) || !((c * i) <= 7.6e+99)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-7.5d+94)) .or. (.not. ((c * i) <= 7.6d+99))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -7.5e+94) || !((c * i) <= 7.6e+99)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -7.5e+94) or not ((c * i) <= 7.6e+99): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -7.5e+94) || !(Float64(c * i) <= 7.6e+99)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -7.5e+94) || ~(((c * i) <= 7.6e+99))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -7.5e+94], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.6e+99]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7.5 \cdot 10^{+94} \lor \neg \left(c \cdot i \leq 7.6 \cdot 10^{+99}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -7.49999999999999978e94 or 7.6e99 < (*.f64 c i) Initial program 90.9%
associate-+l+90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in x around inf 82.5%
Taylor expanded in x around 0 73.0%
if -7.49999999999999978e94 < (*.f64 c i) < 7.6e99Initial program 98.1%
+-commutative98.1%
fma-define98.2%
+-commutative98.2%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in c around 0 92.4%
Taylor expanded in t around inf 64.6%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.35e+131) (not (<= (* x y) 2.3e+119))) (* 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.35e+131) || !((x * y) <= 2.3e+119)) {
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.35d+131)) .or. (.not. ((x * y) <= 2.3d+119))) 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.35e+131) || !((x * y) <= 2.3e+119)) {
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.35e+131) or not ((x * y) <= 2.3e+119): 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.35e+131) || !(Float64(x * y) <= 2.3e+119)) 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.35e+131) || ~(((x * y) <= 2.3e+119))) 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.35e+131], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.3e+119]], $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.35 \cdot 10^{+131} \lor \neg \left(x \cdot y \leq 2.3 \cdot 10^{+119}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35000000000000002e131 or 2.3000000000000001e119 < (*.f64 x y) Initial program 89.9%
associate-+l+89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in x around inf 80.8%
Taylor expanded in a around 0 75.0%
Taylor expanded in c around 0 67.5%
if -1.35000000000000002e131 < (*.f64 x y) < 2.3000000000000001e119Initial program 98.2%
associate-+l+98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in x around inf 70.7%
Taylor expanded in x around 0 64.4%
Final simplification65.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -2.3e+69) (+ (* a b) (* z t)) (if (<= (* a b) 0.00044) (+ (* c i) (* z t)) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.3e+69) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 0.00044) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.3d+69)) then
tmp = (a * b) + (z * t)
else if ((a * b) <= 0.00044d0) then
tmp = (c * i) + (z * t)
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.3e+69) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 0.00044) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.3e+69: tmp = (a * b) + (z * t) elif (a * b) <= 0.00044: tmp = (c * i) + (z * t) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.3e+69) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(a * b) <= 0.00044) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.3e+69) tmp = (a * b) + (z * t); elseif ((a * b) <= 0.00044) tmp = (c * i) + (z * t); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.3e+69], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 0.00044], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+69}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 0.00044:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -2.30000000000000017e69Initial program 95.1%
+-commutative95.1%
fma-define97.6%
+-commutative97.6%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 86.3%
Taylor expanded in t around inf 79.5%
if -2.30000000000000017e69 < (*.f64 a b) < 4.40000000000000016e-4Initial program 97.1%
+-commutative97.1%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.9%
Simplified97.9%
Taylor expanded in a around 0 95.9%
Taylor expanded in x around 0 68.2%
if 4.40000000000000016e-4 < (*.f64 a b) Initial program 93.1%
+-commutative93.1%
fma-define93.1%
+-commutative93.1%
fma-define94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in c around 0 83.8%
Taylor expanded in t around 0 74.4%
Final simplification71.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.45e+67) (not (<= (* a b) 2.4e+83))) (* a b) (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.45e+67) || !((a * b) <= 2.4e+83)) {
tmp = a * b;
} else {
tmp = 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 (((a * b) <= (-1.45d+67)) .or. (.not. ((a * b) <= 2.4d+83))) then
tmp = a * b
else
tmp = 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 (((a * b) <= -1.45e+67) || !((a * b) <= 2.4e+83)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.45e+67) or not ((a * b) <= 2.4e+83): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.45e+67) || !(Float64(a * b) <= 2.4e+83)) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.45e+67) || ~(((a * b) <= 2.4e+83))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.45e+67], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.4e+83]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.45 \cdot 10^{+67} \lor \neg \left(a \cdot b \leq 2.4 \cdot 10^{+83}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -1.45000000000000012e67 or 2.39999999999999991e83 < (*.f64 a b) Initial program 92.8%
+-commutative92.8%
fma-define93.9%
+-commutative93.9%
fma-define95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around inf 67.7%
if -1.45000000000000012e67 < (*.f64 a b) < 2.39999999999999991e83Initial program 97.4%
+-commutative97.4%
fma-define98.0%
+-commutative98.0%
fma-define98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in c around 0 69.8%
Taylor expanded in t around inf 39.6%
Taylor expanded in a around 0 36.7%
Final simplification48.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -5e+38) (not (<= (* a b) 4.6e+83))) (* 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) <= -5e+38) || !((a * b) <= 4.6e+83)) {
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) <= (-5d+38)) .or. (.not. ((a * b) <= 4.6d+83))) 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) <= -5e+38) || !((a * b) <= 4.6e+83)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -5e+38) or not ((a * b) <= 4.6e+83): 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) <= -5e+38) || !(Float64(a * b) <= 4.6e+83)) 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) <= -5e+38) || ~(((a * b) <= 4.6e+83))) 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], -5e+38], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.6e+83]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+38} \lor \neg \left(a \cdot b \leq 4.6 \cdot 10^{+83}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999997e38 or 4.5999999999999999e83 < (*.f64 a b) Initial program 93.1%
+-commutative93.1%
fma-define94.0%
+-commutative94.0%
fma-define96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in a around inf 65.8%
if -4.9999999999999997e38 < (*.f64 a b) < 4.5999999999999999e83Initial program 97.3%
+-commutative97.3%
fma-define98.0%
+-commutative98.0%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around inf 33.0%
Final simplification45.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.7%
+-commutative95.7%
fma-define96.4%
+-commutative96.4%
fma-define97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in a around inf 28.9%
herbie shell --seed 2024172
(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)))