
(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 14 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 (* y (- x (* c (/ (* i (fma b c a)) 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 * ((i * fma(b, c, a)) / 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(c * Float64(Float64(i * fma(b, c, a)) / y))))); 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[(y * N[(x - N[(c * N[(N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision] / y), $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(y \cdot \left(x - c \cdot \frac{i \cdot \mathsf{fma}\left(b, c, a\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.6%
fma-define94.6%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
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 inf 44.4%
Taylor expanded in y around inf 88.9%
mul-1-neg88.9%
unsub-neg88.9%
associate-/l*88.9%
+-commutative88.9%
fma-undefine88.9%
Simplified88.9%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* x y) t_3))
(if (<= t_2 2e+55)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c (* b c)))))
(if (<= t_2 2e+305) (* 2.0 (- (* x y) t_2)) (* -2.0 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 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((x * y) - t_3);
} else if (t_2 <= 2e+55) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_2 <= 2e+305) {
tmp = 2.0 * ((x * y) - t_2);
} else {
tmp = -2.0 * 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 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((x * y) - t_3);
} else if (t_2 <= 2e+55) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_2 <= 2e+305) {
tmp = 2.0 * ((x * y) - t_2);
} else {
tmp = -2.0 * t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i t_3 = c * (t_1 * i) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((x * y) - t_3) elif t_2 <= 2e+55: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))) elif t_2 <= 2e+305: tmp = 2.0 * ((x * y) - t_2) else: tmp = -2.0 * t_3 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) t_3 = Float64(c * Float64(t_1 * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); elseif (t_2 <= 2e+55) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(b * c))))); elseif (t_2 <= 2e+305) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); else tmp = Float64(-2.0 * 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 = (c * t_1) * i; t_3 = c * (t_1 * i); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((x * y) - t_3); elseif (t_2 <= 2e+55) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))); elseif (t_2 <= 2e+305) tmp = 2.0 * ((x * y) - t_2); else tmp = -2.0 * 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[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+55], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+305], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := c \cdot \left(t\_1 \cdot i\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+55}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 86.7%
fma-define86.7%
*-commutative86.7%
associate-*l*94.2%
+-commutative94.2%
fma-define94.2%
Simplified94.2%
Taylor expanded in z around 0 92.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000002e55Initial program 99.2%
Taylor expanded in a around 0 91.4%
*-commutative91.4%
Simplified91.4%
if 2.00000000000000002e55 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e305Initial program 99.7%
Taylor expanded in x around inf 90.3%
if 1.9999999999999999e305 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.6%
fma-define76.6%
*-commutative76.6%
associate-*l*84.0%
+-commutative84.0%
fma-define84.0%
Simplified84.0%
Taylor expanded in i around inf 90.8%
Final simplification91.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* (* c t_1) i)))
(if (<= t_3 -2e+52)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 1e-17)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 2e+305) (* 2.0 (- (* x y) t_3)) (* -2.0 t_2))))))
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 t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -2e+52) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 2e+305) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * 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 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = (c * t_1) * i
if (t_3 <= (-2d+52)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 1d-17) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (t_3 <= 2d+305) then
tmp = 2.0d0 * ((x * y) - t_3)
else
tmp = (-2.0d0) * 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -2e+52) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 2e+305) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = (c * t_1) * i tmp = 0 if t_3 <= -2e+52: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 1e-17: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 2e+305: tmp = 2.0 * ((x * y) - t_3) else: tmp = -2.0 * t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_3 <= -2e+52) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 1e-17) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 2e+305) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); else tmp = Float64(-2.0 * t_2); 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); t_3 = (c * t_1) * i; tmp = 0.0; if (t_3 <= -2e+52) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 1e-17) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 2e+305) tmp = 2.0 * ((x * y) - t_3); else tmp = -2.0 * t_2; 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[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+52], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 2e+305], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-17}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52Initial program 90.9%
fma-define90.9%
*-commutative90.9%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in x around 0 85.7%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000007e-17Initial program 98.9%
fma-define98.9%
*-commutative98.9%
associate-*l*100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 94.9%
if 1.00000000000000007e-17 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e305Initial program 99.7%
Taylor expanded in x around inf 85.6%
if 1.9999999999999999e305 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.6%
fma-define76.6%
*-commutative76.6%
associate-*l*84.0%
+-commutative84.0%
fma-define84.0%
Simplified84.0%
Taylor expanded in i around inf 90.8%
Final simplification90.1%
(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 (* c (* t_1 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 = (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 * (c * (t_1 * 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 = (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 * (c * (t_1 * i));
}
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 * (c * (t_1 * i)) 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(c * Float64(t_1 * i))); 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 * (c * (t_1 * 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[(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[(c * N[(t$95$1 * i), $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(c \cdot \left(t\_1 \cdot i\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.6%
fma-define94.6%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define0.0%
*-commutative0.0%
associate-*l*0.0%
+-commutative0.0%
fma-define0.0%
Simplified0.0%
Taylor expanded in i around inf 88.9%
Final simplification98.0%
(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 2e+305)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* -2.0 (* c (* t_1 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 = (c * t_1) * i;
double tmp;
if (t_2 <= 2e+305) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if (t_2 <= 2d+305) then
tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
else
tmp = (-2.0d0) * (c * (t_1 * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= 2e+305) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
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 <= 2e+305: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) 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 <= 2e+305) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); 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 <= 2e+305) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = -2.0 * (c * (t_1 * 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[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+305], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $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 2 \cdot 10^{+305}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e305Initial program 95.9%
if 1.9999999999999999e305 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.6%
fma-define76.6%
*-commutative76.6%
associate-*l*84.0%
+-commutative84.0%
fma-define84.0%
Simplified84.0%
Taylor expanded in i around inf 90.8%
Final simplification94.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.95e-140)
(* 2.0 (- (* z t) t_1))
(if (<= c 7e-69) (* (+ (* x y) (* z t)) 2.0) (* 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.95e-140) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7e-69) {
tmp = ((x * y) + (z * t)) * 2.0;
} 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.95d-140)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 7d-69) then
tmp = ((x * y) + (z * t)) * 2.0d0
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.95e-140) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7e-69) {
tmp = ((x * y) + (z * t)) * 2.0;
} 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.95e-140: tmp = 2.0 * ((z * t) - t_1) elif c <= 7e-69: tmp = ((x * y) + (z * t)) * 2.0 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.95e-140) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 7e-69) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); 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.95e-140) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 7e-69) tmp = ((x * y) + (z * t)) * 2.0; 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.95e-140], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7e-69], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $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.95 \cdot 10^{-140}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 7 \cdot 10^{-69}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -1.9500000000000001e-140Initial program 89.4%
fma-define89.4%
*-commutative89.4%
associate-*l*92.7%
+-commutative92.7%
fma-define92.7%
Simplified92.7%
Taylor expanded in x around 0 84.0%
if -1.9500000000000001e-140 < c < 7.0000000000000003e-69Initial program 98.8%
fma-define98.8%
*-commutative98.8%
associate-*l*90.1%
+-commutative90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in c around 0 85.6%
if 7.0000000000000003e-69 < c Initial program 85.2%
fma-define85.2%
*-commutative85.2%
associate-*l*87.5%
+-commutative87.5%
fma-define87.5%
Simplified87.5%
Taylor expanded in z around 0 86.9%
Final simplification85.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -5.2e-60)
t_1
(if (<= c 9e-177)
(* x (* y 2.0))
(if (<= c 1.1e+39) (* t (* z 2.0)) 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 * (b * (c * i)));
double tmp;
if (c <= -5.2e-60) {
tmp = t_1;
} else if (c <= 9e-177) {
tmp = x * (y * 2.0);
} else if (c <= 1.1e+39) {
tmp = t * (z * 2.0);
} 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 * (b * (c * i)))
if (c <= (-5.2d-60)) then
tmp = t_1
else if (c <= 9d-177) then
tmp = x * (y * 2.0d0)
else if (c <= 1.1d+39) then
tmp = t * (z * 2.0d0)
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 * (b * (c * i)));
double tmp;
if (c <= -5.2e-60) {
tmp = t_1;
} else if (c <= 9e-177) {
tmp = x * (y * 2.0);
} else if (c <= 1.1e+39) {
tmp = t * (z * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -5.2e-60: tmp = t_1 elif c <= 9e-177: tmp = x * (y * 2.0) elif c <= 1.1e+39: tmp = t * (z * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -5.2e-60) tmp = t_1; elseif (c <= 9e-177) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 1.1e+39) tmp = Float64(t * Float64(z * 2.0)); 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 * (b * (c * i))); tmp = 0.0; if (c <= -5.2e-60) tmp = t_1; elseif (c <= 9e-177) tmp = x * (y * 2.0); elseif (c <= 1.1e+39) tmp = t * (z * 2.0); 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[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.2e-60], t$95$1, If[LessEqual[c, 9e-177], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.1e+39], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -5.2 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 9 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.1 \cdot 10^{+39}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.1999999999999995e-60 or 1.1000000000000001e39 < c Initial program 84.9%
fma-define84.9%
*-commutative84.9%
associate-*l*90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in i around inf 79.6%
Taylor expanded in a around 0 67.5%
if -5.1999999999999995e-60 < c < 9.0000000000000007e-177Initial program 98.5%
fma-define98.5%
*-commutative98.5%
associate-*l*90.3%
+-commutative90.3%
fma-define90.3%
Simplified90.3%
Taylor expanded in x around inf 54.8%
*-commutative54.8%
associate-*l*54.8%
Simplified54.8%
if 9.0000000000000007e-177 < c < 1.1000000000000001e39Initial program 99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*88.3%
+-commutative88.3%
fma-define88.3%
Simplified88.3%
Taylor expanded in z around inf 49.2%
*-commutative49.2%
*-commutative49.2%
*-commutative49.2%
associate-*r*49.2%
Simplified49.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))))
(if (<= c -8e+32)
t_1
(if (<= c 5.4e-179)
(* x (* y 2.0))
(if (<= c 1.9e+59) (* t (* z 2.0)) 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 * (a * (c * i));
double tmp;
if (c <= -8e+32) {
tmp = t_1;
} else if (c <= 5.4e-179) {
tmp = x * (y * 2.0);
} else if (c <= 1.9e+59) {
tmp = t * (z * 2.0);
} 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) * (a * (c * i))
if (c <= (-8d+32)) then
tmp = t_1
else if (c <= 5.4d-179) then
tmp = x * (y * 2.0d0)
else if (c <= 1.9d+59) then
tmp = t * (z * 2.0d0)
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 * (a * (c * i));
double tmp;
if (c <= -8e+32) {
tmp = t_1;
} else if (c <= 5.4e-179) {
tmp = x * (y * 2.0);
} else if (c <= 1.9e+59) {
tmp = t * (z * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) tmp = 0 if c <= -8e+32: tmp = t_1 elif c <= 5.4e-179: tmp = x * (y * 2.0) elif c <= 1.9e+59: tmp = t * (z * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) tmp = 0.0 if (c <= -8e+32) tmp = t_1; elseif (c <= 5.4e-179) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 1.9e+59) tmp = Float64(t * Float64(z * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); tmp = 0.0; if (c <= -8e+32) tmp = t_1; elseif (c <= 5.4e-179) tmp = x * (y * 2.0); elseif (c <= 1.9e+59) tmp = t * (z * 2.0); 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+32], t$95$1, If[LessEqual[c, 5.4e-179], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.9e+59], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;c \leq -8 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.4 \cdot 10^{-179}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.9 \cdot 10^{+59}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -8.00000000000000043e32 or 1.9e59 < c Initial program 84.3%
fma-define84.3%
*-commutative84.3%
associate-*l*91.1%
+-commutative91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in a around inf 40.4%
if -8.00000000000000043e32 < c < 5.39999999999999977e-179Initial program 98.7%
fma-define98.7%
*-commutative98.7%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in x around inf 51.2%
*-commutative51.2%
associate-*l*51.2%
Simplified51.2%
if 5.39999999999999977e-179 < c < 1.9e59Initial program 96.1%
fma-define96.1%
*-commutative96.1%
associate-*l*85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in z around inf 48.4%
*-commutative48.4%
*-commutative48.4%
*-commutative48.4%
associate-*r*48.4%
Simplified48.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.1e+34) (not (<= c 1.15e+35))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* 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 <= -4.1e+34) || !(c <= 1.15e+35)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} 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 <= (-4.1d+34)) .or. (.not. (c <= 1.15d+35))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
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 <= -4.1e+34) || !(c <= 1.15e+35)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4.1e+34) or not (c <= 1.15e+35): tmp = -2.0 * (c * ((a + (b * c)) * i)) 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 <= -4.1e+34) || !(c <= 1.15e+35)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); 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 <= -4.1e+34) || ~((c <= 1.15e+35))) tmp = -2.0 * (c * ((a + (b * c)) * i)); 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, -4.1e+34], N[Not[LessEqual[c, 1.15e+35]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $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 -4.1 \cdot 10^{+34} \lor \neg \left(c \leq 1.15 \cdot 10^{+35}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -4.0999999999999998e34 or 1.1499999999999999e35 < c Initial program 83.4%
fma-define83.4%
*-commutative83.4%
associate-*l*89.9%
+-commutative89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in i around inf 83.5%
if -4.0999999999999998e34 < c < 1.1499999999999999e35Initial program 99.2%
fma-define99.2%
*-commutative99.2%
associate-*l*90.5%
+-commutative90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in c around 0 76.8%
Final simplification80.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -5.2e-140)
(* 2.0 (- (* z t) t_1))
(if (<= c 3.8e+35) (* (+ (* x y) (* z t)) 2.0) (* -2.0 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 <= -5.2e-140) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 3.8e+35) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * 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 <= (-5.2d-140)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 3.8d+35) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * 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 <= -5.2e-140) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 3.8e+35) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * 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 <= -5.2e-140: tmp = 2.0 * ((z * t) - t_1) elif c <= 3.8e+35: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * 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 <= -5.2e-140) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 3.8e+35) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * 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 <= -5.2e-140) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 3.8e+35) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * 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, -5.2e-140], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e+35], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * t$95$1), $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 -5.2 \cdot 10^{-140}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{+35}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_1\\
\end{array}
\end{array}
if c < -5.1999999999999996e-140Initial program 89.4%
fma-define89.4%
*-commutative89.4%
associate-*l*92.7%
+-commutative92.7%
fma-define92.7%
Simplified92.7%
Taylor expanded in x around 0 84.0%
if -5.1999999999999996e-140 < c < 3.8e35Initial program 99.0%
fma-define99.0%
*-commutative99.0%
associate-*l*90.0%
+-commutative90.0%
fma-define90.0%
Simplified90.0%
Taylor expanded in c around 0 81.4%
if 3.8e35 < c Initial program 81.2%
fma-define81.2%
*-commutative81.2%
associate-*l*87.0%
+-commutative87.0%
fma-define87.0%
Simplified87.0%
Taylor expanded in i around inf 87.8%
Final simplification83.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.7e+54) (not (<= c 3.2e+41))) (* -2.0 (* c (* b (* c i)))) (* (+ (* 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 <= -4.7e+54) || !(c <= 3.2e+41)) {
tmp = -2.0 * (c * (b * (c * i)));
} 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 <= (-4.7d+54)) .or. (.not. (c <= 3.2d+41))) then
tmp = (-2.0d0) * (c * (b * (c * i)))
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 <= -4.7e+54) || !(c <= 3.2e+41)) {
tmp = -2.0 * (c * (b * (c * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4.7e+54) or not (c <= 3.2e+41): tmp = -2.0 * (c * (b * (c * i))) 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 <= -4.7e+54) || !(c <= 3.2e+41)) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); 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 <= -4.7e+54) || ~((c <= 3.2e+41))) tmp = -2.0 * (c * (b * (c * i))); 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, -4.7e+54], N[Not[LessEqual[c, 3.2e+41]], $MachinePrecision]], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $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 -4.7 \cdot 10^{+54} \lor \neg \left(c \leq 3.2 \cdot 10^{+41}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -4.69999999999999993e54 or 3.2000000000000001e41 < c Initial program 82.8%
fma-define82.8%
*-commutative82.8%
associate-*l*89.6%
+-commutative89.6%
fma-define89.6%
Simplified89.6%
Taylor expanded in i around inf 84.6%
Taylor expanded in a around 0 72.5%
if -4.69999999999999993e54 < c < 3.2000000000000001e41Initial program 99.2%
fma-define99.2%
*-commutative99.2%
associate-*l*90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in c around 0 76.0%
Final simplification74.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.26e+55)
(* -2.0 (* c (* b (* c i))))
(if (<= c 3.6e+43)
(* (+ (* x y) (* z t)) 2.0)
(* b (* (* i -2.0) (* c c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.26e+55) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 3.6e+43) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = b * ((i * -2.0) * (c * 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 (c <= (-2.26d+55)) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else if (c <= 3.6d+43) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = b * ((i * (-2.0d0)) * (c * 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 (c <= -2.26e+55) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 3.6e+43) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = b * ((i * -2.0) * (c * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.26e+55: tmp = -2.0 * (c * (b * (c * i))) elif c <= 3.6e+43: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = b * ((i * -2.0) * (c * c)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.26e+55) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); elseif (c <= 3.6e+43) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(b * Float64(Float64(i * -2.0) * Float64(c * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.26e+55) tmp = -2.0 * (c * (b * (c * i))); elseif (c <= 3.6e+43) tmp = ((x * y) + (z * t)) * 2.0; else tmp = b * ((i * -2.0) * (c * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.26e+55], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.6e+43], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(b * N[(N[(i * -2.0), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.26 \cdot 10^{+55}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{+43}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(i \cdot -2\right) \cdot \left(c \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -2.2600000000000001e55Initial program 84.5%
fma-define84.5%
*-commutative84.5%
associate-*l*92.1%
+-commutative92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in i around inf 81.4%
Taylor expanded in a around 0 73.0%
if -2.2600000000000001e55 < c < 3.6000000000000001e43Initial program 99.2%
fma-define99.2%
*-commutative99.2%
associate-*l*90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in c around 0 76.0%
if 3.6000000000000001e43 < c Initial program 81.2%
fma-define81.2%
*-commutative81.2%
associate-*l*87.0%
+-commutative87.0%
fma-define87.0%
Simplified87.0%
Taylor expanded in c around inf 74.8%
*-commutative74.8%
associate-*r*74.8%
*-commutative74.8%
*-commutative74.8%
associate-*r*74.8%
Simplified74.8%
unpow274.8%
Applied egg-rr74.8%
Final simplification75.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -13600000.0) (not (<= z 3.4e-72))) (* t (* z 2.0)) (* x (* y 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -13600000.0) || !(z <= 3.4e-72)) {
tmp = t * (z * 2.0);
} else {
tmp = x * (y * 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 ((z <= (-13600000.0d0)) .or. (.not. (z <= 3.4d-72))) then
tmp = t * (z * 2.0d0)
else
tmp = x * (y * 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 ((z <= -13600000.0) || !(z <= 3.4e-72)) {
tmp = t * (z * 2.0);
} else {
tmp = x * (y * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -13600000.0) or not (z <= 3.4e-72): tmp = t * (z * 2.0) else: tmp = x * (y * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -13600000.0) || !(z <= 3.4e-72)) tmp = Float64(t * Float64(z * 2.0)); else tmp = Float64(x * Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -13600000.0) || ~((z <= 3.4e-72))) tmp = t * (z * 2.0); else tmp = x * (y * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -13600000.0], N[Not[LessEqual[z, 3.4e-72]], $MachinePrecision]], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13600000 \lor \neg \left(z \leq 3.4 \cdot 10^{-72}\right):\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if z < -1.36e7 or 3.3999999999999998e-72 < z Initial program 89.4%
fma-define89.4%
*-commutative89.4%
associate-*l*88.8%
+-commutative88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in z around inf 36.6%
*-commutative36.6%
*-commutative36.6%
*-commutative36.6%
associate-*r*36.6%
Simplified36.6%
if -1.36e7 < z < 3.3999999999999998e-72Initial program 93.7%
fma-define93.7%
*-commutative93.7%
associate-*l*92.2%
+-commutative92.2%
fma-define92.2%
Simplified92.2%
Taylor expanded in x around inf 39.9%
*-commutative39.9%
associate-*l*39.9%
Simplified39.9%
Final simplification38.0%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
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 = t * (z * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 91.3%
fma-define91.3%
*-commutative91.3%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in z around inf 24.5%
*-commutative24.5%
*-commutative24.5%
*-commutative24.5%
associate-*r*24.5%
Simplified24.5%
(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 2024165
(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
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))