
(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 13 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))))
(* y (+ (* -2.0 (/ (* c (* t_1 i)) y)) (* x 2.0))))))
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 = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0));
}
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 = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0));
}
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 = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0)) 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(y * Float64(Float64(-2.0 * Float64(Float64(c * Float64(t_1 * i)) / y)) + Float64(x * 2.0))); 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 = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0)); 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[(y * N[(N[(-2.0 * N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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}:\\
\;\;\;\;y \cdot \left(-2 \cdot \frac{c \cdot \left(t\_1 \cdot i\right)}{y} + x \cdot 2\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.8%
fma-define92.8%
associate-*l*97.7%
Simplified97.7%
fma-define97.7%
+-commutative97.7%
Applied egg-rr97.7%
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-define6.7%
*-commutative6.7%
associate-*l*13.3%
+-commutative13.3%
fma-define13.3%
Simplified13.3%
Taylor expanded in y around inf 26.7%
Taylor expanded in t around 0 60.0%
Final simplification95.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* -2.0 (* c (* t_1 i))))
(t_3 (* (* c t_1) i))
(t_4 (* 2.0 (- (* x y) t_3))))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -1e-62)
t_4
(if (<= t_3 5e-18)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 2e+153) t_4 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 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -1e-62) {
tmp = t_4;
} else if (t_3 <= 5e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_2;
}
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 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -1e-62) {
tmp = t_4;
} else if (t_3 <= 5e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = -2.0 * (c * (t_1 * i)) t_3 = (c * t_1) * i t_4 = 2.0 * ((x * y) - t_3) tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -1e-62: tmp = t_4 elif t_3 <= 5e-18: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 2e+153: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(-2.0 * Float64(c * Float64(t_1 * i))) t_3 = Float64(Float64(c * t_1) * i) t_4 = Float64(2.0 * Float64(Float64(x * y) - t_3)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -1e-62) tmp = t_4; elseif (t_3 <= 5e-18) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 2e+153) tmp = t_4; else tmp = 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 = -2.0 * (c * (t_1 * i)); t_3 = (c * t_1) * i; t_4 = 2.0 * ((x * y) - t_3); tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -1e-62) tmp = t_4; elseif (t_3 <= 5e-18) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 2e+153) tmp = t_4; else tmp = 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[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -1e-62], t$95$4, If[LessEqual[t$95$3, 5e-18], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 2e+153], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
t_4 := 2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-18}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 2e153 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.9%
fma-define70.9%
*-commutative70.9%
associate-*l*84.4%
+-commutative84.4%
fma-define84.4%
Simplified84.4%
Taylor expanded in i around inf 86.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e-62 or 5.00000000000000036e-18 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e153Initial program 99.7%
Taylor expanded in x around inf 85.7%
if -1e-62 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e-18Initial program 98.8%
fma-define99.9%
*-commutative99.9%
associate-*l*99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in c around 0 91.6%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* -2.0 (* c (* t_1 i))))
(t_3 (* (* c t_1) i))
(t_4 (* 2.0 (- (* z t) t_3))))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -5e+49)
t_4
(if (<= t_3 1e-26)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 1e+307) t_4 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 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((z * t) - t_3);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -5e+49) {
tmp = t_4;
} else if (t_3 <= 1e-26) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+307) {
tmp = t_4;
} else {
tmp = t_2;
}
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 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((z * t) - t_3);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -5e+49) {
tmp = t_4;
} else if (t_3 <= 1e-26) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+307) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = -2.0 * (c * (t_1 * i)) t_3 = (c * t_1) * i t_4 = 2.0 * ((z * t) - t_3) tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -5e+49: tmp = t_4 elif t_3 <= 1e-26: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 1e+307: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(-2.0 * Float64(c * Float64(t_1 * i))) t_3 = Float64(Float64(c * t_1) * i) t_4 = Float64(2.0 * Float64(Float64(z * t) - t_3)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -5e+49) tmp = t_4; elseif (t_3 <= 1e-26) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 1e+307) tmp = t_4; else tmp = 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 = -2.0 * (c * (t_1 * i)); t_3 = (c * t_1) * i; t_4 = 2.0 * ((z * t) - t_3); tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -5e+49) tmp = t_4; elseif (t_3 <= 1e-26) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 1e+307) tmp = t_4; else tmp = 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[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -5e+49], t$95$4, If[LessEqual[t$95$3, 1e-26], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 1e+307], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
t_4 := 2 \cdot \left(z \cdot t - t\_3\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+49}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{-26}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 10^{+307}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 67.6%
fma-define67.6%
*-commutative67.6%
associate-*l*84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
Taylor expanded in i around inf 87.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000004e49 or 1e-26 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306Initial program 99.6%
Taylor expanded in x around inf 93.2%
associate-/l*88.5%
Simplified88.5%
Taylor expanded in x around 0 74.5%
if -5.0000000000000004e49 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e-26Initial program 98.9%
fma-define99.9%
*-commutative99.9%
associate-*l*99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in c around 0 90.7%
Final simplification85.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+307)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+307)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+307)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+307): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+307)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+307))) tmp = -2.0 * (c * (t_1 * i)); else tmp = (((x * y) + (z * t)) - t_2) * 2.0; 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[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+307]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+307}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 67.6%
fma-define67.6%
*-commutative67.6%
associate-*l*84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
Taylor expanded in i around inf 87.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306Initial program 99.2%
Final simplification94.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -5e+239) (not (<= t_2 2e+167)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c)))))))
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 <= -5e+239) || !(t_2 <= 2e+167)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-5d+239)) .or. (.not. (t_2 <= 2d+167))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+239) || !(t_2 <= 2e+167)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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 <= -5e+239) or not (t_2 <= 2e+167): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) 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 <= -5e+239) || !(t_2 <= 2e+167)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); 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 <= -5e+239) || ~((t_2 <= 2e+167))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); 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[Or[LessEqual[t$95$2, -5e+239], N[Not[LessEqual[t$95$2, 2e+167]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+239} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+167}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000007e239 or 2.0000000000000001e167 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.1%
fma-define72.1%
*-commutative72.1%
associate-*l*83.4%
+-commutative83.4%
fma-define83.4%
Simplified83.4%
Taylor expanded in i around inf 85.4%
if -5.00000000000000007e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e167Initial program 99.2%
Taylor expanded in a around inf 90.6%
*-commutative90.6%
Simplified90.6%
Final simplification88.3%
(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))))
(* x (+ (* -2.0 (/ (* a (* c i)) x)) (* y 2.0))))))
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 = x * ((-2.0 * ((a * (c * i)) / x)) + (y * 2.0));
}
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 = x * ((-2.0 * ((a * (c * i)) / x)) + (y * 2.0));
}
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 = x * ((-2.0 * ((a * (c * i)) / x)) + (y * 2.0)) 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(x * Float64(Float64(-2.0 * Float64(Float64(a * Float64(c * i)) / x)) + Float64(y * 2.0))); 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 = x * ((-2.0 * ((a * (c * i)) / x)) + (y * 2.0)); 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[(x * N[(N[(-2.0 * N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(y * 2.0), $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}:\\
\;\;\;\;x \cdot \left(-2 \cdot \frac{a \cdot \left(c \cdot i\right)}{x} + y \cdot 2\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.8%
fma-define92.8%
associate-*l*97.7%
Simplified97.7%
fma-define97.7%
+-commutative97.7%
Applied egg-rr97.7%
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 a around inf 33.3%
*-commutative33.3%
Simplified33.3%
Taylor expanded in x around inf 46.7%
Taylor expanded in t around 0 60.8%
Final simplification95.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+238)
(* x (* 2.0 (+ y (* t (/ z x)))))
(if (<= (* x y) 5e+87)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* y (* 2.0 (+ x (* t (/ z y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+238) {
tmp = x * (2.0 * (y + (t * (z / x))));
} else if ((x * y) <= 5e+87) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = y * (2.0 * (x + (t * (z / y))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-2d+238)) then
tmp = x * (2.0d0 * (y + (t * (z / x))))
else if ((x * y) <= 5d+87) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = y * (2.0d0 * (x + (t * (z / y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+238) {
tmp = x * (2.0 * (y + (t * (z / x))));
} else if ((x * y) <= 5e+87) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = y * (2.0 * (x + (t * (z / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+238: tmp = x * (2.0 * (y + (t * (z / x)))) elif (x * y) <= 5e+87: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = y * (2.0 * (x + (t * (z / y)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+238) tmp = Float64(x * Float64(2.0 * Float64(y + Float64(t * Float64(z / x))))); elseif (Float64(x * y) <= 5e+87) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(y * Float64(2.0 * Float64(x + Float64(t * Float64(z / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2e+238) tmp = x * (2.0 * (y + (t * (z / x)))); elseif ((x * y) <= 5e+87) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = y * (2.0 * (x + (t * (z / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+238], N[(x * N[(2.0 * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+87], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(2.0 * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+238}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+87}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(2 \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e238Initial program 84.9%
fma-define84.9%
*-commutative84.9%
associate-*l*88.5%
+-commutative88.5%
fma-define88.5%
Simplified88.5%
Taylor expanded in c around 0 88.7%
Taylor expanded in x around inf 88.7%
distribute-lft-out88.7%
associate-/l*92.6%
Simplified92.6%
if -2.0000000000000001e238 < (*.f64 x y) < 4.9999999999999998e87Initial program 89.0%
fma-define89.0%
*-commutative89.0%
associate-*l*93.3%
+-commutative93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in x around 0 78.9%
if 4.9999999999999998e87 < (*.f64 x y) Initial program 83.0%
fma-define84.8%
*-commutative84.8%
associate-*l*85.3%
+-commutative85.3%
fma-define85.3%
Simplified85.3%
Taylor expanded in c around 0 71.3%
Taylor expanded in y around inf 76.7%
distribute-lft-out76.7%
associate-/l*76.7%
Simplified76.7%
Final simplification79.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (* y 2.0))))
(if (<= y -1.6e-16)
t_1
(if (<= y 1.4e-265)
(* t (* z 2.0))
(if (<= y 3550000.0) (* -2.0 (* a (* c i))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y * 2.0);
double tmp;
if (y <= -1.6e-16) {
tmp = t_1;
} else if (y <= 1.4e-265) {
tmp = t * (z * 2.0);
} else if (y <= 3550000.0) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y * 2.0d0)
if (y <= (-1.6d-16)) then
tmp = t_1
else if (y <= 1.4d-265) then
tmp = t * (z * 2.0d0)
else if (y <= 3550000.0d0) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y * 2.0);
double tmp;
if (y <= -1.6e-16) {
tmp = t_1;
} else if (y <= 1.4e-265) {
tmp = t * (z * 2.0);
} else if (y <= 3550000.0) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x * (y * 2.0) tmp = 0 if y <= -1.6e-16: tmp = t_1 elif y <= 1.4e-265: tmp = t * (z * 2.0) elif y <= 3550000.0: tmp = -2.0 * (a * (c * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(y * 2.0)) tmp = 0.0 if (y <= -1.6e-16) tmp = t_1; elseif (y <= 1.4e-265) tmp = Float64(t * Float64(z * 2.0)); elseif (y <= 3550000.0) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x * (y * 2.0); tmp = 0.0; if (y <= -1.6e-16) tmp = t_1; elseif (y <= 1.4e-265) tmp = t * (z * 2.0); elseif (y <= 3550000.0) tmp = -2.0 * (a * (c * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-16], t$95$1, If[LessEqual[y, 1.4e-265], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3550000.0], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-265}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;y \leq 3550000:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.60000000000000011e-16 or 3.55e6 < y Initial program 84.0%
fma-define84.7%
*-commutative84.7%
associate-*l*89.9%
+-commutative89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in x around inf 45.5%
*-commutative45.5%
associate-*l*45.5%
Simplified45.5%
if -1.60000000000000011e-16 < y < 1.40000000000000012e-265Initial program 93.4%
fma-define93.4%
*-commutative93.4%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around inf 33.0%
associate-*r*33.0%
*-commutative33.0%
associate-*l*33.0%
*-commutative33.0%
Simplified33.0%
if 1.40000000000000012e-265 < y < 3.55e6Initial program 87.5%
fma-define87.5%
*-commutative87.5%
associate-*l*91.5%
+-commutative91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in a around inf 41.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.6e+83) (not (<= c 2e+60))) (* -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 <= -1.6e+83) || !(c <= 2e+60)) {
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 <= (-1.6d+83)) .or. (.not. (c <= 2d+60))) 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 <= -1.6e+83) || !(c <= 2e+60)) {
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 <= -1.6e+83) or not (c <= 2e+60): 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 <= -1.6e+83) || !(c <= 2e+60)) 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 <= -1.6e+83) || ~((c <= 2e+60))) 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, -1.6e+83], N[Not[LessEqual[c, 2e+60]], $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 -1.6 \cdot 10^{+83} \lor \neg \left(c \leq 2 \cdot 10^{+60}\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 < -1.5999999999999999e83 or 1.9999999999999999e60 < c Initial program 70.8%
fma-define70.8%
*-commutative70.8%
associate-*l*87.1%
+-commutative87.1%
fma-define87.1%
Simplified87.1%
Taylor expanded in i around inf 79.4%
if -1.5999999999999999e83 < c < 1.9999999999999999e60Initial program 97.9%
fma-define98.5%
*-commutative98.5%
associate-*l*93.8%
+-commutative93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in c around 0 70.6%
Final simplification74.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.2e+84) (not (<= c 3.3e+71))) (* -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 <= -1.2e+84) || !(c <= 3.3e+71)) {
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 <= (-1.2d+84)) .or. (.not. (c <= 3.3d+71))) 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 <= -1.2e+84) || !(c <= 3.3e+71)) {
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 <= -1.2e+84) or not (c <= 3.3e+71): 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 <= -1.2e+84) || !(c <= 3.3e+71)) 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 <= -1.2e+84) || ~((c <= 3.3e+71))) 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, -1.2e+84], N[Not[LessEqual[c, 3.3e+71]], $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 -1.2 \cdot 10^{+84} \lor \neg \left(c \leq 3.3 \cdot 10^{+71}\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 < -1.2e84 or 3.2999999999999998e71 < c Initial program 70.7%
fma-define70.7%
*-commutative70.7%
associate-*l*86.6%
+-commutative86.6%
fma-define86.6%
Simplified86.6%
Taylor expanded in i around inf 79.6%
Taylor expanded in a around 0 71.4%
if -1.2e84 < c < 3.2999999999999998e71Initial program 97.3%
fma-define98.0%
*-commutative98.0%
associate-*l*94.0%
+-commutative94.0%
fma-define93.9%
Simplified93.9%
Taylor expanded in c around 0 70.2%
Final simplification70.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.6e+83) (not (<= c 2.2e+72))) (* -2.0 (* c (* b (* c i)))) (* 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 ((c <= -1.6e+83) || !(c <= 2.2e+72)) {
tmp = -2.0 * (c * (b * (c * i)));
} 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 ((c <= (-1.6d+83)) .or. (.not. (c <= 2.2d+72))) then
tmp = (-2.0d0) * (c * (b * (c * i)))
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 ((c <= -1.6e+83) || !(c <= 2.2e+72)) {
tmp = -2.0 * (c * (b * (c * i)));
} else {
tmp = x * (y * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.6e+83) or not (c <= 2.2e+72): tmp = -2.0 * (c * (b * (c * i))) else: tmp = x * (y * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.6e+83) || !(c <= 2.2e+72)) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); 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 ((c <= -1.6e+83) || ~((c <= 2.2e+72))) tmp = -2.0 * (c * (b * (c * i))); else tmp = x * (y * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.6e+83], N[Not[LessEqual[c, 2.2e+72]], $MachinePrecision]], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.6 \cdot 10^{+83} \lor \neg \left(c \leq 2.2 \cdot 10^{+72}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if c < -1.5999999999999999e83 or 2.2e72 < c Initial program 70.7%
fma-define70.7%
*-commutative70.7%
associate-*l*86.6%
+-commutative86.6%
fma-define86.6%
Simplified86.6%
Taylor expanded in i around inf 79.6%
Taylor expanded in a around 0 71.4%
if -1.5999999999999999e83 < c < 2.2e72Initial program 97.3%
fma-define98.0%
*-commutative98.0%
associate-*l*94.0%
+-commutative94.0%
fma-define93.9%
Simplified93.9%
Taylor expanded in x around inf 39.5%
*-commutative39.5%
associate-*l*39.5%
Simplified39.5%
Final simplification51.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t 5.5e+138) (* x (* y 2.0)) (* t (* z 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= 5.5e+138) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 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 (t <= 5.5d+138) then
tmp = x * (y * 2.0d0)
else
tmp = t * (z * 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 (t <= 5.5e+138) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= 5.5e+138: tmp = x * (y * 2.0) else: tmp = t * (z * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= 5.5e+138) tmp = Float64(x * Float64(y * 2.0)); else tmp = Float64(t * Float64(z * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= 5.5e+138) tmp = x * (y * 2.0); else tmp = t * (z * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, 5.5e+138], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.5 \cdot 10^{+138}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\end{array}
\end{array}
if t < 5.4999999999999999e138Initial program 88.4%
fma-define88.9%
*-commutative88.9%
associate-*l*93.5%
+-commutative93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in x around inf 33.4%
*-commutative33.4%
associate-*l*33.4%
Simplified33.4%
if 5.4999999999999999e138 < t Initial program 82.2%
fma-define82.2%
*-commutative82.2%
associate-*l*80.4%
+-commutative80.4%
fma-define80.4%
Simplified80.4%
Taylor expanded in z around inf 52.6%
associate-*r*52.6%
*-commutative52.6%
associate-*l*52.6%
*-commutative52.6%
Simplified52.6%
(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 87.3%
fma-define87.7%
*-commutative87.7%
associate-*l*91.2%
+-commutative91.2%
fma-define91.2%
Simplified91.2%
Taylor expanded in z around inf 25.6%
associate-*r*25.6%
*-commutative25.6%
associate-*l*25.6%
*-commutative25.6%
Simplified25.6%
(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 2024182
(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))))