
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* t (+ z (+ (* x (/ y t)) (* a (/ b t))))))))
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 = t * (z + ((x * (y / t)) + (a * (b / t))));
}
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 = t * (z + ((x * (y / t)) + (a * (b / t))));
}
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 = t * (z + ((x * (y / t)) + (a * (b / t)))) 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(t * Float64(z + Float64(Float64(x * Float64(y / t)) + Float64(a * Float64(b / t))))); 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 = t * (z + ((x * (y / t)) + (a * (b / t)))); 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[(t * N[(z + N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z + \left(x \cdot \frac{y}{t} + a \cdot \frac{b}{t}\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%
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-define30.0%
+-commutative30.0%
fma-define60.0%
fma-define70.0%
Simplified70.0%
Taylor expanded in c around 0 30.0%
Taylor expanded in t around inf 50.0%
+-commutative50.0%
associate-/l*60.0%
associate-/l*80.0%
Simplified80.0%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define97.2%
+-commutative97.2%
fma-define98.4%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -2e+274)
(* a (+ b (/ (* x y) a)))
(if (<= (* a b) -2e+70)
(+ (* a b) (+ (* c i) (* z t)))
(if (<= (* a b) 500000.0) (+ (* c i) t_1) (+ (* a b) 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) <= -2e+274) {
tmp = a * (b + ((x * y) / a));
} else if ((a * b) <= -2e+70) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((a * b) <= 500000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + 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) <= (-2d+274)) then
tmp = a * (b + ((x * y) / a))
else if ((a * b) <= (-2d+70)) then
tmp = (a * b) + ((c * i) + (z * t))
else if ((a * b) <= 500000.0d0) then
tmp = (c * i) + t_1
else
tmp = (a * b) + 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) <= -2e+274) {
tmp = a * (b + ((x * y) / a));
} else if ((a * b) <= -2e+70) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((a * b) <= 500000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + 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) <= -2e+274: tmp = a * (b + ((x * y) / a)) elif (a * b) <= -2e+70: tmp = (a * b) + ((c * i) + (z * t)) elif (a * b) <= 500000.0: tmp = (c * i) + t_1 else: tmp = (a * b) + 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) <= -2e+274) tmp = Float64(a * Float64(b + Float64(Float64(x * y) / a))); elseif (Float64(a * b) <= -2e+70) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); elseif (Float64(a * b) <= 500000.0) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + 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) <= -2e+274) tmp = a * (b + ((x * y) / a)); elseif ((a * b) <= -2e+70) tmp = (a * b) + ((c * i) + (z * t)); elseif ((a * b) <= 500000.0) tmp = (c * i) + t_1; else tmp = (a * b) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+274], N[(a * N[(b + N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e+70], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 500000.0], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $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 -2 \cdot 10^{+274}:\\
\;\;\;\;a \cdot \left(b + \frac{x \cdot y}{a}\right)\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+70}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 500000:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999984e274Initial program 80.0%
+-commutative80.0%
fma-define80.0%
+-commutative80.0%
fma-define92.0%
fma-define92.0%
Simplified92.0%
Taylor expanded in c around 0 80.0%
Taylor expanded in t around 0 88.0%
Taylor expanded in a around inf 92.0%
if -1.99999999999999984e274 < (*.f64 a b) < -2.00000000000000015e70Initial program 99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 87.4%
if -2.00000000000000015e70 < (*.f64 a b) < 5e5Initial program 99.3%
+-commutative99.3%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 97.3%
if 5e5 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-define96.1%
+-commutative96.1%
fma-define96.1%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around 0 92.5%
Final simplification94.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= (* x y) -4.1e+96)
t_1
(if (<= (* x y) -5e-24)
(+ (* a b) (* z t))
(if (<= (* x y) 3.2e-24) (+ (* a b) (* 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) + (a * b);
double tmp;
if ((x * y) <= -4.1e+96) {
tmp = t_1;
} else if ((x * y) <= -5e-24) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 3.2e-24) {
tmp = (a * b) + (c * i);
} 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 = (x * y) + (a * b)
if ((x * y) <= (-4.1d+96)) then
tmp = t_1
else if ((x * y) <= (-5d-24)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 3.2d-24) then
tmp = (a * b) + (c * i)
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 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -4.1e+96) {
tmp = t_1;
} else if ((x * y) <= -5e-24) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 3.2e-24) {
tmp = (a * b) + (c * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) tmp = 0 if (x * y) <= -4.1e+96: tmp = t_1 elif (x * y) <= -5e-24: tmp = (a * b) + (z * t) elif (x * y) <= 3.2e-24: tmp = (a * b) + (c * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -4.1e+96) tmp = t_1; elseif (Float64(x * y) <= -5e-24) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 3.2e-24) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -4.1e+96) tmp = t_1; elseif ((x * y) <= -5e-24) tmp = (a * b) + (z * t); elseif ((x * y) <= 3.2e-24) tmp = (a * b) + (c * i); else tmp = 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[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.1e+96], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-24], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-24], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -4.1 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-24}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-24}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.09999999999999998e96 or 3.20000000000000012e-24 < (*.f64 x y) Initial program 92.2%
+-commutative92.2%
fma-define94.8%
+-commutative94.8%
fma-define97.4%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 86.6%
Taylor expanded in t around 0 78.3%
if -4.09999999999999998e96 < (*.f64 x y) < -4.9999999999999998e-24Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 88.3%
Taylor expanded in c around 0 68.7%
if -4.9999999999999998e-24 < (*.f64 x y) < 3.20000000000000012e-24Initial program 99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 96.7%
Taylor expanded in c around inf 69.3%
Final simplification73.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.62e+94)
(* x y)
(if (<= (* x y) -5.8e-24)
(+ (* a b) (* z t))
(if (<= (* x y) 5.6e+163) (+ (* a b) (* c i)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.62e+94) {
tmp = x * y;
} else if ((x * y) <= -5.8e-24) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5.6e+163) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-1.62d+94)) then
tmp = x * y
else if ((x * y) <= (-5.8d-24)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 5.6d+163) then
tmp = (a * b) + (c * i)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.62e+94) {
tmp = x * y;
} else if ((x * y) <= -5.8e-24) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5.6e+163) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.62e+94: tmp = x * y elif (x * y) <= -5.8e-24: tmp = (a * b) + (z * t) elif (x * y) <= 5.6e+163: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.62e+94) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.8e-24) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 5.6e+163) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1.62e+94) tmp = x * y; elseif ((x * y) <= -5.8e-24) tmp = (a * b) + (z * t); elseif ((x * y) <= 5.6e+163) tmp = (a * b) + (c * i); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.62e+94], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.8e-24], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.6e+163], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.62 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.8 \cdot 10^{-24}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{+163}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.61999999999999997e94 or 5.60000000000000029e163 < (*.f64 x y) Initial program 92.3%
+-commutative92.3%
fma-define94.9%
+-commutative94.9%
fma-define97.4%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around 0 91.2%
Taylor expanded in t around 0 88.7%
Taylor expanded in a around 0 79.4%
if -1.61999999999999997e94 < (*.f64 x y) < -5.7999999999999997e-24Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 88.3%
Taylor expanded in c around 0 68.7%
if -5.7999999999999997e-24 < (*.f64 x y) < 5.60000000000000029e163Initial program 97.4%
+-commutative97.4%
fma-define98.0%
+-commutative98.0%
fma-define98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in x around 0 90.4%
Taylor expanded in c around inf 64.8%
Final simplification69.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5.8e+64) (not (<= (* x y) 3.3e-24))) (+ (* a b) (+ (* x y) (* z t))) (+ (* a b) (+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5.8e+64) || !((x * y) <= 3.3e-24)) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-5.8d+64)) .or. (.not. ((x * y) <= 3.3d-24))) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (a * b) + ((c * i) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5.8e+64) || !((x * y) <= 3.3e-24)) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5.8e+64) or not ((x * y) <= 3.3e-24): tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (a * b) + ((c * i) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5.8e+64) || !(Float64(x * y) <= 3.3e-24)) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -5.8e+64) || ~(((x * y) <= 3.3e-24))) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (a * b) + ((c * i) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5.8e+64], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.3e-24]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+64} \lor \neg \left(x \cdot y \leq 3.3 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.79999999999999986e64 or 3.29999999999999984e-24 < (*.f64 x y) Initial program 92.6%
+-commutative92.6%
fma-define95.1%
+-commutative95.1%
fma-define97.5%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 87.2%
if -5.79999999999999986e64 < (*.f64 x y) < 3.29999999999999984e-24Initial program 99.2%
+-commutative99.2%
fma-define99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 95.7%
Final simplification91.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.5e+100) (not (<= (* x y) 3.6e+163))) (+ (* x y) (* a b)) (+ (* a b) (+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4.5e+100) || !((x * y) <= 3.6e+163)) {
tmp = (x * y) + (a * b);
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-4.5d+100)) .or. (.not. ((x * y) <= 3.6d+163))) then
tmp = (x * y) + (a * b)
else
tmp = (a * b) + ((c * i) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4.5e+100) || !((x * y) <= 3.6e+163)) {
tmp = (x * y) + (a * b);
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -4.5e+100) or not ((x * y) <= 3.6e+163): tmp = (x * y) + (a * b) else: tmp = (a * b) + ((c * i) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -4.5e+100) || !(Float64(x * y) <= 3.6e+163)) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -4.5e+100) || ~(((x * y) <= 3.6e+163))) tmp = (x * y) + (a * b); else tmp = (a * b) + ((c * i) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4.5e+100], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.6e+163]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.5 \cdot 10^{+100} \lor \neg \left(x \cdot y \leq 3.6 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.50000000000000036e100 or 3.59999999999999978e163 < (*.f64 x y) Initial program 92.3%
+-commutative92.3%
fma-define94.9%
+-commutative94.9%
fma-define97.4%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around 0 91.2%
Taylor expanded in t around 0 88.7%
if -4.50000000000000036e100 < (*.f64 x y) < 3.59999999999999978e163Initial program 97.7%
+-commutative97.7%
fma-define98.3%
+-commutative98.3%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 90.1%
Final simplification89.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -4.8e+65) (* x y) (if (<= (* x y) 6e-143) (* c i) (if (<= (* x y) 6.5e+35) (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4.8e+65) {
tmp = x * y;
} else if ((x * y) <= 6e-143) {
tmp = c * i;
} else if ((x * y) <= 6.5e+35) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-4.8d+65)) then
tmp = x * y
else if ((x * y) <= 6d-143) then
tmp = c * i
else if ((x * y) <= 6.5d+35) then
tmp = a * b
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4.8e+65) {
tmp = x * y;
} else if ((x * y) <= 6e-143) {
tmp = c * i;
} else if ((x * y) <= 6.5e+35) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4.8e+65: tmp = x * y elif (x * y) <= 6e-143: tmp = c * i elif (x * y) <= 6.5e+35: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4.8e+65) tmp = Float64(x * y); elseif (Float64(x * y) <= 6e-143) tmp = Float64(c * i); elseif (Float64(x * y) <= 6.5e+35) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -4.8e+65) tmp = x * y; elseif ((x * y) <= 6e-143) tmp = c * i; elseif ((x * y) <= 6.5e+35) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.8e+65], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6e-143], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+35], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+65}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-143}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+35}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.8000000000000003e65 or 6.5000000000000003e35 < (*.f64 x y) Initial program 92.6%
+-commutative92.6%
fma-define94.5%
+-commutative94.5%
fma-define97.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in c around 0 85.7%
Taylor expanded in t around 0 77.0%
Taylor expanded in a around 0 64.0%
if -4.8000000000000003e65 < (*.f64 x y) < 5.9999999999999997e-143Initial program 99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in c around inf 43.6%
if 5.9999999999999997e-143 < (*.f64 x y) < 6.5000000000000003e35Initial program 96.7%
+-commutative96.7%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 54.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.55e+81) (not (<= (* x y) 7.5e-11))) (+ (* x y) (* a b)) (+ (* c i) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.55e+81) || !((x * y) <= 7.5e-11)) {
tmp = (x * y) + (a * b);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.55d+81)) .or. (.not. ((x * y) <= 7.5d-11))) then
tmp = (x * y) + (a * b)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.55e+81) || !((x * y) <= 7.5e-11)) {
tmp = (x * y) + (a * b);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.55e+81) or not ((x * y) <= 7.5e-11): tmp = (x * y) + (a * b) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.55e+81) || !(Float64(x * y) <= 7.5e-11)) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.55e+81) || ~(((x * y) <= 7.5e-11))) tmp = (x * y) + (a * b); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.55e+81], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.5e-11]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+81} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e81 or 7.5e-11 < (*.f64 x y) Initial program 92.2%
+-commutative92.2%
fma-define94.8%
+-commutative94.8%
fma-define97.4%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 86.6%
Taylor expanded in t around 0 80.0%
if -1.55e81 < (*.f64 x y) < 7.5e-11Initial program 99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in x around 0 95.2%
Taylor expanded in a around 0 72.2%
Final simplification75.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -7.4e+93) (not (<= (* x y) 6.5e+163))) (* 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) <= -7.4e+93) || !((x * y) <= 6.5e+163)) {
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) <= (-7.4d+93)) .or. (.not. ((x * y) <= 6.5d+163))) 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) <= -7.4e+93) || !((x * y) <= 6.5e+163)) {
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) <= -7.4e+93) or not ((x * y) <= 6.5e+163): 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) <= -7.4e+93) || !(Float64(x * y) <= 6.5e+163)) 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) <= -7.4e+93) || ~(((x * y) <= 6.5e+163))) 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], -7.4e+93], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6.5e+163]], $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 -7.4 \cdot 10^{+93} \lor \neg \left(x \cdot y \leq 6.5 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -7.39999999999999974e93 or 6.4999999999999998e163 < (*.f64 x y) Initial program 92.3%
+-commutative92.3%
fma-define94.9%
+-commutative94.9%
fma-define97.4%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around 0 91.2%
Taylor expanded in t around 0 88.7%
Taylor expanded in a around 0 79.4%
if -7.39999999999999974e93 < (*.f64 x y) < 6.4999999999999998e163Initial program 97.7%
+-commutative97.7%
fma-define98.3%
+-commutative98.3%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 90.1%
Taylor expanded in c around inf 62.0%
Final simplification67.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t -3.6e-87) (* z t) (if (<= t 1.18e-20) (* c i) (if (<= t 6.2e+166) (* 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 (t <= -3.6e-87) {
tmp = z * t;
} else if (t <= 1.18e-20) {
tmp = c * i;
} else if (t <= 6.2e+166) {
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 (t <= (-3.6d-87)) then
tmp = z * t
else if (t <= 1.18d-20) then
tmp = c * i
else if (t <= 6.2d+166) 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 (t <= -3.6e-87) {
tmp = z * t;
} else if (t <= 1.18e-20) {
tmp = c * i;
} else if (t <= 6.2e+166) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -3.6e-87: tmp = z * t elif t <= 1.18e-20: tmp = c * i elif t <= 6.2e+166: tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -3.6e-87) tmp = Float64(z * t); elseif (t <= 1.18e-20) tmp = Float64(c * i); elseif (t <= 6.2e+166) 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 (t <= -3.6e-87) tmp = z * t; elseif (t <= 1.18e-20) tmp = c * i; elseif (t <= 6.2e+166) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -3.6e-87], N[(z * t), $MachinePrecision], If[LessEqual[t, 1.18e-20], N[(c * i), $MachinePrecision], If[LessEqual[t, 6.2e+166], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-87}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 1.18 \cdot 10^{-20}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+166}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -3.59999999999999993e-87 or 6.19999999999999966e166 < t Initial program 94.9%
+-commutative94.9%
fma-define95.9%
+-commutative95.9%
fma-define96.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in x around 0 70.7%
Taylor expanded in c around 0 58.1%
Taylor expanded in a around 0 44.5%
if -3.59999999999999993e-87 < t < 1.1800000000000001e-20Initial program 97.2%
+-commutative97.2%
fma-define98.1%
+-commutative98.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in c around inf 39.6%
if 1.1800000000000001e-20 < t < 6.19999999999999966e166Initial program 96.0%
+-commutative96.0%
fma-define98.0%
+-commutative98.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 40.8%
Final simplification41.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -6.2e+63) (not (<= (* a b) 3.1e+98))) (* 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) <= -6.2e+63) || !((a * b) <= 3.1e+98)) {
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) <= (-6.2d+63)) .or. (.not. ((a * b) <= 3.1d+98))) 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) <= -6.2e+63) || !((a * b) <= 3.1e+98)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -6.2e+63) or not ((a * b) <= 3.1e+98): 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) <= -6.2e+63) || !(Float64(a * b) <= 3.1e+98)) 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) <= -6.2e+63) || ~(((a * b) <= 3.1e+98))) 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], -6.2e+63], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3.1e+98]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.2 \cdot 10^{+63} \lor \neg \left(a \cdot b \leq 3.1 \cdot 10^{+98}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -6.2000000000000001e63 or 3.10000000000000019e98 < (*.f64 a b) Initial program 91.1%
+-commutative91.1%
fma-define93.1%
+-commutative93.1%
fma-define96.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in a around inf 54.1%
if -6.2000000000000001e63 < (*.f64 a b) < 3.10000000000000019e98Initial program 99.4%
+-commutative99.4%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around inf 37.0%
Final simplification43.8%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define97.2%
+-commutative97.2%
fma-define98.4%
fma-define98.8%
Simplified98.8%
Taylor expanded in a around inf 24.6%
herbie shell --seed 2024170
(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)))