
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* t (- z (* c (/ (* i (fma c b a)) t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (t * (z - (c * ((i * fma(c, b, a)) / t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t * Float64(z - Float64(c * Float64(Float64(i * fma(c, b, a)) / t))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * N[(z - N[(c * N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z - c \cdot \frac{i \cdot \mathsf{fma}\left(c, b, a\right)}{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.3%
fma-define94.3%
associate-*l*98.3%
Simplified98.3%
fma-define98.3%
+-commutative98.3%
Applied egg-rr98.3%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 42.9%
Taylor expanded in t around inf 66.7%
mul-1-neg66.7%
unsub-neg66.7%
associate-/l*76.2%
+-commutative76.2%
*-commutative76.2%
fma-define76.2%
Simplified76.2%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* y (- x (/ (* c (* (* b c) i)) y)))))
(t_2 (* c (* (+ a (* b c)) i)))
(t_3 (* 2.0 (- (* x y) t_2))))
(if (<= (* x y) (- INFINITY))
t_1
(if (<= (* x y) -1e+38)
t_3
(if (<= (* x y) -5e-5)
(* (+ (* x y) (* z t)) 2.0)
(if (<= (* x y) -1e-29)
t_3
(if (<= (* x y) 2e+91) (* 2.0 (- (* z t) t_2)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
double t_2 = c * ((a + (b * c)) * i);
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = t_1;
} else if ((x * y) <= -1e+38) {
tmp = t_3;
} else if ((x * y) <= -5e-5) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= -1e-29) {
tmp = t_3;
} else if ((x * y) <= 2e+91) {
tmp = 2.0 * ((z * t) - t_2);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
double t_2 = c * ((a + (b * c)) * i);
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if ((x * y) <= -1e+38) {
tmp = t_3;
} else if ((x * y) <= -5e-5) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= -1e-29) {
tmp = t_3;
} else if ((x * y) <= 2e+91) {
tmp = 2.0 * ((z * t) - t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))) t_2 = c * ((a + (b * c)) * i) t_3 = 2.0 * ((x * y) - t_2) tmp = 0 if (x * y) <= -math.inf: tmp = t_1 elif (x * y) <= -1e+38: tmp = t_3 elif (x * y) <= -5e-5: tmp = ((x * y) + (z * t)) * 2.0 elif (x * y) <= -1e-29: tmp = t_3 elif (x * y) <= 2e+91: tmp = 2.0 * ((z * t) - t_2) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y)))) t_2 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2)) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = t_1; elseif (Float64(x * y) <= -1e+38) tmp = t_3; elseif (Float64(x * y) <= -5e-5) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (Float64(x * y) <= -1e-29) tmp = t_3; elseif (Float64(x * y) <= 2e+91) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))); t_2 = c * ((a + (b * c)) * i); t_3 = 2.0 * ((x * y) - t_2); tmp = 0.0; if ((x * y) <= -Inf) tmp = t_1; elseif ((x * y) <= -1e+38) tmp = t_3; elseif ((x * y) <= -5e-5) tmp = ((x * y) + (z * t)) * 2.0; elseif ((x * y) <= -1e-29) tmp = t_3; elseif ((x * y) <= 2e+91) tmp = 2.0 * ((z * t) - t_2); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e+38], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5e-5], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 2e+91], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\
t_2 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+38}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+91}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0 or 2.00000000000000016e91 < (*.f64 x y) Initial program 77.2%
Taylor expanded in y around inf 88.6%
Taylor expanded in t around 0 81.3%
Taylor expanded in a around 0 84.6%
associate-*r*84.6%
*-commutative84.6%
*-commutative84.6%
Simplified84.6%
if -inf.0 < (*.f64 x y) < -9.99999999999999977e37 or -5.00000000000000024e-5 < (*.f64 x y) < -9.99999999999999943e-30Initial program 88.5%
Taylor expanded in z around 0 82.4%
if -9.99999999999999977e37 < (*.f64 x y) < -5.00000000000000024e-5Initial program 75.3%
Taylor expanded in c around 0 91.7%
if -9.99999999999999943e-30 < (*.f64 x y) < 2.00000000000000016e91Initial program 91.2%
Taylor expanded in x around 0 85.4%
Final simplification84.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 (- INFINITY))
(* 2.0 (* c (* t_1 (- i))))
(if (<= t_2 5e+268)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* 2.0 (* y (- x (/ (* c (* t_1 i)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 5e+268) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
}
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 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 5e+268) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * (c * (t_1 * -i)) elif t_2 <= 5e+268: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); elseif (t_2 <= 5e+268) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(t_1 * i)) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * (c * (t_1 * -i)); elseif (t_2 <= 5e+268) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+268], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(t\_1 \cdot i\right)}{y}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 69.9%
Taylor expanded in i around inf 92.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e268Initial program 98.0%
if 5.0000000000000002e268 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 68.2%
Taylor expanded in y around inf 80.7%
Taylor expanded in t around 0 80.9%
Final simplification93.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))))
(t_2 (* 2.0 (* y (- x (/ (* c (* (* b c) i)) y))))))
(if (<= (* x y) -5e+176)
t_2
(if (<= (* x y) -2e+60)
t_1
(if (<= (* x y) -40000000000000.0)
(* (+ (* x y) (* z t)) 2.0)
(if (<= (* x y) 2e+91) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
double tmp;
if ((x * y) <= -5e+176) {
tmp = t_2;
} else if ((x * y) <= -2e+60) {
tmp = t_1;
} else if ((x * y) <= -40000000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
t_2 = 2.0d0 * (y * (x - ((c * ((b * c) * i)) / y)))
if ((x * y) <= (-5d+176)) then
tmp = t_2
else if ((x * y) <= (-2d+60)) then
tmp = t_1
else if ((x * y) <= (-40000000000000.0d0)) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((x * y) <= 2d+91) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
double tmp;
if ((x * y) <= -5e+176) {
tmp = t_2;
} else if ((x * y) <= -2e+60) {
tmp = t_1;
} else if ((x * y) <= -40000000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))) tmp = 0 if (x * y) <= -5e+176: tmp = t_2 elif (x * y) <= -2e+60: tmp = t_1 elif (x * y) <= -40000000000000.0: tmp = ((x * y) + (z * t)) * 2.0 elif (x * y) <= 2e+91: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) t_2 = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y)))) tmp = 0.0 if (Float64(x * y) <= -5e+176) tmp = t_2; elseif (Float64(x * y) <= -2e+60) tmp = t_1; elseif (Float64(x * y) <= -40000000000000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (Float64(x * y) <= 2e+91) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))); tmp = 0.0; if ((x * y) <= -5e+176) tmp = t_2; elseif ((x * y) <= -2e+60) tmp = t_1; elseif ((x * y) <= -40000000000000.0) tmp = ((x * y) + (z * t)) * 2.0; elseif ((x * y) <= 2e+91) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+176], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2e+60], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -40000000000000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+91], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
t_2 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -40000000000000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5e176 or 2.00000000000000016e91 < (*.f64 x y) Initial program 78.7%
Taylor expanded in y around inf 90.5%
Taylor expanded in t around 0 82.7%
Taylor expanded in a around 0 82.9%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
Simplified82.9%
if -5e176 < (*.f64 x y) < -1.9999999999999999e60 or -4e13 < (*.f64 x y) < 2.00000000000000016e91Initial program 91.5%
Taylor expanded in x around 0 83.7%
if -1.9999999999999999e60 < (*.f64 x y) < -4e13Initial program 75.3%
Taylor expanded in c around 0 83.3%
Final simplification83.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -5.8e+167)
t_2
(if (<= (* x y) -3.3e+17)
t_1
(if (<= (* x y) -2.5e-35)
t_2
(if (<= (* x y) -1.2e-287)
(* (* i (* a c)) -2.0)
(if (<= (* x y) 3.2e+91) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -5.8e+167) {
tmp = t_2;
} else if ((x * y) <= -3.3e+17) {
tmp = t_1;
} else if ((x * y) <= -2.5e-35) {
tmp = t_2;
} else if ((x * y) <= -1.2e-287) {
tmp = (i * (a * c)) * -2.0;
} else if ((x * y) <= 3.2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-5.8d+167)) then
tmp = t_2
else if ((x * y) <= (-3.3d+17)) then
tmp = t_1
else if ((x * y) <= (-2.5d-35)) then
tmp = t_2
else if ((x * y) <= (-1.2d-287)) then
tmp = (i * (a * c)) * (-2.0d0)
else if ((x * y) <= 3.2d+91) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -5.8e+167) {
tmp = t_2;
} else if ((x * y) <= -3.3e+17) {
tmp = t_1;
} else if ((x * y) <= -2.5e-35) {
tmp = t_2;
} else if ((x * y) <= -1.2e-287) {
tmp = (i * (a * c)) * -2.0;
} else if ((x * y) <= 3.2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -5.8e+167: tmp = t_2 elif (x * y) <= -3.3e+17: tmp = t_1 elif (x * y) <= -2.5e-35: tmp = t_2 elif (x * y) <= -1.2e-287: tmp = (i * (a * c)) * -2.0 elif (x * y) <= 3.2e+91: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -5.8e+167) tmp = t_2; elseif (Float64(x * y) <= -3.3e+17) tmp = t_1; elseif (Float64(x * y) <= -2.5e-35) tmp = t_2; elseif (Float64(x * y) <= -1.2e-287) tmp = Float64(Float64(i * Float64(a * c)) * -2.0); elseif (Float64(x * y) <= 3.2e+91) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -5.8e+167) tmp = t_2; elseif ((x * y) <= -3.3e+17) tmp = t_1; elseif ((x * y) <= -2.5e-35) tmp = t_2; elseif ((x * y) <= -1.2e-287) tmp = (i * (a * c)) * -2.0; elseif ((x * y) <= 3.2e+91) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e+167], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.3e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e-35], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.2e-287], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+91], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+167}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-35}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1.2 \cdot 10^{-287}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.79999999999999949e167 or -3.3e17 < (*.f64 x y) < -2.49999999999999982e-35 or 3.19999999999999989e91 < (*.f64 x y) Initial program 81.3%
Taylor expanded in x around inf 60.8%
if -5.79999999999999949e167 < (*.f64 x y) < -3.3e17 or -1.2e-287 < (*.f64 x y) < 3.19999999999999989e91Initial program 88.3%
Taylor expanded in z around inf 38.4%
if -2.49999999999999982e-35 < (*.f64 x y) < -1.2e-287Initial program 93.8%
fma-define93.8%
associate-*l*97.9%
Simplified97.9%
fma-define97.9%
+-commutative97.9%
Applied egg-rr97.9%
Taylor expanded in a around inf 47.3%
mul-1-neg47.3%
associate-*r*41.3%
distribute-lft-neg-out41.3%
*-commutative41.3%
distribute-rgt-neg-in41.3%
Simplified41.3%
Taylor expanded in i around 0 47.3%
*-commutative47.3%
associate-*r*42.3%
*-commutative42.3%
associate-*l*41.3%
Simplified41.3%
Final simplification47.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* y (- x (/ (* c (* (* b c) i)) y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
}
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 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.3%
fma-define94.3%
associate-*l*98.3%
Simplified98.3%
fma-define98.3%
+-commutative98.3%
Applied egg-rr98.3%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in y around inf 38.1%
Taylor expanded in t around 0 47.6%
Taylor expanded in a around 0 61.9%
associate-*r*61.9%
*-commutative61.9%
*-commutative61.9%
Simplified61.9%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+107)
(* 2.0 (* x (+ y (* t (/ z x)))))
(if (<= (* x y) -1e+38)
(* 2.0 (- (* x y) (* i (* a c))))
(if (<= (* x y) -1e-29)
(* (+ (* x y) (* z t)) 2.0)
(if (<= (* x y) 4e+163)
(* 2.0 (- (* z t) (* a (* c i))))
(* 2.0 (* y (+ x (* t (/ z y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+107) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else if ((x * y) <= -1e+38) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if ((x * y) <= -1e-29) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 4e+163) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + (t * (z / 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) <= (-1d+107)) then
tmp = 2.0d0 * (x * (y + (t * (z / x))))
else if ((x * y) <= (-1d+38)) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
else if ((x * y) <= (-1d-29)) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((x * y) <= 4d+163) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else
tmp = 2.0d0 * (y * (x + (t * (z / 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) <= -1e+107) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else if ((x * y) <= -1e+38) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if ((x * y) <= -1e-29) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 4e+163) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + (t * (z / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+107: tmp = 2.0 * (x * (y + (t * (z / x)))) elif (x * y) <= -1e+38: tmp = 2.0 * ((x * y) - (i * (a * c))) elif (x * y) <= -1e-29: tmp = ((x * y) + (z * t)) * 2.0 elif (x * y) <= 4e+163: tmp = 2.0 * ((z * t) - (a * (c * i))) else: tmp = 2.0 * (y * (x + (t * (z / y)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+107) tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x))))); elseif (Float64(x * y) <= -1e+38) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); elseif (Float64(x * y) <= -1e-29) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (Float64(x * y) <= 4e+163) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x + Float64(t * Float64(z / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+107) tmp = 2.0 * (x * (y + (t * (z / x)))); elseif ((x * y) <= -1e+38) tmp = 2.0 * ((x * y) - (i * (a * c))); elseif ((x * y) <= -1e-29) tmp = ((x * y) + (z * t)) * 2.0; elseif ((x * y) <= 4e+163) tmp = 2.0 * ((z * t) - (a * (c * i))); else tmp = 2.0 * (y * (x + (t * (z / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+107], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+38], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+163], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+107}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+38}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999997e106Initial program 72.7%
Taylor expanded in a around inf 70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in z around inf 56.7%
associate--l+56.7%
div-sub57.0%
associate-*r*57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in c around 0 59.2%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in x around inf 74.7%
associate-/l*77.0%
Simplified77.0%
if -9.9999999999999997e106 < (*.f64 x y) < -9.99999999999999977e37Initial program 90.9%
Taylor expanded in a around inf 64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in z around 0 64.3%
associate-*r*64.3%
*-commutative64.3%
Simplified64.3%
if -9.99999999999999977e37 < (*.f64 x y) < -9.99999999999999943e-30Initial program 85.9%
Taylor expanded in c around 0 73.3%
if -9.99999999999999943e-30 < (*.f64 x y) < 3.9999999999999998e163Initial program 91.9%
Taylor expanded in a around inf 69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 67.9%
associate--l+67.9%
div-sub67.9%
associate-*r*63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x around 0 61.3%
associate-/l*60.6%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in z around 0 67.0%
+-commutative67.0%
mul-1-neg67.0%
sub-neg67.0%
*-commutative67.0%
Simplified67.0%
if 3.9999999999999998e163 < (*.f64 x y) Initial program 80.3%
Taylor expanded in a around inf 77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in z around inf 66.6%
associate--l+66.6%
div-sub75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in c around 0 75.1%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in y around inf 77.7%
associate-/l*80.5%
Simplified80.5%
Final simplification70.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)) (t_2 (* (* c i) (* a -2.0))))
(if (<= c -4.2e+30)
t_2
(if (<= c -6.8e-267)
t_1
(if (<= c 2.45e-189) (* 2.0 (* z t)) (if (<= c 4.2e-49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = (c * i) * (a * -2.0);
double tmp;
if (c <= -4.2e+30) {
tmp = t_2;
} else if (c <= -6.8e-267) {
tmp = t_1;
} else if (c <= 2.45e-189) {
tmp = 2.0 * (z * t);
} else if (c <= 4.2e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) * 2.0d0
t_2 = (c * i) * (a * (-2.0d0))
if (c <= (-4.2d+30)) then
tmp = t_2
else if (c <= (-6.8d-267)) then
tmp = t_1
else if (c <= 2.45d-189) then
tmp = 2.0d0 * (z * t)
else if (c <= 4.2d-49) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = (c * i) * (a * -2.0);
double tmp;
if (c <= -4.2e+30) {
tmp = t_2;
} else if (c <= -6.8e-267) {
tmp = t_1;
} else if (c <= 2.45e-189) {
tmp = 2.0 * (z * t);
} else if (c <= 4.2e-49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 t_2 = (c * i) * (a * -2.0) tmp = 0 if c <= -4.2e+30: tmp = t_2 elif c <= -6.8e-267: tmp = t_1 elif c <= 2.45e-189: tmp = 2.0 * (z * t) elif c <= 4.2e-49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) t_2 = Float64(Float64(c * i) * Float64(a * -2.0)) tmp = 0.0 if (c <= -4.2e+30) tmp = t_2; elseif (c <= -6.8e-267) tmp = t_1; elseif (c <= 2.45e-189) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 4.2e-49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; t_2 = (c * i) * (a * -2.0); tmp = 0.0; if (c <= -4.2e+30) tmp = t_2; elseif (c <= -6.8e-267) tmp = t_1; elseif (c <= 2.45e-189) tmp = 2.0 * (z * t); elseif (c <= 4.2e-49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.2e+30], t$95$2, If[LessEqual[c, -6.8e-267], t$95$1, If[LessEqual[c, 2.45e-189], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e-49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{if}\;c \leq -4.2 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -6.8 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.45 \cdot 10^{-189}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -4.2e30 or 4.1999999999999998e-49 < c Initial program 78.4%
fma-define78.4%
associate-*l*87.8%
Simplified87.8%
fma-define87.0%
+-commutative87.0%
Applied egg-rr87.0%
Taylor expanded in a around inf 45.5%
mul-1-neg45.5%
associate-*r*37.5%
distribute-lft-neg-out37.5%
*-commutative37.5%
distribute-rgt-neg-in37.5%
Simplified37.5%
Taylor expanded in i around 0 45.5%
associate-*r*45.5%
Simplified45.5%
if -4.2e30 < c < -6.80000000000000041e-267 or 2.4499999999999999e-189 < c < 4.1999999999999998e-49Initial program 94.9%
Taylor expanded in x around inf 49.8%
if -6.80000000000000041e-267 < c < 2.4499999999999999e-189Initial program 96.1%
Taylor expanded in z around inf 72.9%
Final simplification49.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -4.6e+27)
t_1
(if (<= c 2.15e-147)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 2.9e+57) (* 2.0 (- (* x y) (* i (* a c)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -4.6e+27) {
tmp = t_1;
} else if (c <= 2.15e-147) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 2.9e+57) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} 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 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-4.6d+27)) then
tmp = t_1
else if (c <= 2.15d-147) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 2.9d+57) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
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 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -4.6e+27) {
tmp = t_1;
} else if (c <= 2.15e-147) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 2.9e+57) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -4.6e+27: tmp = t_1 elif c <= 2.15e-147: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 2.9e+57: tmp = 2.0 * ((x * y) - (i * (a * c))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -4.6e+27) tmp = t_1; elseif (c <= 2.15e-147) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 2.9e+57) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -4.6e+27) tmp = t_1; elseif (c <= 2.15e-147) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 2.9e+57) tmp = 2.0 * ((x * y) - (i * (a * c))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.6e+27], t$95$1, If[LessEqual[c, 2.15e-147], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 2.9e+57], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -4.6 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.15 \cdot 10^{-147}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{+57}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.6000000000000001e27 or 2.9000000000000002e57 < c Initial program 74.5%
Taylor expanded in i around inf 80.9%
if -4.6000000000000001e27 < c < 2.1500000000000001e-147Initial program 95.1%
Taylor expanded in c around 0 77.9%
if 2.1500000000000001e-147 < c < 2.9000000000000002e57Initial program 97.5%
Taylor expanded in a around inf 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in z around 0 77.8%
associate-*r*77.8%
*-commutative77.8%
Simplified77.8%
Final simplification79.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e-29) (not (<= (* x y) 1e+113))) (* 2.0 (* x (+ y (* t (/ z x))))) (* 2.0 (- (* z t) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e-29) || !((x * y) <= 1e+113)) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else {
tmp = 2.0 * ((z * t) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d-29)) .or. (.not. ((x * y) <= 1d+113))) then
tmp = 2.0d0 * (x * (y + (t * (z / x))))
else
tmp = 2.0d0 * ((z * t) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e-29) || !((x * y) <= 1e+113)) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else {
tmp = 2.0 * ((z * t) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e-29) or not ((x * y) <= 1e+113): tmp = 2.0 * (x * (y + (t * (z / x)))) else: tmp = 2.0 * ((z * t) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e-29) || !(Float64(x * y) <= 1e+113)) tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x))))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e-29) || ~(((x * y) <= 1e+113))) tmp = 2.0 * (x * (y + (t * (z / x)))); else tmp = 2.0 * ((z * t) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+113]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29} \lor \neg \left(x \cdot y \leq 10^{+113}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999943e-30 or 1e113 < (*.f64 x y) Initial program 81.3%
Taylor expanded in a around inf 72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in z around inf 66.2%
associate--l+66.2%
div-sub68.7%
associate-*r*65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in c around 0 60.8%
associate-/l*60.8%
Simplified60.8%
Taylor expanded in x around inf 67.8%
associate-/l*69.0%
Simplified69.0%
if -9.99999999999999943e-30 < (*.f64 x y) < 1e113Initial program 91.3%
Taylor expanded in a around inf 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in x around 0 67.2%
associate-*r*63.7%
*-commutative63.7%
Simplified63.7%
Final simplification66.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.66e+59)
(* 2.0 (- (* z t) t_1))
(if (<= c 5.8e+69)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* 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 * ((a + (b * c)) * i);
double tmp;
if (c <= -1.66e+59) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 5.8e+69) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - 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 * ((a + (b * c)) * i)
if (c <= (-1.66d+59)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 5.8d+69) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - 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 * ((a + (b * c)) * i);
double tmp;
if (c <= -1.66e+59) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 5.8e+69) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.66e+59: tmp = 2.0 * ((z * t) - t_1) elif c <= 5.8e+69: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -1.66e+59) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 5.8e+69) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -1.66e+59) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 5.8e+69) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.66e+59], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.8e+69], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.66 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{+69}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -1.6599999999999999e59Initial program 70.0%
Taylor expanded in x around 0 84.8%
if -1.6599999999999999e59 < c < 5.7999999999999997e69Initial program 94.7%
Taylor expanded in a around inf 88.7%
*-commutative88.7%
Simplified88.7%
if 5.7999999999999997e69 < c Initial program 79.0%
Taylor expanded in z around 0 90.0%
Final simplification88.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e-29)
(* 2.0 (* x (+ y (* t (/ z x)))))
(if (<= (* x y) 4e+163)
(* 2.0 (- (* z t) (* a (* c i))))
(* 2.0 (* y (+ x (* t (/ z y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e-29) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else if ((x * y) <= 4e+163) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + (t * (z / 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) <= (-1d-29)) then
tmp = 2.0d0 * (x * (y + (t * (z / x))))
else if ((x * y) <= 4d+163) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else
tmp = 2.0d0 * (y * (x + (t * (z / 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) <= -1e-29) {
tmp = 2.0 * (x * (y + (t * (z / x))));
} else if ((x * y) <= 4e+163) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + (t * (z / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e-29: tmp = 2.0 * (x * (y + (t * (z / x)))) elif (x * y) <= 4e+163: tmp = 2.0 * ((z * t) - (a * (c * i))) else: tmp = 2.0 * (y * (x + (t * (z / y)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e-29) tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x))))); elseif (Float64(x * y) <= 4e+163) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x + Float64(t * Float64(z / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e-29) tmp = 2.0 * (x * (y + (t * (z / x)))); elseif ((x * y) <= 4e+163) tmp = 2.0 * ((z * t) - (a * (c * i))); else tmp = 2.0 * (y * (x + (t * (z / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+163], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999943e-30Initial program 79.1%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around inf 63.5%
associate--l+63.5%
div-sub63.7%
associate-*r*62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in c around 0 57.3%
associate-/l*54.6%
Simplified54.6%
Taylor expanded in x around inf 66.2%
associate-/l*67.4%
Simplified67.4%
if -9.99999999999999943e-30 < (*.f64 x y) < 3.9999999999999998e163Initial program 91.9%
Taylor expanded in a around inf 69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 67.9%
associate--l+67.9%
div-sub67.9%
associate-*r*63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x around 0 61.3%
associate-/l*60.6%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in z around 0 67.0%
+-commutative67.0%
mul-1-neg67.0%
sub-neg67.0%
*-commutative67.0%
Simplified67.0%
if 3.9999999999999998e163 < (*.f64 x y) Initial program 80.3%
Taylor expanded in a around inf 77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in z around inf 66.6%
associate--l+66.6%
div-sub75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in c around 0 75.1%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in y around inf 77.7%
associate-/l*80.5%
Simplified80.5%
Final simplification69.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.1e+28) (not (<= c 1.26e+76))) (* (* c i) (* a -2.0)) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.1e+28) || !(c <= 1.26e+76)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
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 <= (-2.1d+28)) .or. (.not. (c <= 1.26d+76))) then
tmp = (c * i) * (a * (-2.0d0))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 <= -2.1e+28) || !(c <= 1.26e+76)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.1e+28) or not (c <= 1.26e+76): tmp = (c * i) * (a * -2.0) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.1e+28) || !(c <= 1.26e+76)) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.1e+28) || ~((c <= 1.26e+76))) tmp = (c * i) * (a * -2.0); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.1e+28], N[Not[LessEqual[c, 1.26e+76]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.1 \cdot 10^{+28} \lor \neg \left(c \leq 1.26 \cdot 10^{+76}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.09999999999999989e28 or 1.26000000000000007e76 < c Initial program 75.5%
fma-define75.5%
associate-*l*85.2%
Simplified85.2%
fma-define84.3%
+-commutative84.3%
Applied egg-rr84.3%
Taylor expanded in a around inf 45.6%
mul-1-neg45.6%
associate-*r*35.9%
distribute-lft-neg-out35.9%
*-commutative35.9%
distribute-rgt-neg-in35.9%
Simplified35.9%
Taylor expanded in i around 0 45.6%
associate-*r*45.6%
Simplified45.6%
if -2.09999999999999989e28 < c < 1.26000000000000007e76Initial program 94.6%
Taylor expanded in c around 0 72.9%
Final simplification61.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.4e+168) (not (<= (* x y) 1.6e+101))) (* (* x y) 2.0) (* 2.0 (* 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.4e+168) || !((x * y) <= 1.6e+101)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (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.4d+168)) .or. (.not. ((x * y) <= 1.6d+101))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (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.4e+168) || !((x * y) <= 1.6e+101)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.4e+168) or not ((x * y) <= 1.6e+101): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.4e+168) || !(Float64(x * y) <= 1.6e+101)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * 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.4e+168) || ~(((x * y) <= 1.6e+101))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.4e+168], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.6e+101]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+168} \lor \neg \left(x \cdot y \leq 1.6 \cdot 10^{+101}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.39999999999999995e168 or 1.60000000000000003e101 < (*.f64 x y) Initial program 78.7%
Taylor expanded in x around inf 64.2%
if -1.39999999999999995e168 < (*.f64 x y) < 1.60000000000000003e101Initial program 90.4%
Taylor expanded in z around inf 33.5%
Final simplification43.5%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
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 = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 86.6%
Taylor expanded in z around inf 26.9%
Final simplification26.9%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024083
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))