
(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 16 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))))
(if (<= (- (+ (* y x) (* z t)) (* i (* c t_1))) 2e+295)
(* 2.0 (- (fma x y (* z t)) (* (* c i) t_1)))
(* 2.0 (fma y x (- (* z t) (* 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 = a + (b * c);
double tmp;
if ((((y * x) + (z * t)) - (i * (c * t_1))) <= 2e+295) {
tmp = 2.0 * (fma(x, y, (z * t)) - ((c * i) * t_1));
} else {
tmp = 2.0 * fma(y, x, ((z * t) - (c * (i * t_1))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(y * x) + Float64(z * t)) - Float64(i * Float64(c * t_1))) <= 2e+295) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(c * i) * t_1))); else tmp = Float64(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(i * t_1))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+295], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(y \cdot x + z \cdot t\right) - i \cdot \left(c \cdot t\_1\right) \leq 2 \cdot 10^{+295}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(c \cdot i\right) \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(i \cdot t\_1\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < 2e295Initial program 95.3%
fma-define95.3%
associate-*l*98.9%
Simplified98.9%
if 2e295 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 72.8%
associate--l+72.8%
fma-neg72.8%
*-commutative72.8%
+-commutative72.8%
fma-undefine72.8%
associate-*r*87.5%
*-commutative87.5%
*-commutative87.5%
fma-define98.7%
*-commutative98.7%
associate-*r*84.1%
fma-undefine84.1%
+-commutative84.1%
*-commutative84.1%
associate-*r*98.7%
distribute-rgt-neg-in98.7%
Applied egg-rr98.7%
Taylor expanded in z around 0 98.7%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (fma y x (fma z t (* (fma b c a) (* c (- i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * fma(y, x, fma(z, t, (fma(b, c, a) * (c * -i))));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * fma(y, x, fma(z, t, Float64(fma(b, c, a) * Float64(c * Float64(-i)))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(y * x + N[(z * t + N[(N[(b * c + a), $MachinePrecision] * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \mathsf{fma}\left(b, c, a\right) \cdot \left(c \cdot \left(-i\right)\right)\right)\right)
\end{array}
Initial program 89.0%
associate--l+89.0%
fma-neg89.0%
*-commutative89.0%
+-commutative89.0%
fma-undefine89.0%
associate-*r*89.8%
*-commutative89.8%
*-commutative89.8%
fma-define92.9%
*-commutative92.9%
associate-*r*92.2%
fma-undefine92.2%
+-commutative92.2%
*-commutative92.2%
associate-*r*98.8%
distribute-rgt-neg-in98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* y x) (* z t)) (* i (* c t_1))) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* (* c i) t_1)))
(* 2.0 (- (* z t) (* c (* b (* c i))))))))
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 tmp;
if ((((y * x) + (z * t)) - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - ((c * i) * t_1));
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(y * x) + Float64(z * t)) - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(c * i) * t_1))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(y \cdot x + z \cdot t\right) - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(c \cdot i\right) \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\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 92.7%
fma-define92.7%
associate-*l*98.8%
Simplified98.8%
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 90.0%
Taylor expanded in a around 0 90.1%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))) (t_3 (* c (* i t_1))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* y x) t_3))
(if (<= t_2 1e+282)
(* 2.0 (- (+ (* y x) (* z t)) t_2))
(* 2.0 (- (* z t) t_3))))))
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 = i * (c * t_1);
double t_3 = c * (i * t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((y * x) - t_3);
} else if (t_2 <= 1e+282) {
tmp = 2.0 * (((y * x) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((z * t) - t_3);
}
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 = i * (c * t_1);
double t_3 = c * (i * t_1);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((y * x) - t_3);
} else if (t_2 <= 1e+282) {
tmp = 2.0 * (((y * x) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((z * t) - t_3);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) t_3 = c * (i * t_1) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((y * x) - t_3) elif t_2 <= 1e+282: tmp = 2.0 * (((y * x) + (z * t)) - t_2) else: tmp = 2.0 * ((z * t) - t_3) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) t_3 = Float64(c * Float64(i * t_1)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(y * x) - t_3)); elseif (t_2 <= 1e+282) tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(z * t)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_3)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); t_3 = c * (i * t_1); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((y * x) - t_3); elseif (t_2 <= 1e+282) tmp = 2.0 * (((y * x) + (z * t)) - t_2); else tmp = 2.0 * ((z * t) - t_3); 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+282], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t\_1\right)\\
t_3 := c \cdot \left(i \cdot t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_3\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+282}:\\
\;\;\;\;2 \cdot \left(\left(y \cdot x + z \cdot t\right) - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_3\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 76.0%
Taylor expanded in z around 0 97.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000003e282Initial program 99.9%
if 1.00000000000000003e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 69.4%
Taylor expanded in x around 0 94.9%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* b (* c i))))
(t_2 (* (* c (* i (+ a (* b c)))) -2.0))
(t_3 (* 2.0 (- (* y x) t_1))))
(if (<= c -8.5e+222)
t_3
(if (<= c -8e+183)
t_2
(if (<= c -1.45e+45)
(* 2.0 (- (* z t) t_1))
(if (<= c 7e-81)
(* 2.0 (+ (* y x) (* z t)))
(if (<= c 1.2e+29)
(* 2.0 (- (* y x) (* i (* c a))))
(if (<= c 1.6e+140) t_3 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (b * (c * i));
double t_2 = (c * (i * (a + (b * c)))) * -2.0;
double t_3 = 2.0 * ((y * x) - t_1);
double tmp;
if (c <= -8.5e+222) {
tmp = t_3;
} else if (c <= -8e+183) {
tmp = t_2;
} else if (c <= -1.45e+45) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7e-81) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 1.2e+29) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else if (c <= 1.6e+140) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = c * (b * (c * i))
t_2 = (c * (i * (a + (b * c)))) * (-2.0d0)
t_3 = 2.0d0 * ((y * x) - t_1)
if (c <= (-8.5d+222)) then
tmp = t_3
else if (c <= (-8d+183)) then
tmp = t_2
else if (c <= (-1.45d+45)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 7d-81) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if (c <= 1.2d+29) then
tmp = 2.0d0 * ((y * x) - (i * (c * a)))
else if (c <= 1.6d+140) then
tmp = t_3
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 = c * (b * (c * i));
double t_2 = (c * (i * (a + (b * c)))) * -2.0;
double t_3 = 2.0 * ((y * x) - t_1);
double tmp;
if (c <= -8.5e+222) {
tmp = t_3;
} else if (c <= -8e+183) {
tmp = t_2;
} else if (c <= -1.45e+45) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7e-81) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 1.2e+29) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else if (c <= 1.6e+140) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (b * (c * i)) t_2 = (c * (i * (a + (b * c)))) * -2.0 t_3 = 2.0 * ((y * x) - t_1) tmp = 0 if c <= -8.5e+222: tmp = t_3 elif c <= -8e+183: tmp = t_2 elif c <= -1.45e+45: tmp = 2.0 * ((z * t) - t_1) elif c <= 7e-81: tmp = 2.0 * ((y * x) + (z * t)) elif c <= 1.2e+29: tmp = 2.0 * ((y * x) - (i * (c * a))) elif c <= 1.6e+140: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(b * Float64(c * i))) t_2 = Float64(Float64(c * Float64(i * Float64(a + Float64(b * c)))) * -2.0) t_3 = Float64(2.0 * Float64(Float64(y * x) - t_1)) tmp = 0.0 if (c <= -8.5e+222) tmp = t_3; elseif (c <= -8e+183) tmp = t_2; elseif (c <= -1.45e+45) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 7e-81) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif (c <= 1.2e+29) tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(i * Float64(c * a)))); elseif (c <= 1.6e+140) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (b * (c * i)); t_2 = (c * (i * (a + (b * c)))) * -2.0; t_3 = 2.0 * ((y * x) - t_1); tmp = 0.0; if (c <= -8.5e+222) tmp = t_3; elseif (c <= -8e+183) tmp = t_2; elseif (c <= -1.45e+45) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 7e-81) tmp = 2.0 * ((y * x) + (z * t)); elseif (c <= 1.2e+29) tmp = 2.0 * ((y * x) - (i * (c * a))); elseif (c <= 1.6e+140) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+222], t$95$3, If[LessEqual[c, -8e+183], t$95$2, If[LessEqual[c, -1.45e+45], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7e-81], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.2e+29], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.6e+140], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(b \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\
t_3 := 2 \cdot \left(y \cdot x - t\_1\right)\\
\mathbf{if}\;c \leq -8.5 \cdot 10^{+222}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;c \leq -8 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -1.45 \cdot 10^{+45}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 7 \cdot 10^{-81}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+29}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{elif}\;c \leq 1.6 \cdot 10^{+140}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -8.4999999999999994e222 or 1.2e29 < c < 1.60000000000000005e140Initial program 84.6%
Taylor expanded in z around 0 79.6%
Taylor expanded in a around 0 84.5%
if -8.4999999999999994e222 < c < -7.99999999999999957e183 or 1.60000000000000005e140 < c Initial program 70.4%
Taylor expanded in i around inf 94.3%
Taylor expanded in i around 0 94.3%
if -7.99999999999999957e183 < c < -1.4499999999999999e45Initial program 79.4%
Taylor expanded in x around 0 89.6%
Taylor expanded in a around 0 83.0%
if -1.4499999999999999e45 < c < 6.99999999999999973e-81Initial program 99.0%
Taylor expanded in c around 0 77.6%
if 6.99999999999999973e-81 < c < 1.2e29Initial program 99.8%
Taylor expanded in a around inf 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around 0 82.4%
*-commutative82.4%
*-commutative82.4%
associate-*l*82.3%
*-commutative82.3%
Simplified82.3%
Final simplification82.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* y x) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* (* c i) t_1)))
(* 2.0 (- (* z t) (* c (* b (* c i))))))))
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 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
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 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (y * x) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - ((c * i) * t_1)) else: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(y * x) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(Float64(c * i) * t_1))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (y * x) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - ((c * i) * t_1)); else tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); 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[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(N[(c * i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := y \cdot x + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - \left(c \cdot i\right) \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\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 92.7%
fma-define92.7%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
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 90.0%
Taylor expanded in a around 0 90.1%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -8.6e+56)
(not (or (<= c 5.2e-80) (and (not (<= c 7.8e-7)) (<= c 3.8e+19)))))
(* (* c (* i (+ a (* b c)))) -2.0)
(* 2.0 (+ (* y x) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.6e+56) || !((c <= 5.2e-80) || (!(c <= 7.8e-7) && (c <= 3.8e+19)))) {
tmp = (c * (i * (a + (b * c)))) * -2.0;
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-8.6d+56)) .or. (.not. (c <= 5.2d-80) .or. (.not. (c <= 7.8d-7)) .and. (c <= 3.8d+19))) then
tmp = (c * (i * (a + (b * c)))) * (-2.0d0)
else
tmp = 2.0d0 * ((y * x) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.6e+56) || !((c <= 5.2e-80) || (!(c <= 7.8e-7) && (c <= 3.8e+19)))) {
tmp = (c * (i * (a + (b * c)))) * -2.0;
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8.6e+56) or not ((c <= 5.2e-80) or (not (c <= 7.8e-7) and (c <= 3.8e+19))): tmp = (c * (i * (a + (b * c)))) * -2.0 else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8.6e+56) || !((c <= 5.2e-80) || (!(c <= 7.8e-7) && (c <= 3.8e+19)))) tmp = Float64(Float64(c * Float64(i * Float64(a + Float64(b * c)))) * -2.0); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8.6e+56) || ~(((c <= 5.2e-80) || (~((c <= 7.8e-7)) && (c <= 3.8e+19))))) tmp = (c * (i * (a + (b * c)))) * -2.0; else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8.6e+56], N[Not[Or[LessEqual[c, 5.2e-80], And[N[Not[LessEqual[c, 7.8e-7]], $MachinePrecision], LessEqual[c, 3.8e+19]]]], $MachinePrecision]], N[(N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.6 \cdot 10^{+56} \lor \neg \left(c \leq 5.2 \cdot 10^{-80} \lor \neg \left(c \leq 7.8 \cdot 10^{-7}\right) \land c \leq 3.8 \cdot 10^{+19}\right):\\
\;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if c < -8.6000000000000007e56 or 5.2000000000000002e-80 < c < 7.80000000000000049e-7 or 3.8e19 < c Initial program 78.8%
Taylor expanded in i around inf 79.5%
Taylor expanded in i around 0 79.5%
if -8.6000000000000007e56 < c < 5.2000000000000002e-80 or 7.80000000000000049e-7 < c < 3.8e19Initial program 99.1%
Taylor expanded in c around 0 77.7%
Final simplification78.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* i (+ a (* b c))))))))
(if (<= c -3.5e-48)
t_1
(if (<= c 2.9e-87)
(* 2.0 (+ (* y x) (* z t)))
(if (<= c 9.2e+18) (* 2.0 (- (* y x) (* i (* c a)))) 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 * ((z * t) - (c * (i * (a + (b * c)))));
double tmp;
if (c <= -3.5e-48) {
tmp = t_1;
} else if (c <= 2.9e-87) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 9.2e+18) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} 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 * ((z * t) - (c * (i * (a + (b * c)))))
if (c <= (-3.5d-48)) then
tmp = t_1
else if (c <= 2.9d-87) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if (c <= 9.2d+18) then
tmp = 2.0d0 * ((y * x) - (i * (c * a)))
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 * ((z * t) - (c * (i * (a + (b * c)))));
double tmp;
if (c <= -3.5e-48) {
tmp = t_1;
} else if (c <= 2.9e-87) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 9.2e+18) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * (i * (a + (b * c))))) tmp = 0 if c <= -3.5e-48: tmp = t_1 elif c <= 2.9e-87: tmp = 2.0 * ((y * x) + (z * t)) elif c <= 9.2e+18: tmp = 2.0 * ((y * x) - (i * (c * a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(b * c)))))) tmp = 0.0 if (c <= -3.5e-48) tmp = t_1; elseif (c <= 2.9e-87) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif (c <= 9.2e+18) tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(i * Float64(c * a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((z * t) - (c * (i * (a + (b * c))))); tmp = 0.0; if (c <= -3.5e-48) tmp = t_1; elseif (c <= 2.9e-87) tmp = 2.0 * ((y * x) + (z * t)); elseif (c <= 9.2e+18) tmp = 2.0 * ((y * x) - (i * (c * a))); 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[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.5e-48], t$95$1, If[LessEqual[c, 2.9e-87], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e+18], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -3.5 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{-87}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{+18}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.49999999999999991e-48 or 9.2e18 < c Initial program 78.9%
Taylor expanded in x around 0 86.5%
if -3.49999999999999991e-48 < c < 2.8999999999999999e-87Initial program 99.9%
Taylor expanded in c around 0 79.5%
if 2.8999999999999999e-87 < c < 9.2e18Initial program 99.7%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around 0 80.3%
*-commutative80.3%
*-commutative80.3%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
Final simplification83.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (+ a (* b c))))) (t_2 (* 2.0 (- (* z t) t_1))))
(if (<= c -3.8e-48)
t_2
(if (<= c 5e-82)
(* 2.0 (+ (* y x) (* z t)))
(if (<= c 2.3e+128) (* 2.0 (- (* y x) 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 = c * (i * (a + (b * c)));
double t_2 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -3.8e-48) {
tmp = t_2;
} else if (c <= 5e-82) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 2.3e+128) {
tmp = 2.0 * ((y * x) - 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 = c * (i * (a + (b * c)))
t_2 = 2.0d0 * ((z * t) - t_1)
if (c <= (-3.8d-48)) then
tmp = t_2
else if (c <= 5d-82) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if (c <= 2.3d+128) then
tmp = 2.0d0 * ((y * x) - 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 = c * (i * (a + (b * c)));
double t_2 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -3.8e-48) {
tmp = t_2;
} else if (c <= 5e-82) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 2.3e+128) {
tmp = 2.0 * ((y * x) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (i * (a + (b * c))) t_2 = 2.0 * ((z * t) - t_1) tmp = 0 if c <= -3.8e-48: tmp = t_2 elif c <= 5e-82: tmp = 2.0 * ((y * x) + (z * t)) elif c <= 2.3e+128: tmp = 2.0 * ((y * x) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(a + Float64(b * c)))) t_2 = Float64(2.0 * Float64(Float64(z * t) - t_1)) tmp = 0.0 if (c <= -3.8e-48) tmp = t_2; elseif (c <= 5e-82) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif (c <= 2.3e+128) tmp = Float64(2.0 * Float64(Float64(y * x) - t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (i * (a + (b * c))); t_2 = 2.0 * ((z * t) - t_1); tmp = 0.0; if (c <= -3.8e-48) tmp = t_2; elseif (c <= 5e-82) tmp = 2.0 * ((y * x) + (z * t)); elseif (c <= 2.3e+128) tmp = 2.0 * ((y * x) - 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[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.8e-48], t$95$2, If[LessEqual[c, 5e-82], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.3e+128], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{if}\;c \leq -3.8 \cdot 10^{-48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 5 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{+128}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -3.80000000000000002e-48 or 2.29999999999999998e128 < c Initial program 76.6%
Taylor expanded in x around 0 87.9%
if -3.80000000000000002e-48 < c < 4.9999999999999998e-82Initial program 99.9%
Taylor expanded in c around 0 79.5%
if 4.9999999999999998e-82 < c < 2.29999999999999998e128Initial program 97.1%
Taylor expanded in z around 0 86.2%
Final simplification84.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* i (+ a (* b c)))) -2.0)))
(if (<= c -1.95e+57)
t_1
(if (<= c 4.1e-84)
(* 2.0 (+ (* y x) (* z t)))
(if (<= c 8.5e+19) (* 2.0 (- (* y x) (* i (* c a)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * (i * (a + (b * c)))) * -2.0;
double tmp;
if (c <= -1.95e+57) {
tmp = t_1;
} else if (c <= 4.1e-84) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 8.5e+19) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * (i * (a + (b * c)))) * (-2.0d0)
if (c <= (-1.95d+57)) then
tmp = t_1
else if (c <= 4.1d-84) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if (c <= 8.5d+19) then
tmp = 2.0d0 * ((y * x) - (i * (c * a)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * (i * (a + (b * c)))) * -2.0;
double tmp;
if (c <= -1.95e+57) {
tmp = t_1;
} else if (c <= 4.1e-84) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 8.5e+19) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * (i * (a + (b * c)))) * -2.0 tmp = 0 if c <= -1.95e+57: tmp = t_1 elif c <= 4.1e-84: tmp = 2.0 * ((y * x) + (z * t)) elif c <= 8.5e+19: tmp = 2.0 * ((y * x) - (i * (c * a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(i * Float64(a + Float64(b * c)))) * -2.0) tmp = 0.0 if (c <= -1.95e+57) tmp = t_1; elseif (c <= 4.1e-84) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif (c <= 8.5e+19) tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(i * Float64(c * a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * (i * (a + (b * c)))) * -2.0; tmp = 0.0; if (c <= -1.95e+57) tmp = t_1; elseif (c <= 4.1e-84) tmp = 2.0 * ((y * x) + (z * t)); elseif (c <= 8.5e+19) tmp = 2.0 * ((y * x) - (i * (c * a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.95e+57], t$95$1, If[LessEqual[c, 4.1e-84], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.5e+19], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -1.95 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4.1 \cdot 10^{-84}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{+19}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.94999999999999984e57 or 8.5e19 < c Initial program 76.7%
Taylor expanded in i around inf 80.7%
Taylor expanded in i around 0 80.7%
if -1.94999999999999984e57 < c < 4.10000000000000005e-84Initial program 99.1%
Taylor expanded in c around 0 76.8%
if 4.10000000000000005e-84 < c < 8.5e19Initial program 99.7%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around 0 80.3%
*-commutative80.3%
*-commutative80.3%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
Final simplification78.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -3.8e+42)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (<= c 5.4e-80)
(* 2.0 (+ (* y x) (* z t)))
(if (<= c 3.2e+19)
(* 2.0 (- (* y x) (* i (* c a))))
(* (* c (* i (+ a (* b c)))) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3.8e+42) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 5.4e-80) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 3.2e+19) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else {
tmp = (c * (i * (a + (b * c)))) * -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 <= (-3.8d+42)) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if (c <= 5.4d-80) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if (c <= 3.2d+19) then
tmp = 2.0d0 * ((y * x) - (i * (c * a)))
else
tmp = (c * (i * (a + (b * c)))) * (-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 <= -3.8e+42) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 5.4e-80) {
tmp = 2.0 * ((y * x) + (z * t));
} else if (c <= 3.2e+19) {
tmp = 2.0 * ((y * x) - (i * (c * a)));
} else {
tmp = (c * (i * (a + (b * c)))) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -3.8e+42: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif c <= 5.4e-80: tmp = 2.0 * ((y * x) + (z * t)) elif c <= 3.2e+19: tmp = 2.0 * ((y * x) - (i * (c * a))) else: tmp = (c * (i * (a + (b * c)))) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -3.8e+42) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 5.4e-80) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif (c <= 3.2e+19) tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(i * Float64(c * a)))); else tmp = Float64(Float64(c * Float64(i * Float64(a + Float64(b * c)))) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -3.8e+42) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); elseif (c <= 5.4e-80) tmp = 2.0 * ((y * x) + (z * t)); elseif (c <= 3.2e+19) tmp = 2.0 * ((y * x) - (i * (c * a))); else tmp = (c * (i * (a + (b * c)))) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -3.8e+42], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.4e-80], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.2e+19], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+42}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 5.4 \cdot 10^{-80}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+19}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\
\end{array}
\end{array}
if c < -3.7999999999999998e42Initial program 76.2%
Taylor expanded in x around 0 86.5%
Taylor expanded in a around 0 79.3%
if -3.7999999999999998e42 < c < 5.4000000000000004e-80Initial program 99.0%
Taylor expanded in c around 0 77.6%
if 5.4000000000000004e-80 < c < 3.2e19Initial program 99.7%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around 0 80.3%
*-commutative80.3%
*-commutative80.3%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
if 3.2e19 < c Initial program 78.6%
Taylor expanded in i around inf 82.9%
Taylor expanded in i around 0 82.9%
Final simplification79.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.65e+42) (not (<= c 9e+19))) (* 2.0 (- (* z t) (* c (* i (+ a (* b c)))))) (* 2.0 (- (+ (* y x) (* z t)) (* i (* c a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.65e+42) || !(c <= 9e+19)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} else {
tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a)));
}
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 <= (-1.65d+42)) .or. (.not. (c <= 9d+19))) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (b * c)))))
else
tmp = 2.0d0 * (((y * x) + (z * t)) - (i * (c * a)))
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 <= -1.65e+42) || !(c <= 9e+19)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} else {
tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.65e+42) or not (c <= 9e+19): tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))) else: tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.65e+42) || !(c <= 9e+19)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(b * c)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(z * t)) - Float64(i * Float64(c * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.65e+42) || ~((c <= 9e+19))) tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))); else tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.65e+42], N[Not[LessEqual[c, 9e+19]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.65 \cdot 10^{+42} \lor \neg \left(c \leq 9 \cdot 10^{+19}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(y \cdot x + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -1.6499999999999999e42 or 9e19 < c Initial program 77.4%
Taylor expanded in x around 0 88.7%
if -1.6499999999999999e42 < c < 9e19Initial program 99.1%
Taylor expanded in a around inf 93.2%
*-commutative93.2%
Simplified93.2%
Final simplification91.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -7.8e+130)
t_1
(if (<= z -1.22e-45)
(* -2.0 (* a (* c i)))
(if (<= z 1.06e-175) (* 2.0 (* y x)) 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 * (z * t);
double tmp;
if (z <= -7.8e+130) {
tmp = t_1;
} else if (z <= -1.22e-45) {
tmp = -2.0 * (a * (c * i));
} else if (z <= 1.06e-175) {
tmp = 2.0 * (y * x);
} 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 * (z * t)
if (z <= (-7.8d+130)) then
tmp = t_1
else if (z <= (-1.22d-45)) then
tmp = (-2.0d0) * (a * (c * i))
else if (z <= 1.06d-175) then
tmp = 2.0d0 * (y * x)
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 * (z * t);
double tmp;
if (z <= -7.8e+130) {
tmp = t_1;
} else if (z <= -1.22e-45) {
tmp = -2.0 * (a * (c * i));
} else if (z <= 1.06e-175) {
tmp = 2.0 * (y * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if z <= -7.8e+130: tmp = t_1 elif z <= -1.22e-45: tmp = -2.0 * (a * (c * i)) elif z <= 1.06e-175: tmp = 2.0 * (y * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -7.8e+130) tmp = t_1; elseif (z <= -1.22e-45) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (z <= 1.06e-175) tmp = Float64(2.0 * Float64(y * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (z <= -7.8e+130) tmp = t_1; elseif (z <= -1.22e-45) tmp = -2.0 * (a * (c * i)); elseif (z <= 1.06e-175) tmp = 2.0 * (y * x); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+130], t$95$1, If[LessEqual[z, -1.22e-45], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e-175], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-45}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-175}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.8000000000000004e130 or 1.06000000000000002e-175 < z Initial program 89.4%
Taylor expanded in z around inf 41.6%
if -7.8000000000000004e130 < z < -1.22000000000000007e-45Initial program 85.9%
fma-define86.0%
associate-*l*96.3%
Simplified96.3%
fma-define96.3%
+-commutative96.3%
Applied egg-rr96.3%
Taylor expanded in a around inf 29.3%
mul-1-neg29.3%
*-commutative29.3%
associate-*r*25.8%
distribute-rgt-neg-in25.8%
distribute-rgt-neg-in25.8%
Simplified25.8%
Taylor expanded in c around 0 29.3%
if -1.22000000000000007e-45 < z < 1.06000000000000002e-175Initial program 90.6%
Taylor expanded in x around inf 28.8%
Final simplification34.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -1.2e+107) (not (<= z 1.06e-175))) (* 2.0 (* z t)) (* 2.0 (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.2e+107) || !(z <= 1.06e-175)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (y * x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z <= (-1.2d+107)) .or. (.not. (z <= 1.06d-175))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.2e+107) || !(z <= 1.06e-175)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (y * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -1.2e+107) or not (z <= 1.06e-175): tmp = 2.0 * (z * t) else: tmp = 2.0 * (y * x) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -1.2e+107) || !(z <= 1.06e-175)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -1.2e+107) || ~((z <= 1.06e-175))) tmp = 2.0 * (z * t); else tmp = 2.0 * (y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -1.2e+107], N[Not[LessEqual[z, 1.06e-175]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+107} \lor \neg \left(z \leq 1.06 \cdot 10^{-175}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if z < -1.2e107 or 1.06000000000000002e-175 < z Initial program 88.4%
Taylor expanded in z around inf 42.0%
if -1.2e107 < z < 1.06000000000000002e-175Initial program 89.6%
Taylor expanded in x around inf 26.2%
Final simplification34.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= i -2.4e+205) (* -2.0 (* a (* c i))) (* 2.0 (+ (* y x) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -2.4e+205) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((y * x) + (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 (i <= (-2.4d+205)) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = 2.0d0 * ((y * x) + (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 (i <= -2.4e+205) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -2.4e+205: tmp = -2.0 * (a * (c * i)) else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -2.4e+205) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (i <= -2.4e+205) tmp = -2.0 * (a * (c * i)); else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -2.4e+205], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.4 \cdot 10^{+205}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if i < -2.39999999999999986e205Initial program 95.1%
fma-define95.1%
associate-*l*95.3%
Simplified95.3%
fma-define95.3%
+-commutative95.3%
Applied egg-rr95.3%
Taylor expanded in a around inf 71.4%
mul-1-neg71.4%
*-commutative71.4%
associate-*r*43.3%
distribute-rgt-neg-in43.3%
distribute-rgt-neg-in43.3%
Simplified43.3%
Taylor expanded in c around 0 71.4%
if -2.39999999999999986e205 < i Initial program 88.5%
Taylor expanded in c around 0 55.3%
Final simplification56.7%
(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 89.0%
Taylor expanded in z around inf 29.2%
Final simplification29.2%
(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 2024039
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))