
(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 (* c b))))
(if (<= z -6.6e+146)
(* 2.0 (* z (- (+ t (/ (* x y) z)) (/ (* c (* i t_1)) z))))
(* 2.0 (- (fma x y (* z t)) (* t_1 (* 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 t_1 = a + (c * b);
double tmp;
if (z <= -6.6e+146) {
tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)));
} else {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (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) t_1 = Float64(a + Float64(c * b)) tmp = 0.0 if (z <= -6.6e+146) tmp = Float64(2.0 * Float64(z * Float64(Float64(t + Float64(Float64(x * y) / z)) - Float64(Float64(c * Float64(i * t_1)) / z)))); else tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); 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[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+146], N[(2.0 * N[(z * N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * 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}
t_1 := a + c \cdot b\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+146}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - \frac{c \cdot \left(i \cdot t\_1\right)}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if z < -6.60000000000000032e146Initial program 90.6%
Taylor expanded in z around inf 97.5%
if -6.60000000000000032e146 < z Initial program 90.8%
fma-define91.2%
associate-*l*95.8%
Simplified95.8%
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 (* c b))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* z (- (+ t (/ (* x y) z)) (/ (* c (* i t_1)) 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 + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / 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 + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / 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 + (c * b) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / 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(c * b)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(z * Float64(Float64(t + Float64(Float64(x * y) / z)) - Float64(Float64(c * Float64(i * t_1)) / 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 + (c * b);
t_2 = (x * y) + (z * t);
tmp = 0.0;
if ((t_2 - (i * (c * t_1))) <= Inf)
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
else
tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / 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[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $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 + c \cdot b\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - \frac{c \cdot \left(i \cdot t\_1\right)}{z}\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 96.4%
fma-define96.4%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in z around inf 73.3%
Final simplification97.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 (+ a (* c b))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* z (+ t (/ (* x y) 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 + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * (t + ((x * y) / 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 + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * (t + ((x * y) / 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 + (c * b) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (z * (t + ((x * y) / 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(c * b)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(z * Float64(t + Float64(Float64(x * y) / 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 + (c * b);
t_2 = (x * y) + (z * t);
tmp = 0.0;
if ((t_2 - (i * (c * t_1))) <= Inf)
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
else
tmp = 2.0 * (z * (t + ((x * y) / 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[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $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 + c \cdot b\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t + \frac{x \cdot y}{z}\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 96.4%
fma-define96.4%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in z around inf 73.3%
Taylor expanded in c around 0 53.3%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in a around 0 60.0%
Final simplification96.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 (let* ((t_1 (- (+ (* x y) (* z t)) (* i (* c (+ a (* c b))))))) (if (<= t_1 INFINITY) (* 2.0 t_1) (* 2.0 (* z (+ t (/ (* x y) 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 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = 2.0 * t_1;
} else {
tmp = 2.0 * (z * (t + ((x * y) / 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 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * t_1;
} else {
tmp = 2.0 * (z * (t + ((x * y) / 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 = ((x * y) + (z * t)) - (i * (c * (a + (c * b)))) tmp = 0 if t_1 <= math.inf: tmp = 2.0 * t_1 else: tmp = 2.0 * (z * (t + ((x * y) / 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(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(a + Float64(c * b))))) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(2.0 * t_1); else tmp = Float64(2.0 * Float64(z * Float64(t + Float64(Float64(x * y) / 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 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
tmp = 0.0;
if (t_1 <= Inf)
tmp = 2.0 * t_1;
else
tmp = 2.0 * (z * (t + ((x * y) / 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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(2.0 * t$95$1), $MachinePrecision], N[(2.0 * N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $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 := \left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t + \frac{x \cdot y}{z}\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 96.4%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in z around inf 73.3%
Taylor expanded in c around 0 53.3%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in a around 0 60.0%
Final simplification94.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 (+ (* x y) (* z t))))
(t_2 (* 2.0 (* c (* i (- (- (* c b)) a))))))
(if (<= c -4.6e+152)
t_2
(if (<= c -2.1e+108)
t_1
(if (<= c -9.5e+56)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (<= c 1.05e-27) 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 * ((x * y) + (z * t));
double t_2 = 2.0 * (c * (i * (-(c * b) - a)));
double tmp;
if (c <= -4.6e+152) {
tmp = t_2;
} else if (c <= -2.1e+108) {
tmp = t_1;
} else if (c <= -9.5e+56) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 1.05e-27) {
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 * ((x * y) + (z * t))
t_2 = 2.0d0 * (c * (i * (-(c * b) - a)))
if (c <= (-4.6d+152)) then
tmp = t_2
else if (c <= (-2.1d+108)) then
tmp = t_1
else if (c <= (-9.5d+56)) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if (c <= 1.05d-27) 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 * ((x * y) + (z * t));
double t_2 = 2.0 * (c * (i * (-(c * b) - a)));
double tmp;
if (c <= -4.6e+152) {
tmp = t_2;
} else if (c <= -2.1e+108) {
tmp = t_1;
} else if (c <= -9.5e+56) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 1.05e-27) {
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 * ((x * y) + (z * t)) t_2 = 2.0 * (c * (i * (-(c * b) - a))) tmp = 0 if c <= -4.6e+152: tmp = t_2 elif c <= -2.1e+108: tmp = t_1 elif c <= -9.5e+56: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif c <= 1.05e-27: 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(Float64(x * y) + Float64(z * t))) t_2 = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a)))) tmp = 0.0 if (c <= -4.6e+152) tmp = t_2; elseif (c <= -2.1e+108) tmp = t_1; elseif (c <= -9.5e+56) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 1.05e-27) 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 * ((x * y) + (z * t));
t_2 = 2.0 * (c * (i * (-(c * b) - a)));
tmp = 0.0;
if (c <= -4.6e+152)
tmp = t_2;
elseif (c <= -2.1e+108)
tmp = t_1;
elseif (c <= -9.5e+56)
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
elseif (c <= 1.05e-27)
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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.6e+152], t$95$2, If[LessEqual[c, -2.1e+108], t$95$1, If[LessEqual[c, -9.5e+56], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.05e-27], 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(x \cdot y + z \cdot t\right)\\
t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\
\mathbf{if}\;c \leq -4.6 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -9.5 \cdot 10^{+56}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -4.5999999999999997e152 or 1.05000000000000008e-27 < c Initial program 79.2%
Taylor expanded in i around inf 81.7%
if -4.5999999999999997e152 < c < -2.1000000000000001e108 or -9.4999999999999997e56 < c < 1.05000000000000008e-27Initial program 97.9%
Taylor expanded in c around 0 81.6%
if -2.1000000000000001e108 < c < -9.4999999999999997e56Initial program 100.0%
Taylor expanded in x around 0 99.8%
Taylor expanded in a around 0 100.0%
Final simplification82.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 (+ (* x y) (* z t))))
(if (<= c -6.8e+160)
(* 2.0 (* c (* i (- (- (* c b)) a))))
(if (<= c -5.2e-99)
(* 2.0 (- t_1 (* i (* c (* c b)))))
(if (<= c 9.8e-28)
(* 2.0 (- t_1 (* i (* c a))))
(* 2.0 (- (* z t) (* c (* i (+ a (* c b)))))))))))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);
double tmp;
if (c <= -6.8e+160) {
tmp = 2.0 * (c * (i * (-(c * b) - a)));
} else if (c <= -5.2e-99) {
tmp = 2.0 * (t_1 - (i * (c * (c * b))));
} else if (c <= 9.8e-28) {
tmp = 2.0 * (t_1 - (i * (c * a)));
} else {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
}
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 = (x * y) + (z * t)
if (c <= (-6.8d+160)) then
tmp = 2.0d0 * (c * (i * (-(c * b) - a)))
else if (c <= (-5.2d-99)) then
tmp = 2.0d0 * (t_1 - (i * (c * (c * b))))
else if (c <= 9.8d-28) then
tmp = 2.0d0 * (t_1 - (i * (c * a)))
else
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
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);
double tmp;
if (c <= -6.8e+160) {
tmp = 2.0 * (c * (i * (-(c * b) - a)));
} else if (c <= -5.2e-99) {
tmp = 2.0 * (t_1 - (i * (c * (c * b))));
} else if (c <= 9.8e-28) {
tmp = 2.0 * (t_1 - (i * (c * a)));
} else {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
}
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) tmp = 0 if c <= -6.8e+160: tmp = 2.0 * (c * (i * (-(c * b) - a))) elif c <= -5.2e-99: tmp = 2.0 * (t_1 - (i * (c * (c * b)))) elif c <= 9.8e-28: tmp = 2.0 * (t_1 - (i * (c * a))) else: tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b))))) 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) + Float64(z * t)) tmp = 0.0 if (c <= -6.8e+160) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a)))); elseif (c <= -5.2e-99) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(c * b))))); elseif (c <= 9.8e-28) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * a)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); 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);
tmp = 0.0;
if (c <= -6.8e+160)
tmp = 2.0 * (c * (i * (-(c * b) - a)));
elseif (c <= -5.2e-99)
tmp = 2.0 * (t_1 - (i * (c * (c * b))));
elseif (c <= 9.8e-28)
tmp = 2.0 * (t_1 - (i * (c * a)));
else
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
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] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.8e+160], N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -5.2e-99], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.8e-28], N[(2.0 * N[(t$95$1 - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $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 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+160}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\
\mathbf{elif}\;c \leq -5.2 \cdot 10^{-99}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(c \cdot b\right)\right)\right)\\
\mathbf{elif}\;c \leq 9.8 \cdot 10^{-28}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if c < -6.80000000000000061e160Initial program 70.1%
Taylor expanded in i around inf 86.8%
if -6.80000000000000061e160 < c < -5.2000000000000001e-99Initial program 96.2%
Taylor expanded in a around 0 94.3%
if -5.2000000000000001e-99 < c < 9.80000000000000059e-28Initial program 99.0%
Taylor expanded in a around inf 96.8%
*-commutative96.8%
Simplified96.8%
if 9.80000000000000059e-28 < c Initial program 82.5%
Taylor expanded in x around 0 82.2%
Final simplification91.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
(if (<= c -4.6e+152)
(* 2.0 (- (* z t) (* c (* i a))))
(if (<= c 2.8e-36)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 2.1e+247)
(* 2.0 (- (* x y) (* a (* c i))))
(* 2.0 (* i (* c a)))))))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 <= -4.6e+152) {
tmp = 2.0 * ((z * t) - (c * (i * a)));
} else if (c <= 2.8e-36) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 2.1e+247) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * (i * (c * a));
}
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 <= (-4.6d+152)) then
tmp = 2.0d0 * ((z * t) - (c * (i * a)))
else if (c <= 2.8d-36) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 2.1d+247) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else
tmp = 2.0d0 * (i * (c * a))
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 <= -4.6e+152) {
tmp = 2.0 * ((z * t) - (c * (i * a)));
} else if (c <= 2.8e-36) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 2.1e+247) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * (i * (c * a));
}
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 <= -4.6e+152: tmp = 2.0 * ((z * t) - (c * (i * a))) elif c <= 2.8e-36: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 2.1e+247: tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = 2.0 * (i * (c * a)) 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 <= -4.6e+152) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * a)))); elseif (c <= 2.8e-36) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 2.1e+247) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(i * Float64(c * a))); 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 <= -4.6e+152)
tmp = 2.0 * ((z * t) - (c * (i * a)));
elseif (c <= 2.8e-36)
tmp = 2.0 * ((x * y) + (z * t));
elseif (c <= 2.1e+247)
tmp = 2.0 * ((x * y) - (a * (c * i)));
else
tmp = 2.0 * (i * (c * a));
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[LessEqual[c, -4.6e+152], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.8e-36], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+247], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(i * N[(c * a), $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 -4.6 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\
\mathbf{elif}\;c \leq 2.8 \cdot 10^{-36}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 2.1 \cdot 10^{+247}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -4.5999999999999997e152Initial program 72.0%
Taylor expanded in x around 0 87.3%
Taylor expanded in a around inf 56.0%
*-commutative56.0%
Simplified56.0%
if -4.5999999999999997e152 < c < 2.8000000000000001e-36Initial program 98.0%
Taylor expanded in c around 0 79.5%
if 2.8000000000000001e-36 < c < 2.1e247Initial program 80.2%
Taylor expanded in z around inf 82.4%
Taylor expanded in c around 0 64.2%
associate-/l*64.3%
associate-/l*64.3%
Simplified64.3%
Taylor expanded in z around 0 62.6%
if 2.1e247 < c Initial program 99.9%
Taylor expanded in a around inf 10.4%
mul-1-neg10.4%
*-commutative10.4%
associate-*l*10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
Simplified10.3%
pow110.3%
*-commutative10.3%
add-sqr-sqrt0.1%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod10.4%
add-sqr-sqrt37.9%
Applied egg-rr37.9%
unpow137.9%
associate-*r*54.8%
Simplified54.8%
Final simplification71.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 (* 2.0 (- (* z t) (* c (* i a))))))
(if (<= c -5.5e+152)
t_1
(if (<= c 2.7e-21)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 1.02e+242) t_1 (* 2.0 (* i (* c a))))))))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 * ((z * t) - (c * (i * a)));
double tmp;
if (c <= -5.5e+152) {
tmp = t_1;
} else if (c <= 2.7e-21) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 1.02e+242) {
tmp = t_1;
} else {
tmp = 2.0 * (i * (c * a));
}
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 * ((z * t) - (c * (i * a)))
if (c <= (-5.5d+152)) then
tmp = t_1
else if (c <= 2.7d-21) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 1.02d+242) then
tmp = t_1
else
tmp = 2.0d0 * (i * (c * a))
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 * ((z * t) - (c * (i * a)));
double tmp;
if (c <= -5.5e+152) {
tmp = t_1;
} else if (c <= 2.7e-21) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 1.02e+242) {
tmp = t_1;
} else {
tmp = 2.0 * (i * (c * a));
}
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 * ((z * t) - (c * (i * a))) tmp = 0 if c <= -5.5e+152: tmp = t_1 elif c <= 2.7e-21: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 1.02e+242: tmp = t_1 else: tmp = 2.0 * (i * (c * a)) 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(Float64(z * t) - Float64(c * Float64(i * a)))) tmp = 0.0 if (c <= -5.5e+152) tmp = t_1; elseif (c <= 2.7e-21) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 1.02e+242) tmp = t_1; else tmp = Float64(2.0 * Float64(i * Float64(c * a))); 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 * ((z * t) - (c * (i * a)));
tmp = 0.0;
if (c <= -5.5e+152)
tmp = t_1;
elseif (c <= 2.7e-21)
tmp = 2.0 * ((x * y) + (z * t));
elseif (c <= 1.02e+242)
tmp = t_1;
else
tmp = 2.0 * (i * (c * a));
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[(N[(z * t), $MachinePrecision] - N[(c * N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.5e+152], t$95$1, If[LessEqual[c, 2.7e-21], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.02e+242], t$95$1, N[(2.0 * N[(i * N[(c * a), $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 := 2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\
\mathbf{if}\;c \leq -5.5 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-21}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{+242}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -5.4999999999999999e152 or 2.7000000000000001e-21 < c < 1.02e242Initial program 77.0%
Taylor expanded in x around 0 83.4%
Taylor expanded in a around inf 57.1%
*-commutative57.1%
Simplified57.1%
if -5.4999999999999999e152 < c < 2.7000000000000001e-21Initial program 98.0%
Taylor expanded in c around 0 78.9%
if 1.02e242 < c Initial program 91.5%
Taylor expanded in a around inf 17.9%
mul-1-neg17.9%
*-commutative17.9%
associate-*l*17.7%
*-commutative17.7%
distribute-rgt-neg-in17.7%
*-commutative17.7%
distribute-rgt-neg-in17.7%
Simplified17.7%
pow117.7%
*-commutative17.7%
add-sqr-sqrt8.5%
sqrt-unprod33.8%
sqr-neg33.8%
sqrt-unprod9.6%
add-sqr-sqrt34.7%
Applied egg-rr34.7%
unpow134.7%
associate-*r*50.2%
Simplified50.2%
Final simplification70.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 (if (or (<= c -1.45e-40) (not (<= c 4.5e-27))) (* 2.0 (- (* z t) (* c (* i (+ a (* c b)))))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* c a))))))
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 <= -1.45e-40) || !(c <= 4.5e-27)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
}
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 <= (-1.45d-40)) .or. (.not. (c <= 4.5d-27))) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * a)))
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 <= -1.45e-40) || !(c <= 4.5e-27)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
}
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 <= -1.45e-40) or not (c <= 4.5e-27): tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b))))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a))) 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 <= -1.45e-40) || !(c <= 4.5e-27)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * a)))); 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 <= -1.45e-40) || ~((c <= 4.5e-27)))
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
else
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
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, -1.45e-40], N[Not[LessEqual[c, 4.5e-27]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $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 -1.45 \cdot 10^{-40} \lor \neg \left(c \leq 4.5 \cdot 10^{-27}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -1.4499999999999999e-40 or 4.5000000000000002e-27 < c Initial program 84.7%
Taylor expanded in x around 0 81.0%
if -1.4499999999999999e-40 < c < 4.5000000000000002e-27Initial program 98.2%
Taylor expanded in a around inf 94.5%
*-commutative94.5%
Simplified94.5%
Final simplification87.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 -1.05e-30) (not (<= c 2.36e-29))) (* 2.0 (- (* z t) (* c (* i (+ a (* c b)))))) (* 2.0 (+ (* x y) (* 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 ((c <= -1.05e-30) || !(c <= 2.36e-29)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-1.05d-30)) .or. (.not. (c <= 2.36d-29))) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -1.05e-30) || !(c <= 2.36e-29)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) + (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 (c <= -1.05e-30) or not (c <= 2.36e-29): tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b))))) else: tmp = 2.0 * ((x * y) + (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 ((c <= -1.05e-30) || !(c <= 2.36e-29)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); else tmp = Float64(2.0 * Float64(Float64(x * y) + 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 ((c <= -1.05e-30) || ~((c <= 2.36e-29)))
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
else
tmp = 2.0 * ((x * y) + (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[c, -1.05e-30], N[Not[LessEqual[c, 2.36e-29]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $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 -1.05 \cdot 10^{-30} \lor \neg \left(c \leq 2.36 \cdot 10^{-29}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.0500000000000001e-30 or 2.35999999999999992e-29 < c Initial program 85.1%
Taylor expanded in x around 0 81.3%
if -1.0500000000000001e-30 < c < 2.35999999999999992e-29Initial program 97.4%
Taylor expanded in c around 0 85.0%
Final simplification83.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 (if (or (<= c -4.6e+152) (not (<= c 2.2e-28))) (* 2.0 (* c (* i (- (- (* c b)) a)))) (* 2.0 (+ (* x y) (* 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 ((c <= -4.6e+152) || !(c <= 2.2e-28)) {
tmp = 2.0 * (c * (i * (-(c * b) - a)));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-4.6d+152)) .or. (.not. (c <= 2.2d-28))) then
tmp = 2.0d0 * (c * (i * (-(c * b) - a)))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -4.6e+152) || !(c <= 2.2e-28)) {
tmp = 2.0 * (c * (i * (-(c * b) - a)));
} else {
tmp = 2.0 * ((x * y) + (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 (c <= -4.6e+152) or not (c <= 2.2e-28): tmp = 2.0 * (c * (i * (-(c * b) - a))) else: tmp = 2.0 * ((x * y) + (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 ((c <= -4.6e+152) || !(c <= 2.2e-28)) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + 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 ((c <= -4.6e+152) || ~((c <= 2.2e-28)))
tmp = 2.0 * (c * (i * (-(c * b) - a)));
else
tmp = 2.0 * ((x * y) + (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[c, -4.6e+152], N[Not[LessEqual[c, 2.2e-28]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $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 -4.6 \cdot 10^{+152} \lor \neg \left(c \leq 2.2 \cdot 10^{-28}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -4.5999999999999997e152 or 2.19999999999999996e-28 < c Initial program 79.2%
Taylor expanded in i around inf 81.7%
if -4.5999999999999997e152 < c < 2.19999999999999996e-28Initial program 98.0%
Taylor expanded in c around 0 79.3%
Final simplification80.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 (* c i)) -2.0)))
(if (<= c -3.8e+154)
t_1
(if (<= c 3.6e-19)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 5.2e+248) t_1 (* 2.0 (* i (* c a))))))))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 * (c * i)) * -2.0;
double tmp;
if (c <= -3.8e+154) {
tmp = t_1;
} else if (c <= 3.6e-19) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.2e+248) {
tmp = t_1;
} else {
tmp = 2.0 * (i * (c * a));
}
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 = (a * (c * i)) * (-2.0d0)
if (c <= (-3.8d+154)) then
tmp = t_1
else if (c <= 3.6d-19) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 5.2d+248) then
tmp = t_1
else
tmp = 2.0d0 * (i * (c * a))
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 = (a * (c * i)) * -2.0;
double tmp;
if (c <= -3.8e+154) {
tmp = t_1;
} else if (c <= 3.6e-19) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.2e+248) {
tmp = t_1;
} else {
tmp = 2.0 * (i * (c * a));
}
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 * (c * i)) * -2.0 tmp = 0 if c <= -3.8e+154: tmp = t_1 elif c <= 3.6e-19: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 5.2e+248: tmp = t_1 else: tmp = 2.0 * (i * (c * a)) 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(a * Float64(c * i)) * -2.0) tmp = 0.0 if (c <= -3.8e+154) tmp = t_1; elseif (c <= 3.6e-19) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 5.2e+248) tmp = t_1; else tmp = Float64(2.0 * Float64(i * Float64(c * a))); 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 * (c * i)) * -2.0;
tmp = 0.0;
if (c <= -3.8e+154)
tmp = t_1;
elseif (c <= 3.6e-19)
tmp = 2.0 * ((x * y) + (z * t));
elseif (c <= 5.2e+248)
tmp = t_1;
else
tmp = 2.0 * (i * (c * a));
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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -3.8e+154], t$95$1, If[LessEqual[c, 3.6e-19], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.2e+248], t$95$1, N[(2.0 * N[(i * N[(c * a), $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 := \left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{-19}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 5.2 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -3.7999999999999998e154 or 3.6000000000000001e-19 < c < 5.20000000000000019e248Initial program 76.1%
Taylor expanded in a around inf 49.7%
mul-1-neg49.7%
*-commutative49.7%
associate-*l*46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
Taylor expanded in c around 0 49.7%
*-commutative49.7%
Simplified49.7%
if -3.7999999999999998e154 < c < 3.6000000000000001e-19Initial program 98.0%
Taylor expanded in c around 0 78.9%
if 5.20000000000000019e248 < c Initial program 99.9%
Taylor expanded in a around inf 10.4%
mul-1-neg10.4%
*-commutative10.4%
associate-*l*10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
Simplified10.3%
pow110.3%
*-commutative10.3%
add-sqr-sqrt0.1%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod10.4%
add-sqr-sqrt37.9%
Applied egg-rr37.9%
unpow137.9%
associate-*r*54.8%
Simplified54.8%
Final simplification68.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 (<= y -3.9e+87) (not (<= y 1.75e+58))) (* 2.0 (* x y)) (* 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 ((y <= -3.9e+87) || !(y <= 1.75e+58)) {
tmp = 2.0 * (x * y);
} 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 ((y <= (-3.9d+87)) .or. (.not. (y <= 1.75d+58))) then
tmp = 2.0d0 * (x * y)
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 ((y <= -3.9e+87) || !(y <= 1.75e+58)) {
tmp = 2.0 * (x * y);
} 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 (y <= -3.9e+87) or not (y <= 1.75e+58): tmp = 2.0 * (x * y) 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 ((y <= -3.9e+87) || !(y <= 1.75e+58)) tmp = Float64(2.0 * Float64(x * y)); 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 ((y <= -3.9e+87) || ~((y <= 1.75e+58)))
tmp = 2.0 * (x * y);
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[y, -3.9e+87], N[Not[LessEqual[y, 1.75e+58]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $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}\;y \leq -3.9 \cdot 10^{+87} \lor \neg \left(y \leq 1.75 \cdot 10^{+58}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -3.9000000000000002e87 or 1.7499999999999999e58 < y Initial program 84.7%
Taylor expanded in x around inf 55.2%
if -3.9000000000000002e87 < y < 1.7499999999999999e58Initial program 94.5%
Taylor expanded in z around inf 37.5%
Final simplification44.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 90.8%
Taylor expanded in z around inf 31.4%
Final simplification31.4%
(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 2024100
(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))))