
(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))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* y (- x (* c (* (fma c b a) (/ i y)))))))))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 * (y * (x - (c * (fma(c, b, a) * (i / y)))));
}
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(y * Float64(x - Float64(c * Float64(fma(c, b, a) * Float64(i / y)))))); 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]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(c * N[(N[(c * b + a), $MachinePrecision] * N[(i / y), $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}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - c \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot \frac{i}{y}\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 95.6%
fma-define95.6%
associate-*l*96.8%
Simplified96.8%
fma-define96.8%
+-commutative96.8%
Applied egg-rr96.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 c around 0 22.2%
Taylor expanded in z around 0 27.8%
Taylor expanded in y around inf 55.6%
mul-1-neg55.6%
unsub-neg55.6%
associate-/l*66.7%
associate-*r*55.6%
distribute-rgt-in61.1%
*-commutative61.1%
+-commutative61.1%
*-commutative61.1%
fma-undefine61.1%
associate-/l*66.7%
Simplified66.7%
Final simplification94.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)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* 2.0 (* x (+ y (* t (/ z x))))))))
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)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * (x * (y + (t * (z / x))));
}
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)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * (x * (y + (t * (z / x))));
}
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)) - ((c * (a + (b * c))) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = 2.0 * (x * (y + (t * (z / x)))) 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(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x))))); 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)) - ((c * (a + (b * c))) * i);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1 * 2.0;
else
tmp = 2.0 * (x * (y + (t * (z / x))));
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[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $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 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\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 95.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around inf 50.0%
Taylor expanded in c around 0 55.6%
associate-*r/61.1%
Simplified61.1%
Final simplification93.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 (* x (+ y (* t (/ z x))))))))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 * (x * (y + (t * (z / x))));
}
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 * (x * (y + (t * (z / x))));
}
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 * (x * (y + (t * (z / x)))) 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(x * Float64(y + Float64(t * Float64(z / x))))); 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 * (x * (y + (t * (z / x))));
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[(x * N[(y + N[(t * N[(z / x), $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}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\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 95.6%
fma-define95.6%
associate-*l*96.8%
Simplified96.8%
fma-define96.8%
+-commutative96.8%
Applied egg-rr96.8%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around inf 50.0%
Taylor expanded in c around 0 55.6%
associate-*r/61.1%
Simplified61.1%
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 (+ a (* b c)))
(t_2 (* (+ (* x y) (* z t)) 2.0))
(t_3 (* 2.0 (* c (* t_1 (- i))))))
(if (<= c -2.8e-45)
t_3
(if (<= c -7.2e-90)
t_2
(if (<= c -6.2e-108)
(* (* (* c t_1) i) (- 2.0))
(if (<= c 9e-43)
t_2
(if (<= c 7.4e+62)
t_3
(* 2.0 (- (* z t) (* c (* c (* b 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)) * 2.0;
double t_3 = 2.0 * (c * (t_1 * -i));
double tmp;
if (c <= -2.8e-45) {
tmp = t_3;
} else if (c <= -7.2e-90) {
tmp = t_2;
} else if (c <= -6.2e-108) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 9e-43) {
tmp = t_2;
} else if (c <= 7.4e+62) {
tmp = t_3;
} else {
tmp = 2.0 * ((z * t) - (c * (c * (b * 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = ((x * y) + (z * t)) * 2.0d0
t_3 = 2.0d0 * (c * (t_1 * -i))
if (c <= (-2.8d-45)) then
tmp = t_3
else if (c <= (-7.2d-90)) then
tmp = t_2
else if (c <= (-6.2d-108)) then
tmp = ((c * t_1) * i) * -2.0d0
else if (c <= 9d-43) then
tmp = t_2
else if (c <= 7.4d+62) then
tmp = t_3
else
tmp = 2.0d0 * ((z * t) - (c * (c * (b * 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 t_1 = a + (b * c);
double t_2 = ((x * y) + (z * t)) * 2.0;
double t_3 = 2.0 * (c * (t_1 * -i));
double tmp;
if (c <= -2.8e-45) {
tmp = t_3;
} else if (c <= -7.2e-90) {
tmp = t_2;
} else if (c <= -6.2e-108) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 9e-43) {
tmp = t_2;
} else if (c <= 7.4e+62) {
tmp = t_3;
} else {
tmp = 2.0 * ((z * t) - (c * (c * (b * 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)) * 2.0 t_3 = 2.0 * (c * (t_1 * -i)) tmp = 0 if c <= -2.8e-45: tmp = t_3 elif c <= -7.2e-90: tmp = t_2 elif c <= -6.2e-108: tmp = ((c * t_1) * i) * -2.0 elif c <= 9e-43: tmp = t_2 elif c <= 7.4e+62: tmp = t_3 else: tmp = 2.0 * ((z * t) - (c * (c * (b * 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(Float64(x * y) + Float64(z * t)) * 2.0) t_3 = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))) tmp = 0.0 if (c <= -2.8e-45) tmp = t_3; elseif (c <= -7.2e-90) tmp = t_2; elseif (c <= -6.2e-108) tmp = Float64(Float64(Float64(c * t_1) * i) * Float64(-2.0)); elseif (c <= 9e-43) tmp = t_2; elseif (c <= 7.4e+62) tmp = t_3; else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(c * Float64(b * 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)) * 2.0;
t_3 = 2.0 * (c * (t_1 * -i));
tmp = 0.0;
if (c <= -2.8e-45)
tmp = t_3;
elseif (c <= -7.2e-90)
tmp = t_2;
elseif (c <= -6.2e-108)
tmp = ((c * t_1) * i) * -2.0;
elseif (c <= 9e-43)
tmp = t_2;
elseif (c <= 7.4e+62)
tmp = t_3;
else
tmp = 2.0 * ((z * t) - (c * (c * (b * 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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.8e-45], t$95$3, If[LessEqual[c, -7.2e-90], t$95$2, If[LessEqual[c, -6.2e-108], N[(N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[c, 9e-43], t$95$2, If[LessEqual[c, 7.4e+62], t$95$3, N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(c * N[(b * i), $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 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_3 := 2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -2.8 \cdot 10^{-45}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;c \leq -7.2 \cdot 10^{-90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -6.2 \cdot 10^{-108}:\\
\;\;\;\;\left(\left(c \cdot t\_1\right) \cdot i\right) \cdot \left(-2\right)\\
\mathbf{elif}\;c \leq 9 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 7.4 \cdot 10^{+62}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.8000000000000001e-45 or 9.0000000000000005e-43 < c < 7.40000000000000028e62Initial program 83.0%
Taylor expanded in i around inf 74.8%
if -2.8000000000000001e-45 < c < -7.19999999999999961e-90 or -6.20000000000000028e-108 < c < 9.0000000000000005e-43Initial program 98.3%
Taylor expanded in c around 0 83.2%
if -7.19999999999999961e-90 < c < -6.20000000000000028e-108Initial program 99.7%
Taylor expanded in c around 0 62.6%
Taylor expanded in z around 0 62.6%
Taylor expanded in i around inf 99.7%
Taylor expanded in x around 0 93.1%
if 7.40000000000000028e62 < c Initial program 74.5%
Taylor expanded in x around 0 82.5%
Taylor expanded in a around 0 84.1%
*-commutative84.1%
associate-*r*84.2%
Simplified84.2%
Final simplification80.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 (* (+ (* x y) (* z t)) 2.0))
(t_3 (* 2.0 (* c (* t_1 (- i))))))
(if (<= c -1.8e-43)
t_3
(if (<= c -6.2e-90)
t_2
(if (<= c -1.65e-108)
(* (* (* c t_1) i) (- 2.0))
(if (<= c 1.06e-41) t_2 t_3))))))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)) * 2.0;
double t_3 = 2.0 * (c * (t_1 * -i));
double tmp;
if (c <= -1.8e-43) {
tmp = t_3;
} else if (c <= -6.2e-90) {
tmp = t_2;
} else if (c <= -1.65e-108) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 1.06e-41) {
tmp = t_2;
} else {
tmp = t_3;
}
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 = a + (b * c)
t_2 = ((x * y) + (z * t)) * 2.0d0
t_3 = 2.0d0 * (c * (t_1 * -i))
if (c <= (-1.8d-43)) then
tmp = t_3
else if (c <= (-6.2d-90)) then
tmp = t_2
else if (c <= (-1.65d-108)) then
tmp = ((c * t_1) * i) * -2.0d0
else if (c <= 1.06d-41) then
tmp = t_2
else
tmp = t_3
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 + (b * c);
double t_2 = ((x * y) + (z * t)) * 2.0;
double t_3 = 2.0 * (c * (t_1 * -i));
double tmp;
if (c <= -1.8e-43) {
tmp = t_3;
} else if (c <= -6.2e-90) {
tmp = t_2;
} else if (c <= -1.65e-108) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 1.06e-41) {
tmp = t_2;
} else {
tmp = t_3;
}
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)) * 2.0 t_3 = 2.0 * (c * (t_1 * -i)) tmp = 0 if c <= -1.8e-43: tmp = t_3 elif c <= -6.2e-90: tmp = t_2 elif c <= -1.65e-108: tmp = ((c * t_1) * i) * -2.0 elif c <= 1.06e-41: tmp = t_2 else: tmp = t_3 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(Float64(x * y) + Float64(z * t)) * 2.0) t_3 = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))) tmp = 0.0 if (c <= -1.8e-43) tmp = t_3; elseif (c <= -6.2e-90) tmp = t_2; elseif (c <= -1.65e-108) tmp = Float64(Float64(Float64(c * t_1) * i) * Float64(-2.0)); elseif (c <= 1.06e-41) tmp = t_2; else tmp = t_3; 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)) * 2.0;
t_3 = 2.0 * (c * (t_1 * -i));
tmp = 0.0;
if (c <= -1.8e-43)
tmp = t_3;
elseif (c <= -6.2e-90)
tmp = t_2;
elseif (c <= -1.65e-108)
tmp = ((c * t_1) * i) * -2.0;
elseif (c <= 1.06e-41)
tmp = t_2;
else
tmp = t_3;
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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.8e-43], t$95$3, If[LessEqual[c, -6.2e-90], t$95$2, If[LessEqual[c, -1.65e-108], N[(N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[c, 1.06e-41], t$95$2, t$95$3]]]]]]]
\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(x \cdot y + z \cdot t\right) \cdot 2\\
t_3 := 2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;c \leq -6.2 \cdot 10^{-90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -1.65 \cdot 10^{-108}:\\
\;\;\;\;\left(\left(c \cdot t\_1\right) \cdot i\right) \cdot \left(-2\right)\\
\mathbf{elif}\;c \leq 1.06 \cdot 10^{-41}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if c < -1.7999999999999999e-43 or 1.06e-41 < c Initial program 79.8%
Taylor expanded in i around inf 73.4%
if -1.7999999999999999e-43 < c < -6.2000000000000003e-90 or -1.6500000000000001e-108 < c < 1.06e-41Initial program 98.3%
Taylor expanded in c around 0 83.2%
if -6.2000000000000003e-90 < c < -1.6500000000000001e-108Initial program 99.7%
Taylor expanded in c around 0 62.6%
Taylor expanded in z around 0 62.6%
Taylor expanded in i around inf 99.7%
Taylor expanded in x around 0 93.1%
Final simplification78.4%
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 -2.3e-111) (not (<= c 2e-50))) (* 2.0 (- (* z t) (* 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 <= -2.3e-111) || !(c <= 2e-50)) {
tmp = 2.0 * ((z * t) - (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 <= (-2.3d-111)) .or. (.not. (c <= 2d-50))) then
tmp = 2.0d0 * ((z * t) - (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 <= -2.3e-111) || !(c <= 2e-50)) {
tmp = 2.0 * ((z * t) - (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 <= -2.3e-111) or not (c <= 2e-50): tmp = 2.0 * ((z * t) - (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 <= -2.3e-111) || !(c <= 2e-50)) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 <= -2.3e-111) || ~((c <= 2e-50)))
tmp = 2.0 * ((z * t) - (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, -2.3e-111], N[Not[LessEqual[c, 2e-50]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $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 -2.3 \cdot 10^{-111} \lor \neg \left(c \leq 2 \cdot 10^{-50}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - 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 < -2.3e-111 or 2.00000000000000002e-50 < c Initial program 82.0%
Taylor expanded in x around 0 83.4%
if -2.3e-111 < c < 2.00000000000000002e-50Initial program 98.1%
Taylor expanded in c around 0 81.5%
Final simplification82.6%
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.2e-42) (not (<= c 2.1e-40))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
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.2e-42) || !(c <= 2.1e-40)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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.2d-42)) .or. (.not. (c <= 2.1d-40))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
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.2e-42) || !(c <= 2.1e-40)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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.2e-42) or not (c <= 2.1e-40): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) 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.2e-42) || !(c <= 2.1e-40)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); 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.2e-42) || ~((c <= 2.1e-40)))
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
else
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
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.2e-42], N[Not[LessEqual[c, 2.1e-40]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[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.2 \cdot 10^{-42} \lor \neg \left(c \leq 2.1 \cdot 10^{-40}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - 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) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -1.20000000000000001e-42 or 2.10000000000000018e-40 < c Initial program 79.6%
Taylor expanded in x around 0 84.1%
if -1.20000000000000001e-42 < c < 2.10000000000000018e-40Initial program 98.3%
Taylor expanded in a around inf 93.8%
*-commutative93.8%
Simplified93.8%
Final simplification88.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 (if (or (<= c -1.12e-44) (not (<= c 1.3e-41))) (* 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 <= -1.12e-44) || !(c <= 1.3e-41)) {
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 <= (-1.12d-44)) .or. (.not. (c <= 1.3d-41))) 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 <= -1.12e-44) || !(c <= 1.3e-41)) {
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 <= -1.12e-44) or not (c <= 1.3e-41): 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 <= -1.12e-44) || !(c <= 1.3e-41)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -1.12e-44) || ~((c <= 1.3e-41)))
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, -1.12e-44], N[Not[LessEqual[c, 1.3e-41]], $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 -1.12 \cdot 10^{-44} \lor \neg \left(c \leq 1.3 \cdot 10^{-41}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.1200000000000001e-44 or 1.3e-41 < c Initial program 79.8%
Taylor expanded in i around inf 73.4%
if -1.1200000000000001e-44 < c < 1.3e-41Initial program 98.3%
Taylor expanded in c around 0 80.0%
Final simplification76.6%
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 (<= a -5.1e-67) (not (<= a 1.8e+189))) (* 2.0 (- (* x y) (* i (* a c)))) (* (+ (* 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 ((a <= -5.1e-67) || !(a <= 1.8e+189)) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} 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 ((a <= (-5.1d-67)) .or. (.not. (a <= 1.8d+189))) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
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 ((a <= -5.1e-67) || !(a <= 1.8e+189)) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} 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 (a <= -5.1e-67) or not (a <= 1.8e+189): tmp = 2.0 * ((x * y) - (i * (a * c))) 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 ((a <= -5.1e-67) || !(a <= 1.8e+189)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); 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 ((a <= -5.1e-67) || ~((a <= 1.8e+189)))
tmp = 2.0 * ((x * y) - (i * (a * c)));
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[a, -5.1e-67], N[Not[LessEqual[a, 1.8e+189]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $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}\;a \leq -5.1 \cdot 10^{-67} \lor \neg \left(a \leq 1.8 \cdot 10^{+189}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if a < -5.09999999999999982e-67 or 1.80000000000000004e189 < a Initial program 89.2%
Taylor expanded in c around 0 78.3%
Taylor expanded in z around 0 67.5%
Taylor expanded in c around 0 65.7%
+-commutative65.7%
mul-1-neg65.7%
sub-neg65.7%
*-commutative65.7%
*-commutative65.7%
associate-*r*65.8%
Simplified65.8%
if -5.09999999999999982e-67 < a < 1.80000000000000004e189Initial program 88.6%
Taylor expanded in c around 0 62.3%
Final simplification63.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))))
(if (<= z -8e+44)
t_1
(if (<= z -8.2e-52)
(* (* i (* a c)) -2.0)
(if (<= z 3.9e-10) (* (* x y) 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 * (z * t);
double tmp;
if (z <= -8e+44) {
tmp = t_1;
} else if (z <= -8.2e-52) {
tmp = (i * (a * c)) * -2.0;
} else if (z <= 3.9e-10) {
tmp = (x * y) * 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 * (z * t)
if (z <= (-8d+44)) then
tmp = t_1
else if (z <= (-8.2d-52)) then
tmp = (i * (a * c)) * (-2.0d0)
else if (z <= 3.9d-10) then
tmp = (x * y) * 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 * (z * t);
double tmp;
if (z <= -8e+44) {
tmp = t_1;
} else if (z <= -8.2e-52) {
tmp = (i * (a * c)) * -2.0;
} else if (z <= 3.9e-10) {
tmp = (x * y) * 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 * (z * t) tmp = 0 if z <= -8e+44: tmp = t_1 elif z <= -8.2e-52: tmp = (i * (a * c)) * -2.0 elif z <= 3.9e-10: tmp = (x * y) * 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(z * t)) tmp = 0.0 if (z <= -8e+44) tmp = t_1; elseif (z <= -8.2e-52) tmp = Float64(Float64(i * Float64(a * c)) * -2.0); elseif (z <= 3.9e-10) tmp = Float64(Float64(x * y) * 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 * (z * t);
tmp = 0.0;
if (z <= -8e+44)
tmp = t_1;
elseif (z <= -8.2e-52)
tmp = (i * (a * c)) * -2.0;
elseif (z <= 3.9e-10)
tmp = (x * y) * 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+44], t$95$1, If[LessEqual[z, -8.2e-52], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[z, 3.9e-10], N[(N[(x * y), $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(z \cdot t\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-52}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-10}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.0000000000000007e44 or 3.9e-10 < z Initial program 87.7%
Taylor expanded in z around inf 49.2%
if -8.0000000000000007e44 < z < -8.19999999999999977e-52Initial program 86.1%
Taylor expanded in a around inf 25.9%
mul-1-neg25.9%
*-commutative25.9%
associate-*l*25.8%
*-commutative25.8%
distribute-rgt-neg-in25.8%
*-commutative25.8%
distribute-rgt-neg-in25.8%
Simplified25.8%
Taylor expanded in c around 0 25.9%
*-commutative25.9%
Simplified25.9%
Taylor expanded in a around 0 25.9%
*-commutative25.9%
*-commutative25.9%
associate-*r*26.0%
Simplified26.0%
if -8.19999999999999977e-52 < z < 3.9e-10Initial program 90.5%
Taylor expanded in x around inf 36.2%
Final simplification41.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 (* 2.0 (* z t))))
(if (<= z -1.35e+149)
t_1
(if (<= z -7e-50)
(* (* a (* c i)) -2.0)
(if (<= z 3.15e-10) (* (* x y) 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 * (z * t);
double tmp;
if (z <= -1.35e+149) {
tmp = t_1;
} else if (z <= -7e-50) {
tmp = (a * (c * i)) * -2.0;
} else if (z <= 3.15e-10) {
tmp = (x * y) * 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 * (z * t)
if (z <= (-1.35d+149)) then
tmp = t_1
else if (z <= (-7d-50)) then
tmp = (a * (c * i)) * (-2.0d0)
else if (z <= 3.15d-10) then
tmp = (x * y) * 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 * (z * t);
double tmp;
if (z <= -1.35e+149) {
tmp = t_1;
} else if (z <= -7e-50) {
tmp = (a * (c * i)) * -2.0;
} else if (z <= 3.15e-10) {
tmp = (x * y) * 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 * (z * t) tmp = 0 if z <= -1.35e+149: tmp = t_1 elif z <= -7e-50: tmp = (a * (c * i)) * -2.0 elif z <= 3.15e-10: tmp = (x * y) * 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(z * t)) tmp = 0.0 if (z <= -1.35e+149) tmp = t_1; elseif (z <= -7e-50) tmp = Float64(Float64(a * Float64(c * i)) * -2.0); elseif (z <= 3.15e-10) tmp = Float64(Float64(x * y) * 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 * (z * t);
tmp = 0.0;
if (z <= -1.35e+149)
tmp = t_1;
elseif (z <= -7e-50)
tmp = (a * (c * i)) * -2.0;
elseif (z <= 3.15e-10)
tmp = (x * y) * 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+149], t$95$1, If[LessEqual[z, -7e-50], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[z, 3.15e-10], N[(N[(x * y), $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(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-50}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-10}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35e149 or 3.14999999999999998e-10 < z Initial program 86.3%
Taylor expanded in z around inf 49.7%
if -1.35e149 < z < -6.99999999999999993e-50Initial program 90.5%
Taylor expanded in a around inf 28.7%
mul-1-neg28.7%
*-commutative28.7%
associate-*l*24.0%
*-commutative24.0%
distribute-rgt-neg-in24.0%
*-commutative24.0%
distribute-rgt-neg-in24.0%
Simplified24.0%
Taylor expanded in c around 0 28.7%
*-commutative28.7%
Simplified28.7%
if -6.99999999999999993e-50 < z < 3.14999999999999998e-10Initial program 90.5%
Taylor expanded in x around inf 36.2%
Final simplification40.4%
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 (<= i -8e+141) (not (<= i 3.8e+241))) (* (* a (* c i)) -2.0) (* (+ (* 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 ((i <= -8e+141) || !(i <= 3.8e+241)) {
tmp = (a * (c * i)) * -2.0;
} 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 ((i <= (-8d+141)) .or. (.not. (i <= 3.8d+241))) then
tmp = (a * (c * i)) * (-2.0d0)
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 ((i <= -8e+141) || !(i <= 3.8e+241)) {
tmp = (a * (c * i)) * -2.0;
} 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 (i <= -8e+141) or not (i <= 3.8e+241): tmp = (a * (c * i)) * -2.0 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 ((i <= -8e+141) || !(i <= 3.8e+241)) tmp = Float64(Float64(a * Float64(c * i)) * -2.0); 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 ((i <= -8e+141) || ~((i <= 3.8e+241)))
tmp = (a * (c * i)) * -2.0;
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[i, -8e+141], N[Not[LessEqual[i, 3.8e+241]], $MachinePrecision]], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $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}\;i \leq -8 \cdot 10^{+141} \lor \neg \left(i \leq 3.8 \cdot 10^{+241}\right):\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -8.00000000000000014e141 or 3.79999999999999972e241 < i Initial program 95.1%
Taylor expanded in a around inf 54.6%
mul-1-neg54.6%
*-commutative54.6%
associate-*l*46.9%
*-commutative46.9%
distribute-rgt-neg-in46.9%
*-commutative46.9%
distribute-rgt-neg-in46.9%
Simplified46.9%
Taylor expanded in c around 0 54.6%
*-commutative54.6%
Simplified54.6%
if -8.00000000000000014e141 < i < 3.79999999999999972e241Initial program 86.8%
Taylor expanded in c around 0 62.9%
Final simplification60.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 (if (or (<= z -6.8e+50) (not (<= z 8e-10))) (* 2.0 (* z t)) (* (* x y) 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 ((z <= -6.8e+50) || !(z <= 8e-10)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 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 ((z <= (-6.8d+50)) .or. (.not. (z <= 8d-10))) then
tmp = 2.0d0 * (z * t)
else
tmp = (x * y) * 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 ((z <= -6.8e+50) || !(z <= 8e-10)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 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 (z <= -6.8e+50) or not (z <= 8e-10): tmp = 2.0 * (z * t) else: tmp = (x * y) * 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 ((z <= -6.8e+50) || !(z <= 8e-10)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(Float64(x * y) * 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 ((z <= -6.8e+50) || ~((z <= 8e-10)))
tmp = 2.0 * (z * t);
else
tmp = (x * y) * 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[z, -6.8e+50], N[Not[LessEqual[z, 8e-10]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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}\;z \leq -6.8 \cdot 10^{+50} \lor \neg \left(z \leq 8 \cdot 10^{-10}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if z < -6.7999999999999997e50 or 8.00000000000000029e-10 < z Initial program 87.5%
Taylor expanded in z around inf 49.1%
if -6.7999999999999997e50 < z < 8.00000000000000029e-10Initial program 90.0%
Taylor expanded in x around inf 36.2%
Final simplification42.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.8%
Taylor expanded in z around inf 32.0%
Final simplification32.0%
(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 2024053
(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))))