
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma x y (fma z t (fma a b (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(x, y, fma(z, t, fma(a, b, (c * i))));
}
function code(x, y, z, t, a, b, c, i) return fma(x, y, fma(z, t, fma(a, b, Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(x * y + N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Initial program 95.7%
associate-+l+95.7%
associate-+l+95.7%
fma-def96.9%
fma-def98.4%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(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-def96.1%
associate-+l+96.1%
fma-def96.9%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (fma c i (+ (+ (* a b) (* x y)) (* z t))) (fma z t (fma a b (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = fma(z, t, fma(a, b, (c * i)));
}
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 = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = fma(z, t, fma(a, b, Float64(c * i))); 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[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(a * b + N[(c * i), $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(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\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%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
+-commutative27.3%
fma-def36.4%
*-commutative36.4%
+-commutative36.4%
fma-def72.7%
Simplified72.7%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (fma c i (+ (+ (* a b) (* x y)) (* z t))) (fma c i (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = fma(c, i, (a * b));
}
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 = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = fma(c, i, Float64(a * b)); 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[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(a * b), $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(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, a \cdot b\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%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
Applied egg-rr100.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-def9.1%
associate-+l+9.1%
fma-def27.3%
fma-def54.5%
Simplified54.5%
fma-udef27.3%
fma-udef9.1%
associate-+l+9.1%
+-commutative9.1%
associate-+r+9.1%
Applied egg-rr9.1%
Taylor expanded in a around inf 55.1%
Final simplification98.1%
(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 (fma c i (* a b)))))
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 = fma(c, i, (a * b));
}
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 = fma(c, i, Float64(a * b)); end return 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 * i + N[(a * b), $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}:\\
\;\;\;\;\mathsf{fma}\left(c, i, a \cdot b\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-def9.1%
associate-+l+9.1%
fma-def27.3%
fma-def54.5%
Simplified54.5%
fma-udef27.3%
fma-udef9.1%
associate-+l+9.1%
+-commutative9.1%
associate-+r+9.1%
Applied egg-rr9.1%
Taylor expanded in a around inf 55.1%
Final simplification98.1%
(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)))))
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);
}
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);
}
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) 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(Float64(c * i) + Float64(a * b)); 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); 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[(N[(c * i), $MachinePrecision] + N[(a * b), $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 i + a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around inf 55.1%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* a b))))
(if (<= (* a b) -5.2e+58)
t_1
(if (<= (* a b) 4.8e-77)
(+ (* c i) (* z t))
(if (or (<= (* a b) 2.1e+15) (not (<= (* a b) 1.05e+80)))
(+ (* 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 = (c * i) + (a * b);
double tmp;
if ((a * b) <= -5.2e+58) {
tmp = t_1;
} else if ((a * b) <= 4.8e-77) {
tmp = (c * i) + (z * t);
} else if (((a * b) <= 2.1e+15) || !((a * b) <= 1.05e+80)) {
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 = (c * i) + (a * b)
if ((a * b) <= (-5.2d+58)) then
tmp = t_1
else if ((a * b) <= 4.8d-77) then
tmp = (c * i) + (z * t)
else if (((a * b) <= 2.1d+15) .or. (.not. ((a * b) <= 1.05d+80))) 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 = (c * i) + (a * b);
double tmp;
if ((a * b) <= -5.2e+58) {
tmp = t_1;
} else if ((a * b) <= 4.8e-77) {
tmp = (c * i) + (z * t);
} else if (((a * b) <= 2.1e+15) || !((a * b) <= 1.05e+80)) {
tmp = (a * b) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (a * b) tmp = 0 if (a * b) <= -5.2e+58: tmp = t_1 elif (a * b) <= 4.8e-77: tmp = (c * i) + (z * t) elif ((a * b) <= 2.1e+15) or not ((a * b) <= 1.05e+80): 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(c * i) + Float64(a * b)) tmp = 0.0 if (Float64(a * b) <= -5.2e+58) tmp = t_1; elseif (Float64(a * b) <= 4.8e-77) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif ((Float64(a * b) <= 2.1e+15) || !(Float64(a * b) <= 1.05e+80)) 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 = (c * i) + (a * b); tmp = 0.0; if ((a * b) <= -5.2e+58) tmp = t_1; elseif ((a * b) <= 4.8e-77) tmp = (c * i) + (z * t); elseif (((a * b) <= 2.1e+15) || ~(((a * b) <= 1.05e+80))) 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[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5.2e+58], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 4.8e-77], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 2.1e+15], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.05e+80]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.1 \cdot 10^{+15} \lor \neg \left(a \cdot b \leq 1.05 \cdot 10^{+80}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.19999999999999976e58 or 2.1e15 < (*.f64 a b) < 1.05000000000000001e80Initial program 92.6%
Taylor expanded in a around inf 82.8%
if -5.19999999999999976e58 < (*.f64 a b) < 4.7999999999999998e-77Initial program 97.8%
Taylor expanded in z around inf 68.2%
if 4.7999999999999998e-77 < (*.f64 a b) < 2.1e15 or 1.05000000000000001e80 < (*.f64 a b) Initial program 94.4%
Taylor expanded in z around 0 84.4%
Taylor expanded in c around 0 75.4%
Final simplification73.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.9e+186)
(* a b)
(if (or (<= (* a b) -1.7e+108)
(and (not (<= (* a b) -3600000000000.0)) (<= (* a b) 4.6e-16)))
(* c i)
(* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.9e+186) {
tmp = a * b;
} else if (((a * b) <= -1.7e+108) || (!((a * b) <= -3600000000000.0) && ((a * b) <= 4.6e-16))) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.9d+186)) then
tmp = a * b
else if (((a * b) <= (-1.7d+108)) .or. (.not. ((a * b) <= (-3600000000000.0d0))) .and. ((a * b) <= 4.6d-16)) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.9e+186) {
tmp = a * b;
} else if (((a * b) <= -1.7e+108) || (!((a * b) <= -3600000000000.0) && ((a * b) <= 4.6e-16))) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.9e+186: tmp = a * b elif ((a * b) <= -1.7e+108) or (not ((a * b) <= -3600000000000.0) and ((a * b) <= 4.6e-16)): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.9e+186) tmp = Float64(a * b); elseif ((Float64(a * b) <= -1.7e+108) || (!(Float64(a * b) <= -3600000000000.0) && (Float64(a * b) <= 4.6e-16))) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.9e+186) tmp = a * b; elseif (((a * b) <= -1.7e+108) || (~(((a * b) <= -3600000000000.0)) && ((a * b) <= 4.6e-16))) tmp = c * i; 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.9e+186], N[(a * b), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.7e+108], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], -3600000000000.0]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 4.6e-16]]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.9 \cdot 10^{+186}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.7 \cdot 10^{+108} \lor \neg \left(a \cdot b \leq -3600000000000\right) \land a \cdot b \leq 4.6 \cdot 10^{-16}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.8999999999999999e186 or -1.69999999999999998e108 < (*.f64 a b) < -3.6e12 or 4.5999999999999998e-16 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 85.1%
Taylor expanded in c around 0 74.2%
Taylor expanded in a around inf 64.2%
if -1.8999999999999999e186 < (*.f64 a b) < -1.69999999999999998e108 or -3.6e12 < (*.f64 a b) < 4.5999999999999998e-16Initial program 97.3%
Taylor expanded in c around inf 34.8%
Final simplification47.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -4.1e+243)
(+ (* c i) (* x y))
(if (or (<= x -2e+45) (and (not (<= x -290000.0)) (<= x 4.2e-77)))
(+ (* c i) (+ (* a b) (* z t)))
(+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -4.1e+243) {
tmp = (c * i) + (x * y);
} else if ((x <= -2e+45) || (!(x <= -290000.0) && (x <= 4.2e-77))) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (x <= (-4.1d+243)) then
tmp = (c * i) + (x * y)
else if ((x <= (-2d+45)) .or. (.not. (x <= (-290000.0d0))) .and. (x <= 4.2d-77)) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -4.1e+243) {
tmp = (c * i) + (x * y);
} else if ((x <= -2e+45) || (!(x <= -290000.0) && (x <= 4.2e-77))) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -4.1e+243: tmp = (c * i) + (x * y) elif (x <= -2e+45) or (not (x <= -290000.0) and (x <= 4.2e-77)): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -4.1e+243) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif ((x <= -2e+45) || (!(x <= -290000.0) && (x <= 4.2e-77))) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -4.1e+243) tmp = (c * i) + (x * y); elseif ((x <= -2e+45) || (~((x <= -290000.0)) && (x <= 4.2e-77))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -4.1e+243], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2e+45], And[N[Not[LessEqual[x, -290000.0]], $MachinePrecision], LessEqual[x, 4.2e-77]]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+243}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \leq -2 \cdot 10^{+45} \lor \neg \left(x \leq -290000\right) \land x \leq 4.2 \cdot 10^{-77}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if x < -4.10000000000000008e243Initial program 84.6%
Taylor expanded in x around inf 92.3%
if -4.10000000000000008e243 < x < -1.9999999999999999e45 or -2.9e5 < x < 4.20000000000000031e-77Initial program 96.8%
Taylor expanded in x around 0 87.2%
if -1.9999999999999999e45 < x < -2.9e5 or 4.20000000000000031e-77 < x Initial program 95.2%
Taylor expanded in z around 0 80.9%
Taylor expanded in c around 0 66.4%
Final simplification80.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.8e+58) (not (<= (* a b) 4.1e-44))) (+ (* c i) (+ (* a b) (* x y))) (+ (* 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) <= -2.8e+58) || !((a * b) <= 4.1e-44)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= (-2.8d+58)) .or. (.not. ((a * b) <= 4.1d-44))) then
tmp = (c * i) + ((a * b) + (x * y))
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) <= -2.8e+58) || !((a * b) <= 4.1e-44)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= -2.8e+58) or not ((a * b) <= 4.1e-44): tmp = (c * i) + ((a * b) + (x * y)) 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) <= -2.8e+58) || !(Float64(a * b) <= 4.1e-44)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); 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) <= -2.8e+58) || ~(((a * b) <= 4.1e-44))) tmp = (c * i) + ((a * b) + (x * y)); 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], -2.8e+58], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.1e-44]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $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 -2.8 \cdot 10^{+58} \lor \neg \left(a \cdot b \leq 4.1 \cdot 10^{-44}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.7999999999999998e58 or 4.09999999999999992e-44 < (*.f64 a b) Initial program 93.1%
Taylor expanded in z around 0 88.6%
if -2.7999999999999998e58 < (*.f64 a b) < 4.09999999999999992e-44Initial program 97.8%
Taylor expanded in a around 0 96.5%
Final simplification92.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.68e+65) (not (<= (* c i) 1.1e+44))) (+ (* c i) (* a b)) (+ (* 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 (((c * i) <= -1.68e+65) || !((c * i) <= 1.1e+44)) {
tmp = (c * i) + (a * b);
} 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 (((c * i) <= (-1.68d+65)) .or. (.not. ((c * i) <= 1.1d+44))) then
tmp = (c * i) + (a * b)
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 (((c * i) <= -1.68e+65) || !((c * i) <= 1.1e+44)) {
tmp = (c * i) + (a * b);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.68e+65) or not ((c * i) <= 1.1e+44): tmp = (c * i) + (a * b) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.68e+65) || !(Float64(c * i) <= 1.1e+44)) tmp = Float64(Float64(c * i) + Float64(a * b)); 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 (((c * i) <= -1.68e+65) || ~(((c * i) <= 1.1e+44))) tmp = (c * i) + (a * b); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.68e+65], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.1e+44]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.68 \cdot 10^{+65} \lor \neg \left(c \cdot i \leq 1.1 \cdot 10^{+44}\right):\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -1.68e65 or 1.09999999999999998e44 < (*.f64 c i) Initial program 93.2%
Taylor expanded in a around inf 72.9%
if -1.68e65 < (*.f64 c i) < 1.09999999999999998e44Initial program 97.4%
Taylor expanded in z around 0 70.4%
Taylor expanded in c around 0 64.2%
Final simplification67.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -1.9e+25) (not (<= t 4.1e+133))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.9e+25) || !(t <= 4.1e+133)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-1.9d+25)) .or. (.not. (t <= 4.1d+133))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.9e+25) || !(t <= 4.1e+133)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -1.9e+25) or not (t <= 4.1e+133): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -1.9e+25) || !(t <= 4.1e+133)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -1.9e+25) || ~((t <= 4.1e+133))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -1.9e+25], N[Not[LessEqual[t, 4.1e+133]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+25} \lor \neg \left(t \leq 4.1 \cdot 10^{+133}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if t < -1.9e25 or 4.10000000000000004e133 < t Initial program 93.1%
Taylor expanded in x around 0 79.9%
if -1.9e25 < t < 4.10000000000000004e133Initial program 97.0%
Taylor expanded in z around 0 86.2%
Final simplification84.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -3.6e+26)
(* z t)
(if (<= t -4.5e-129)
(* x y)
(if (<= t 2.7e-199)
(* a b)
(if (<= t 1.95e-95) (* c i) (if (<= t 5.5e+117) (* 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 (t <= -3.6e+26) {
tmp = z * t;
} else if (t <= -4.5e-129) {
tmp = x * y;
} else if (t <= 2.7e-199) {
tmp = a * b;
} else if (t <= 1.95e-95) {
tmp = c * i;
} else if (t <= 5.5e+117) {
tmp = x * y;
} 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 (t <= (-3.6d+26)) then
tmp = z * t
else if (t <= (-4.5d-129)) then
tmp = x * y
else if (t <= 2.7d-199) then
tmp = a * b
else if (t <= 1.95d-95) then
tmp = c * i
else if (t <= 5.5d+117) then
tmp = x * y
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 (t <= -3.6e+26) {
tmp = z * t;
} else if (t <= -4.5e-129) {
tmp = x * y;
} else if (t <= 2.7e-199) {
tmp = a * b;
} else if (t <= 1.95e-95) {
tmp = c * i;
} else if (t <= 5.5e+117) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -3.6e+26: tmp = z * t elif t <= -4.5e-129: tmp = x * y elif t <= 2.7e-199: tmp = a * b elif t <= 1.95e-95: tmp = c * i elif t <= 5.5e+117: tmp = x * y else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -3.6e+26) tmp = Float64(z * t); elseif (t <= -4.5e-129) tmp = Float64(x * y); elseif (t <= 2.7e-199) tmp = Float64(a * b); elseif (t <= 1.95e-95) tmp = Float64(c * i); elseif (t <= 5.5e+117) tmp = Float64(x * y); 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 (t <= -3.6e+26) tmp = z * t; elseif (t <= -4.5e-129) tmp = x * y; elseif (t <= 2.7e-199) tmp = a * b; elseif (t <= 1.95e-95) tmp = c * i; elseif (t <= 5.5e+117) tmp = x * y; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -3.6e+26], N[(z * t), $MachinePrecision], If[LessEqual[t, -4.5e-129], N[(x * y), $MachinePrecision], If[LessEqual[t, 2.7e-199], N[(a * b), $MachinePrecision], If[LessEqual[t, 1.95e-95], N[(c * i), $MachinePrecision], If[LessEqual[t, 5.5e+117], N[(x * y), $MachinePrecision], N[(z * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+26}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-129}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-199}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-95}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+117}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -3.60000000000000024e26 or 5.49999999999999965e117 < t Initial program 93.3%
Taylor expanded in z around inf 62.3%
*-commutative62.3%
fma-def62.3%
Applied egg-rr62.3%
Taylor expanded in z around inf 52.9%
if -3.60000000000000024e26 < t < -4.50000000000000031e-129 or 1.95e-95 < t < 5.49999999999999965e117Initial program 95.9%
Taylor expanded in z around 0 85.1%
Taylor expanded in c around 0 62.9%
Taylor expanded in a around 0 41.3%
if -4.50000000000000031e-129 < t < 2.69999999999999989e-199Initial program 98.4%
Taylor expanded in z around 0 89.9%
Taylor expanded in c around 0 64.0%
Taylor expanded in a around inf 41.6%
if 2.69999999999999989e-199 < t < 1.95e-95Initial program 96.5%
Taylor expanded in c around inf 49.0%
Final simplification46.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -6e-80)
(* a b)
(if (<= b -3.1e-156)
(* c i)
(if (<= b 1.52e-139) (* z t) (if (<= b 6e+87) (* c i) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -6e-80) {
tmp = a * b;
} else if (b <= -3.1e-156) {
tmp = c * i;
} else if (b <= 1.52e-139) {
tmp = z * t;
} else if (b <= 6e+87) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (b <= (-6d-80)) then
tmp = a * b
else if (b <= (-3.1d-156)) then
tmp = c * i
else if (b <= 1.52d-139) then
tmp = z * t
else if (b <= 6d+87) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -6e-80) {
tmp = a * b;
} else if (b <= -3.1e-156) {
tmp = c * i;
} else if (b <= 1.52e-139) {
tmp = z * t;
} else if (b <= 6e+87) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if b <= -6e-80: tmp = a * b elif b <= -3.1e-156: tmp = c * i elif b <= 1.52e-139: tmp = z * t elif b <= 6e+87: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -6e-80) tmp = Float64(a * b); elseif (b <= -3.1e-156) tmp = Float64(c * i); elseif (b <= 1.52e-139) tmp = Float64(z * t); elseif (b <= 6e+87) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (b <= -6e-80) tmp = a * b; elseif (b <= -3.1e-156) tmp = c * i; elseif (b <= 1.52e-139) tmp = z * t; elseif (b <= 6e+87) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -6e-80], N[(a * b), $MachinePrecision], If[LessEqual[b, -3.1e-156], N[(c * i), $MachinePrecision], If[LessEqual[b, 1.52e-139], N[(z * t), $MachinePrecision], If[LessEqual[b, 6e+87], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-80}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-156}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;b \leq 1.52 \cdot 10^{-139}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+87}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -6.00000000000000014e-80 or 5.9999999999999998e87 < b Initial program 93.5%
Taylor expanded in z around 0 77.5%
Taylor expanded in c around 0 61.3%
Taylor expanded in a around inf 44.7%
if -6.00000000000000014e-80 < b < -3.0999999999999998e-156 or 1.51999999999999999e-139 < b < 5.9999999999999998e87Initial program 97.2%
Taylor expanded in c around inf 35.1%
if -3.0999999999999998e-156 < b < 1.51999999999999999e-139Initial program 98.4%
Taylor expanded in z around inf 60.2%
*-commutative60.2%
fma-def60.2%
Applied egg-rr60.2%
Taylor expanded in z around inf 36.3%
Final simplification40.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -1.5e+265) (* x y) (+ (* c i) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.5e+265) {
tmp = x * y;
} else {
tmp = (c * i) + (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (x <= (-1.5d+265)) then
tmp = x * y
else
tmp = (c * i) + (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.5e+265) {
tmp = x * y;
} else {
tmp = (c * i) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -1.5e+265: tmp = x * y else: tmp = (c * i) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -1.5e+265) tmp = Float64(x * y); else tmp = Float64(Float64(c * i) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -1.5e+265) tmp = x * y; else tmp = (c * i) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -1.5e+265], N[(x * y), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+265}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\end{array}
\end{array}
if x < -1.50000000000000001e265Initial program 80.0%
Taylor expanded in z around 0 80.0%
Taylor expanded in c around 0 80.0%
Taylor expanded in a around 0 90.0%
if -1.50000000000000001e265 < x Initial program 96.3%
Taylor expanded in a around inf 54.6%
Final simplification55.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%
Taylor expanded in z around 0 74.7%
Taylor expanded in c around 0 52.4%
Taylor expanded in a around inf 29.5%
Final simplification29.5%
herbie shell --seed 2023268
(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)))