
(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}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* z (- (* t 2.0) (* 2.0 (* c (+ (/ (* a i) z) (/ (* b (* c i)) z)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = z * ((t * 2.0) - (2.0 * (c * (((a * i) / z) + ((b * (c * i)) / z)))));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(z * Float64(Float64(t * 2.0) - Float64(2.0 * Float64(c * Float64(Float64(Float64(a * i) / z) + Float64(Float64(b * Float64(c * i)) / z)))))); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(t * 2.0), $MachinePrecision] - N[(2.0 * N[(c * N[(N[(N[(a * i), $MachinePrecision] / z), $MachinePrecision] + N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 2 - 2 \cdot \left(c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 93.7%
fma-define93.7%
associate-*l*97.5%
Simplified97.5%
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%
associate-*l*14.3%
Simplified14.3%
Taylor expanded in z around inf 42.9%
Taylor expanded in c around 0 50.0%
Taylor expanded in x around 0 71.4%
Final simplification96.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)) (t_2 (* -2.0 (* c (* (* b c) i)))))
(if (<= c -2e+191)
t_2
(if (<= c -2e+19)
(* c (* i (* a -2.0)))
(if (<= c -1.6e-21)
t_2
(if (<= c -4.3e-49)
(* -2.0 (* a (* c i)))
(if (<= c -6.8e-224)
(* y (* x 2.0))
(if (<= c -9.5e-273)
(* z (* t 2.0))
(if (<= c 1.7e-205)
t_1
(if (<= c 4e-143)
(* 2.0 (* z t))
(if (<= c 1.54e+88) t_1 t_2)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = -2.0 * (c * ((b * c) * i));
double tmp;
if (c <= -2e+191) {
tmp = t_2;
} else if (c <= -2e+19) {
tmp = c * (i * (a * -2.0));
} else if (c <= -1.6e-21) {
tmp = t_2;
} else if (c <= -4.3e-49) {
tmp = -2.0 * (a * (c * i));
} else if (c <= -6.8e-224) {
tmp = y * (x * 2.0);
} else if (c <= -9.5e-273) {
tmp = z * (t * 2.0);
} else if (c <= 1.7e-205) {
tmp = t_1;
} else if (c <= 4e-143) {
tmp = 2.0 * (z * t);
} else if (c <= 1.54e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) * 2.0d0
t_2 = (-2.0d0) * (c * ((b * c) * i))
if (c <= (-2d+191)) then
tmp = t_2
else if (c <= (-2d+19)) then
tmp = c * (i * (a * (-2.0d0)))
else if (c <= (-1.6d-21)) then
tmp = t_2
else if (c <= (-4.3d-49)) then
tmp = (-2.0d0) * (a * (c * i))
else if (c <= (-6.8d-224)) then
tmp = y * (x * 2.0d0)
else if (c <= (-9.5d-273)) then
tmp = z * (t * 2.0d0)
else if (c <= 1.7d-205) then
tmp = t_1
else if (c <= 4d-143) then
tmp = 2.0d0 * (z * t)
else if (c <= 1.54d+88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = -2.0 * (c * ((b * c) * i));
double tmp;
if (c <= -2e+191) {
tmp = t_2;
} else if (c <= -2e+19) {
tmp = c * (i * (a * -2.0));
} else if (c <= -1.6e-21) {
tmp = t_2;
} else if (c <= -4.3e-49) {
tmp = -2.0 * (a * (c * i));
} else if (c <= -6.8e-224) {
tmp = y * (x * 2.0);
} else if (c <= -9.5e-273) {
tmp = z * (t * 2.0);
} else if (c <= 1.7e-205) {
tmp = t_1;
} else if (c <= 4e-143) {
tmp = 2.0 * (z * t);
} else if (c <= 1.54e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 t_2 = -2.0 * (c * ((b * c) * i)) tmp = 0 if c <= -2e+191: tmp = t_2 elif c <= -2e+19: tmp = c * (i * (a * -2.0)) elif c <= -1.6e-21: tmp = t_2 elif c <= -4.3e-49: tmp = -2.0 * (a * (c * i)) elif c <= -6.8e-224: tmp = y * (x * 2.0) elif c <= -9.5e-273: tmp = z * (t * 2.0) elif c <= 1.7e-205: tmp = t_1 elif c <= 4e-143: tmp = 2.0 * (z * t) elif c <= 1.54e+88: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))) tmp = 0.0 if (c <= -2e+191) tmp = t_2; elseif (c <= -2e+19) tmp = Float64(c * Float64(i * Float64(a * -2.0))); elseif (c <= -1.6e-21) tmp = t_2; elseif (c <= -4.3e-49) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (c <= -6.8e-224) tmp = Float64(y * Float64(x * 2.0)); elseif (c <= -9.5e-273) tmp = Float64(z * Float64(t * 2.0)); elseif (c <= 1.7e-205) tmp = t_1; elseif (c <= 4e-143) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 1.54e+88) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) * 2.0;
t_2 = -2.0 * (c * ((b * c) * i));
tmp = 0.0;
if (c <= -2e+191)
tmp = t_2;
elseif (c <= -2e+19)
tmp = c * (i * (a * -2.0));
elseif (c <= -1.6e-21)
tmp = t_2;
elseif (c <= -4.3e-49)
tmp = -2.0 * (a * (c * i));
elseif (c <= -6.8e-224)
tmp = y * (x * 2.0);
elseif (c <= -9.5e-273)
tmp = z * (t * 2.0);
elseif (c <= 1.7e-205)
tmp = t_1;
elseif (c <= 4e-143)
tmp = 2.0 * (z * t);
elseif (c <= 1.54e+88)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2e+191], t$95$2, If[LessEqual[c, -2e+19], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.6e-21], t$95$2, If[LessEqual[c, -4.3e-49], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -6.8e-224], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -9.5e-273], N[(z * N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.7e-205], t$95$1, If[LessEqual[c, 4e-143], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.54e+88], t$95$1, t$95$2]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2 \cdot 10^{+191}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -2 \cdot 10^{+19}:\\
\;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -4.3 \cdot 10^{-49}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -6.8 \cdot 10^{-224}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;c \leq -9.5 \cdot 10^{-273}:\\
\;\;\;\;z \cdot \left(t \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4 \cdot 10^{-143}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.54 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -2.00000000000000015e191 or -2e19 < c < -1.6000000000000001e-21 or 1.54000000000000006e88 < c Initial program 82.2%
fma-define82.2%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in i around inf 82.4%
Taylor expanded in a around 0 67.8%
*-commutative67.8%
Simplified67.8%
if -2.00000000000000015e191 < c < -2e19Initial program 63.0%
fma-define63.0%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in a around inf 55.3%
*-commutative55.3%
*-commutative55.3%
associate-*l*58.8%
*-commutative58.8%
associate-*r*58.8%
*-commutative58.8%
associate-*r*58.8%
Simplified58.8%
if -1.6000000000000001e-21 < c < -4.30000000000000016e-49Initial program 100.0%
fma-define100.0%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 53.7%
*-commutative53.7%
Simplified53.7%
if -4.30000000000000016e-49 < c < -6.79999999999999984e-224Initial program 99.8%
fma-define99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 52.9%
*-commutative52.9%
associate-*r*52.9%
*-commutative52.9%
associate-*r*52.9%
Simplified52.9%
if -6.79999999999999984e-224 < c < -9.49999999999999925e-273Initial program 99.9%
Taylor expanded in c around 0 93.7%
Taylor expanded in t around inf 71.2%
associate-*r*71.3%
*-commutative71.3%
Simplified71.3%
if -9.49999999999999925e-273 < c < 1.7000000000000001e-205 or 3.9999999999999998e-143 < c < 1.54000000000000006e88Initial program 95.7%
Taylor expanded in x around inf 47.5%
if 1.7000000000000001e-205 < c < 3.9999999999999998e-143Initial program 99.7%
Taylor expanded in z around inf 60.0%
Final simplification58.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(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 2e+262)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+262)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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 <= 2e+262)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) 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 <= 2e+262): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) 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 <= 2e+262)) 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
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
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 <= 2e+262)))
tmp = -2.0 * (c * (t_1 * i));
else
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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, 2e+262]], $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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\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 2 \cdot 10^{+262}\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 2e262 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 74.1%
fma-define74.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in i around inf 87.5%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e262Initial program 99.1%
Final simplification94.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(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))))
(* z (- (* t 2.0) (* 2.0 (* c (+ (/ (* a i) z) (/ (* b (* c i)) z)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (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 = z * ((t * 2.0) - (2.0 * (c * (((a * i) / z) + ((b * (c * i)) / z)))));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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 = z * ((t * 2.0) - (2.0 * (c * (((a * i) / z) + ((b * (c * i)) / z)))));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) 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 = z * ((t * 2.0) - (2.0 * (c * (((a * i) / z) + ((b * (c * i)) / z))))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) 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(z * Float64(Float64(t * 2.0) - Float64(2.0 * Float64(c * Float64(Float64(Float64(a * i) / z) + Float64(Float64(b * Float64(c * i)) / z)))))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
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 = z * ((t * 2.0) - (2.0 * (c * (((a * i) / z) + ((b * (c * i)) / z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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[(z * N[(N[(t * 2.0), $MachinePrecision] - N[(2.0 * N[(c * N[(N[(N[(a * i), $MachinePrecision] / z), $MachinePrecision] + N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\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}:\\
\;\;\;\;z \cdot \left(t \cdot 2 - 2 \cdot \left(c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 93.7%
fma-define93.7%
associate-*l*97.5%
Simplified97.5%
fma-define97.5%
+-commutative97.5%
Applied egg-rr97.5%
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%
associate-*l*14.3%
Simplified14.3%
Taylor expanded in z around inf 42.9%
Taylor expanded in c around 0 50.0%
Taylor expanded in x around 0 71.4%
Final simplification96.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(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))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (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;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) 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
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) 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
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
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
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\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 93.7%
fma-define93.7%
associate-*l*97.5%
Simplified97.5%
fma-define97.5%
+-commutative97.5%
Applied egg-rr97.5%
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%
associate-*l*14.3%
Simplified14.3%
Taylor expanded in i around inf 64.4%
Final simplification95.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -2.45e-51)
t_2
(if (<= c 7.5e-28)
t_1
(if (<= c 5.2e+24)
(* 2.0 (- (* x y) (* a (* c i))))
(if (<= c 2.55e+85) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.45e-51) {
tmp = t_2;
} else if (c <= 7.5e-28) {
tmp = t_1;
} else if (c <= 5.2e+24) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if (c <= 2.55e+85) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-2.45d-51)) then
tmp = t_2
else if (c <= 7.5d-28) then
tmp = t_1
else if (c <= 5.2d+24) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else if (c <= 2.55d+85) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.45e-51) {
tmp = t_2;
} else if (c <= 7.5e-28) {
tmp = t_1;
} else if (c <= 5.2e+24) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if (c <= 2.55e+85) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -2.45e-51: tmp = t_2 elif c <= 7.5e-28: tmp = t_1 elif c <= 5.2e+24: tmp = 2.0 * ((x * y) - (a * (c * i))) elif c <= 2.55e+85: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -2.45e-51) tmp = t_2; elseif (c <= 7.5e-28) tmp = t_1; elseif (c <= 5.2e+24) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); elseif (c <= 2.55e+85) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = ((x * y) + (z * t)) * 2.0;
t_2 = -2.0 * (c * ((a + (b * c)) * i));
tmp = 0.0;
if (c <= -2.45e-51)
tmp = t_2;
elseif (c <= 7.5e-28)
tmp = t_1;
elseif (c <= 5.2e+24)
tmp = 2.0 * ((x * y) - (a * (c * i)));
elseif (c <= 2.55e+85)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.45e-51], t$95$2, If[LessEqual[c, 7.5e-28], t$95$1, If[LessEqual[c, 5.2e+24], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.55e+85], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.45 \cdot 10^{-51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 7.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.2 \cdot 10^{+24}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 2.55 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -2.44999999999999987e-51 or 2.5499999999999999e85 < c Initial program 79.7%
fma-define79.7%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in i around inf 80.5%
if -2.44999999999999987e-51 < c < 7.5000000000000003e-28 or 5.1999999999999997e24 < c < 2.5499999999999999e85Initial program 98.2%
Taylor expanded in c around 0 78.8%
if 7.5000000000000003e-28 < c < 5.1999999999999997e24Initial program 92.1%
Taylor expanded in a around inf 77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in z around 0 71.7%
Final simplification79.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (* a -2.0))))
(t_2 (* (* x y) 2.0))
(t_3 (* 2.0 (* z t))))
(if (<= y -2.85e-142)
t_2
(if (<= y 7.2e-219)
t_1
(if (<= y 1.9e-101)
t_3
(if (<= y 520.0) t_1 (if (<= y 1.5e+47) t_3 t_2)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a * -2.0));
double t_2 = (x * y) * 2.0;
double t_3 = 2.0 * (z * t);
double tmp;
if (y <= -2.85e-142) {
tmp = t_2;
} else if (y <= 7.2e-219) {
tmp = t_1;
} else if (y <= 1.9e-101) {
tmp = t_3;
} else if (y <= 520.0) {
tmp = t_1;
} else if (y <= 1.5e+47) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c * (i * (a * (-2.0d0)))
t_2 = (x * y) * 2.0d0
t_3 = 2.0d0 * (z * t)
if (y <= (-2.85d-142)) then
tmp = t_2
else if (y <= 7.2d-219) then
tmp = t_1
else if (y <= 1.9d-101) then
tmp = t_3
else if (y <= 520.0d0) then
tmp = t_1
else if (y <= 1.5d+47) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a * -2.0));
double t_2 = (x * y) * 2.0;
double t_3 = 2.0 * (z * t);
double tmp;
if (y <= -2.85e-142) {
tmp = t_2;
} else if (y <= 7.2e-219) {
tmp = t_1;
} else if (y <= 1.9e-101) {
tmp = t_3;
} else if (y <= 520.0) {
tmp = t_1;
} else if (y <= 1.5e+47) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = c * (i * (a * -2.0)) t_2 = (x * y) * 2.0 t_3 = 2.0 * (z * t) tmp = 0 if y <= -2.85e-142: tmp = t_2 elif y <= 7.2e-219: tmp = t_1 elif y <= 1.9e-101: tmp = t_3 elif y <= 520.0: tmp = t_1 elif y <= 1.5e+47: tmp = t_3 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(a * -2.0))) t_2 = Float64(Float64(x * y) * 2.0) t_3 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (y <= -2.85e-142) tmp = t_2; elseif (y <= 7.2e-219) tmp = t_1; elseif (y <= 1.9e-101) tmp = t_3; elseif (y <= 520.0) tmp = t_1; elseif (y <= 1.5e+47) tmp = t_3; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = c * (i * (a * -2.0));
t_2 = (x * y) * 2.0;
t_3 = 2.0 * (z * t);
tmp = 0.0;
if (y <= -2.85e-142)
tmp = t_2;
elseif (y <= 7.2e-219)
tmp = t_1;
elseif (y <= 1.9e-101)
tmp = t_3;
elseif (y <= 520.0)
tmp = t_1;
elseif (y <= 1.5e+47)
tmp = t_3;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.85e-142], t$95$2, If[LessEqual[y, 7.2e-219], t$95$1, If[LessEqual[y, 1.9e-101], t$95$3, If[LessEqual[y, 520.0], t$95$1, If[LessEqual[y, 1.5e+47], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
t_3 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -2.85 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-101}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 520:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+47}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.84999999999999997e-142 or 1.5000000000000001e47 < y Initial program 83.7%
Taylor expanded in x around inf 38.0%
if -2.84999999999999997e-142 < y < 7.19999999999999947e-219 or 1.90000000000000005e-101 < y < 520Initial program 97.0%
fma-define97.0%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in a around inf 39.4%
*-commutative39.4%
*-commutative39.4%
associate-*l*36.6%
*-commutative36.6%
associate-*r*36.6%
*-commutative36.6%
associate-*r*36.6%
Simplified36.6%
if 7.19999999999999947e-219 < y < 1.90000000000000005e-101 or 520 < y < 1.5000000000000001e47Initial program 92.5%
Taylor expanded in z around inf 34.0%
Final simplification37.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))) (t_2 (* (* x y) 2.0)))
(if (<= y -8.5e-120)
t_2
(if (<= y 1.25e-218)
t_1
(if (<= y 3.1e-105) (* 2.0 (* z t)) (if (<= y 1.28e+57) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
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 t_2 = (x * y) * 2.0;
double tmp;
if (y <= -8.5e-120) {
tmp = t_2;
} else if (y <= 1.25e-218) {
tmp = t_1;
} else if (y <= 3.1e-105) {
tmp = 2.0 * (z * t);
} else if (y <= 1.28e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (a * (c * i))
t_2 = (x * y) * 2.0d0
if (y <= (-8.5d-120)) then
tmp = t_2
else if (y <= 1.25d-218) then
tmp = t_1
else if (y <= 3.1d-105) then
tmp = 2.0d0 * (z * t)
else if (y <= 1.28d+57) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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 t_2 = (x * y) * 2.0;
double tmp;
if (y <= -8.5e-120) {
tmp = t_2;
} else if (y <= 1.25e-218) {
tmp = t_1;
} else if (y <= 3.1e-105) {
tmp = 2.0 * (z * t);
} else if (y <= 1.28e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = (x * y) * 2.0 tmp = 0 if y <= -8.5e-120: tmp = t_2 elif y <= 1.25e-218: tmp = t_1 elif y <= 3.1e-105: tmp = 2.0 * (z * t) elif y <= 1.28e+57: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (y <= -8.5e-120) tmp = t_2; elseif (y <= 1.25e-218) tmp = t_1; elseif (y <= 3.1e-105) tmp = Float64(2.0 * Float64(z * t)); elseif (y <= 1.28e+57) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = -2.0 * (a * (c * i));
t_2 = (x * y) * 2.0;
tmp = 0.0;
if (y <= -8.5e-120)
tmp = t_2;
elseif (y <= 1.25e-218)
tmp = t_1;
elseif (y <= 3.1e-105)
tmp = 2.0 * (z * t);
elseif (y <= 1.28e+57)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[y, -8.5e-120], t$95$2, If[LessEqual[y, 1.25e-218], t$95$1, If[LessEqual[y, 3.1e-105], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.28e+57], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{-120}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.50000000000000059e-120 or 1.28000000000000001e57 < y Initial program 82.8%
Taylor expanded in x around inf 38.7%
if -8.50000000000000059e-120 < y < 1.2500000000000001e-218 or 3.10000000000000014e-105 < y < 1.28000000000000001e57Initial program 96.4%
fma-define96.4%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in a around inf 38.6%
*-commutative38.6%
Simplified38.6%
if 1.2500000000000001e-218 < y < 3.10000000000000014e-105Initial program 93.6%
Taylor expanded in z around inf 33.8%
Final simplification38.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -9e-20) (not (<= c 1.05e+88))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9e-20) || !(c <= 1.05e+88)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 <= (-9d-20)) .or. (.not. (c <= 1.05d+88))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9e-20) || !(c <= 1.05e+88)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -9e-20) or not (c <= 1.05e+88): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -9e-20) || !(c <= 1.05e+88)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -9e-20) || ~((c <= 1.05e+88)))
tmp = -2.0 * (c * ((a + (b * c)) * i));
else
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9e-20], N[Not[LessEqual[c, 1.05e+88]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9 \cdot 10^{-20} \lor \neg \left(c \leq 1.05 \cdot 10^{+88}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -9.0000000000000003e-20 or 1.05e88 < c Initial program 78.0%
fma-define78.0%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in i around inf 81.3%
if -9.0000000000000003e-20 < c < 1.05e88Initial program 97.7%
Taylor expanded in a around inf 92.6%
Final simplification87.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (* b c) i)))))
(if (<= c -2.15e+191)
t_1
(if (<= c -3.3e+18)
(* c (* i (* a -2.0)))
(if (<= c 6.7e+93) (* (+ (* x y) (* z t)) 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
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 <= -2.15e+191) {
tmp = t_1;
} else if (c <= -3.3e+18) {
tmp = c * (i * (a * -2.0));
} else if (c <= 6.7e+93) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 <= (-2.15d+191)) then
tmp = t_1
else if (c <= (-3.3d+18)) then
tmp = c * (i * (a * (-2.0d0)))
else if (c <= 6.7d+93) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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 <= -2.15e+191) {
tmp = t_1;
} else if (c <= -3.3e+18) {
tmp = c * (i * (a * -2.0));
} else if (c <= 6.7e+93) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((b * c) * i)) tmp = 0 if c <= -2.15e+191: tmp = t_1 elif c <= -3.3e+18: tmp = c * (i * (a * -2.0)) elif c <= 6.7e+93: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))) tmp = 0.0 if (c <= -2.15e+191) tmp = t_1; elseif (c <= -3.3e+18) tmp = Float64(c * Float64(i * Float64(a * -2.0))); elseif (c <= 6.7e+93) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
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 <= -2.15e+191)
tmp = t_1;
elseif (c <= -3.3e+18)
tmp = c * (i * (a * -2.0));
elseif (c <= 6.7e+93)
tmp = ((x * y) + (z * t)) * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.15e+191], t$95$1, If[LessEqual[c, -3.3e+18], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.7e+93], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.15 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.3 \cdot 10^{+18}:\\
\;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq 6.7 \cdot 10^{+93}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2.1499999999999999e191 or 6.69999999999999965e93 < c Initial program 79.8%
fma-define79.8%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in i around inf 83.6%
Taylor expanded in a around 0 69.3%
*-commutative69.3%
Simplified69.3%
if -2.1499999999999999e191 < c < -3.3e18Initial program 64.3%
fma-define64.3%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in a around inf 53.4%
*-commutative53.4%
*-commutative53.4%
associate-*l*56.8%
*-commutative56.8%
associate-*r*56.8%
*-commutative56.8%
associate-*r*56.8%
Simplified56.8%
if -3.3e18 < c < 6.69999999999999965e93Initial program 97.9%
Taylor expanded in c around 0 70.3%
Final simplification68.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.9e-58) (not (<= c 6.4e+87))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.9e-58) || !(c <= 6.4e+87)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 <= (-5.9d-58)) .or. (.not. (c <= 6.4d+87))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.9e-58) || !(c <= 6.4e+87)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.9e-58) or not (c <= 6.4e+87): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.9e-58) || !(c <= 6.4e+87)) 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
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -5.9e-58) || ~((c <= 6.4e+87)))
tmp = -2.0 * (c * ((a + (b * c)) * i));
else
tmp = ((x * y) + (z * t)) * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.9e-58], N[Not[LessEqual[c, 6.4e+87]], $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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.9 \cdot 10^{-58} \lor \neg \left(c \leq 6.4 \cdot 10^{+87}\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 < -5.9e-58 or 6.4000000000000001e87 < c Initial program 79.7%
fma-define79.7%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in i around inf 80.5%
if -5.9e-58 < c < 6.4000000000000001e87Initial program 97.6%
Taylor expanded in c around 0 74.8%
Final simplification77.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e+96) (not (<= (* x y) 1e+26))) (* (* x y) 2.0) (* 2.0 (* z t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d+96)) .or. (.not. ((x * y) <= 1d+26))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+96) or not ((x * y) <= 1e+26): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+96) || !(Float64(x * y) <= 1e+26)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((x * y) <= -1e+96) || ~(((x * y) <= 1e+26)))
tmp = (x * y) * 2.0;
else
tmp = 2.0 * (z * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+96], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+26]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+96} \lor \neg \left(x \cdot y \leq 10^{+26}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000005e96 or 1.00000000000000005e26 < (*.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 57.8%
if -1.00000000000000005e96 < (*.f64 x y) < 1.00000000000000005e26Initial program 89.7%
Taylor expanded in z around inf 34.3%
Final simplification43.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e+96) (not (<= (* x y) 1e+26))) (* (* x y) 2.0) (* z (* t 2.0))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = z * (t * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d+96)) .or. (.not. ((x * y) <= 1d+26))) then
tmp = (x * y) * 2.0d0
else
tmp = z * (t * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = z * (t * 2.0);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+96) or not ((x * y) <= 1e+26): tmp = (x * y) * 2.0 else: tmp = z * (t * 2.0) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+96) || !(Float64(x * y) <= 1e+26)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(z * Float64(t * 2.0)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((x * y) <= -1e+96) || ~(((x * y) <= 1e+26)))
tmp = (x * y) * 2.0;
else
tmp = z * (t * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+96], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+26]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(z * N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+96} \lor \neg \left(x \cdot y \leq 10^{+26}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000005e96 or 1.00000000000000005e26 < (*.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 57.8%
if -1.00000000000000005e96 < (*.f64 x y) < 1.00000000000000005e26Initial program 89.7%
Taylor expanded in c around 0 41.0%
Taylor expanded in t around inf 34.3%
associate-*r*34.3%
*-commutative34.3%
Simplified34.3%
Final simplification43.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
assert(x < y && y < z && z < t && t < a && a < b && 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 * (z * t);
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = 2.0 * (z * t);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 88.6%
Taylor expanded in z around inf 25.7%
Final simplification25.7%
(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 2024071
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))