
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 1e+91) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1e+91) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1e+91) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1e+91], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{+91}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 1.00000000000000008e91Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.6%
associate-*l*97.1%
Simplified97.1%
if 1.00000000000000008e91 < t Initial program 95.5%
+-commutative95.5%
associate-+r-95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.4%
fma-def99.9%
cancel-sign-sub-inv99.9%
fma-def99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
distribute-lft-neg-out99.9%
associate-*r*99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification97.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.85e+62)
(* -9.0 (* z (* t y)))
(if (or (<= z -7.6e+39)
(and (not (<= z -4.1e-23))
(or (<= z -2.7e-69)
(and (not (<= z -5.7e-99)) (<= z 1.3e-110)))))
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* (* y z) (* t -9.0)) (* x 2.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+62) {
tmp = -9.0 * (z * (t * y));
} else if ((z <= -7.6e+39) || (!(z <= -4.1e-23) && ((z <= -2.7e-69) || (!(z <= -5.7e-99) && (z <= 1.3e-110))))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.85d+62)) then
tmp = (-9.0d0) * (z * (t * y))
else if ((z <= (-7.6d+39)) .or. (.not. (z <= (-4.1d-23))) .and. (z <= (-2.7d-69)) .or. (.not. (z <= (-5.7d-99))) .and. (z <= 1.3d-110)) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = ((y * z) * (t * (-9.0d0))) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+62) {
tmp = -9.0 * (z * (t * y));
} else if ((z <= -7.6e+39) || (!(z <= -4.1e-23) && ((z <= -2.7e-69) || (!(z <= -5.7e-99) && (z <= 1.3e-110))))) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.85e+62: tmp = -9.0 * (z * (t * y)) elif (z <= -7.6e+39) or (not (z <= -4.1e-23) and ((z <= -2.7e-69) or (not (z <= -5.7e-99) and (z <= 1.3e-110)))): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = ((y * z) * (t * -9.0)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.85e+62) tmp = Float64(-9.0 * Float64(z * Float64(t * y))); elseif ((z <= -7.6e+39) || (!(z <= -4.1e-23) && ((z <= -2.7e-69) || (!(z <= -5.7e-99) && (z <= 1.3e-110))))) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(Float64(y * z) * Float64(t * -9.0)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.85e+62)
tmp = -9.0 * (z * (t * y));
elseif ((z <= -7.6e+39) || (~((z <= -4.1e-23)) && ((z <= -2.7e-69) || (~((z <= -5.7e-99)) && (z <= 1.3e-110)))))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.85e+62], N[(-9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.6e+39], And[N[Not[LessEqual[z, -4.1e-23]], $MachinePrecision], Or[LessEqual[z, -2.7e-69], And[N[Not[LessEqual[z, -5.7e-99]], $MachinePrecision], LessEqual[z, 1.3e-110]]]]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+62}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{+39} \lor \neg \left(z \leq -4.1 \cdot 10^{-23}\right) \land \left(z \leq -2.7 \cdot 10^{-69} \lor \neg \left(z \leq -5.7 \cdot 10^{-99}\right) \land z \leq 1.3 \cdot 10^{-110}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -1.85000000000000007e62Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*92.9%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in y around inf 61.8%
*-commutative61.8%
associate-*r*63.4%
Simplified63.4%
if -1.85000000000000007e62 < z < -7.5999999999999996e39 or -4.10000000000000029e-23 < z < -2.6999999999999997e-69 or -5.70000000000000032e-99 < z < 1.29999999999999995e-110Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*98.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 90.2%
if -7.5999999999999996e39 < z < -4.10000000000000029e-23 or -2.6999999999999997e-69 < z < -5.70000000000000032e-99 or 1.29999999999999995e-110 < z Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around 0 70.1%
cancel-sign-sub-inv70.1%
metadata-eval70.1%
*-commutative70.1%
associate-*l*70.0%
associate-*r*70.0%
+-commutative70.0%
*-commutative70.0%
associate-*r*70.0%
associate-*l*70.1%
Applied egg-rr70.1%
Final simplification76.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x 2.0) (* 27.0 (* a b)))))
(if (<= z -2.3e+61)
(* -9.0 (* z (* t y)))
(if (<= z -4.2e+39)
t_1
(if (<= z -1.15e-23)
(+ (* (* y z) (* t -9.0)) (* x 2.0))
(if (or (<= z -1.2e-68) (and (not (<= z -2.95e-100)) (<= z 9.6e-112)))
t_1
(- (* x 2.0) (* 9.0 (* t (* y z))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -2.3e+61) {
tmp = -9.0 * (z * (t * y));
} else if (z <= -4.2e+39) {
tmp = t_1;
} else if (z <= -1.15e-23) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if ((z <= -1.2e-68) || (!(z <= -2.95e-100) && (z <= 9.6e-112))) {
tmp = t_1;
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) + (27.0d0 * (a * b))
if (z <= (-2.3d+61)) then
tmp = (-9.0d0) * (z * (t * y))
else if (z <= (-4.2d+39)) then
tmp = t_1
else if (z <= (-1.15d-23)) then
tmp = ((y * z) * (t * (-9.0d0))) + (x * 2.0d0)
else if ((z <= (-1.2d-68)) .or. (.not. (z <= (-2.95d-100))) .and. (z <= 9.6d-112)) then
tmp = t_1
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -2.3e+61) {
tmp = -9.0 * (z * (t * y));
} else if (z <= -4.2e+39) {
tmp = t_1;
} else if (z <= -1.15e-23) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if ((z <= -1.2e-68) || (!(z <= -2.95e-100) && (z <= 9.6e-112))) {
tmp = t_1;
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) + (27.0 * (a * b)) tmp = 0 if z <= -2.3e+61: tmp = -9.0 * (z * (t * y)) elif z <= -4.2e+39: tmp = t_1 elif z <= -1.15e-23: tmp = ((y * z) * (t * -9.0)) + (x * 2.0) elif (z <= -1.2e-68) or (not (z <= -2.95e-100) and (z <= 9.6e-112)): tmp = t_1 else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) tmp = 0.0 if (z <= -2.3e+61) tmp = Float64(-9.0 * Float64(z * Float64(t * y))); elseif (z <= -4.2e+39) tmp = t_1; elseif (z <= -1.15e-23) tmp = Float64(Float64(Float64(y * z) * Float64(t * -9.0)) + Float64(x * 2.0)); elseif ((z <= -1.2e-68) || (!(z <= -2.95e-100) && (z <= 9.6e-112))) tmp = t_1; else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) + (27.0 * (a * b));
tmp = 0.0;
if (z <= -2.3e+61)
tmp = -9.0 * (z * (t * y));
elseif (z <= -4.2e+39)
tmp = t_1;
elseif (z <= -1.15e-23)
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
elseif ((z <= -1.2e-68) || (~((z <= -2.95e-100)) && (z <= 9.6e-112)))
tmp = t_1;
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+61], N[(-9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e+39], t$95$1, If[LessEqual[z, -1.15e-23], N[(N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.2e-68], And[N[Not[LessEqual[z, -2.95e-100]], $MachinePrecision], LessEqual[z, 9.6e-112]]], t$95$1, N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+61}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-23}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-68} \lor \neg \left(z \leq -2.95 \cdot 10^{-100}\right) \land z \leq 9.6 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.3e61Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*92.9%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in y around inf 61.8%
*-commutative61.8%
associate-*r*63.4%
Simplified63.4%
if -2.3e61 < z < -4.1999999999999997e39 or -1.15000000000000005e-23 < z < -1.19999999999999996e-68 or -2.9500000000000002e-100 < z < 9.6000000000000003e-112Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*98.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 90.0%
if -4.1999999999999997e39 < z < -1.15000000000000005e-23Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*90.9%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in a around 0 65.0%
cancel-sign-sub-inv65.0%
metadata-eval65.0%
*-commutative65.0%
associate-*l*65.0%
associate-*r*65.0%
+-commutative65.0%
*-commutative65.0%
associate-*r*65.0%
associate-*l*65.0%
Applied egg-rr65.0%
if -1.19999999999999996e-68 < z < -2.9500000000000002e-100 or 9.6000000000000003e-112 < z Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around 0 69.9%
Final simplification76.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))) (t_2 (+ t_1 (* z (* t (* y -9.0))))))
(if (<= z -1.05e+58)
t_2
(if (<= z -5.6e-10)
(+ (* (* y z) (* t -9.0)) (* x 2.0))
(if (<= z -1.7e-142)
t_2
(if (<= z 4.8e-113)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ t_1 (* t (* y (* z -9.0))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = t_1 + (z * (t * (y * -9.0)));
double tmp;
if (z <= -1.05e+58) {
tmp = t_2;
} else if (z <= -5.6e-10) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if (z <= -1.7e-142) {
tmp = t_2;
} else if (z <= 4.8e-113) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t_1 + (t * (y * (z * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (27.0d0 * b)
t_2 = t_1 + (z * (t * (y * (-9.0d0))))
if (z <= (-1.05d+58)) then
tmp = t_2
else if (z <= (-5.6d-10)) then
tmp = ((y * z) * (t * (-9.0d0))) + (x * 2.0d0)
else if (z <= (-1.7d-142)) then
tmp = t_2
else if (z <= 4.8d-113) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t_1 + (t * (y * (z * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = t_1 + (z * (t * (y * -9.0)));
double tmp;
if (z <= -1.05e+58) {
tmp = t_2;
} else if (z <= -5.6e-10) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if (z <= -1.7e-142) {
tmp = t_2;
} else if (z <= 4.8e-113) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t_1 + (t * (y * (z * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) t_2 = t_1 + (z * (t * (y * -9.0))) tmp = 0 if z <= -1.05e+58: tmp = t_2 elif z <= -5.6e-10: tmp = ((y * z) * (t * -9.0)) + (x * 2.0) elif z <= -1.7e-142: tmp = t_2 elif z <= 4.8e-113: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t_1 + (t * (y * (z * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) t_2 = Float64(t_1 + Float64(z * Float64(t * Float64(y * -9.0)))) tmp = 0.0 if (z <= -1.05e+58) tmp = t_2; elseif (z <= -5.6e-10) tmp = Float64(Float64(Float64(y * z) * Float64(t * -9.0)) + Float64(x * 2.0)); elseif (z <= -1.7e-142) tmp = t_2; elseif (z <= 4.8e-113) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t_1 + Float64(t * Float64(y * Float64(z * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
t_2 = t_1 + (z * (t * (y * -9.0)));
tmp = 0.0;
if (z <= -1.05e+58)
tmp = t_2;
elseif (z <= -5.6e-10)
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
elseif (z <= -1.7e-142)
tmp = t_2;
elseif (z <= 4.8e-113)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t_1 + (t * (y * (z * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+58], t$95$2, If[LessEqual[z, -5.6e-10], N[(N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.7e-142], t$95$2, If[LessEqual[z, 4.8e-113], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := t_1 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-10}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-113}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.05000000000000006e58 or -5.60000000000000031e-10 < z < -1.70000000000000014e-142Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around 0 74.7%
cancel-sign-sub-inv74.7%
metadata-eval74.7%
*-commutative74.7%
associate-*r*77.3%
+-commutative77.3%
associate-*l*77.3%
associate-*l*74.7%
*-commutative74.7%
associate-*l*74.7%
Applied egg-rr74.7%
Taylor expanded in t around 0 74.7%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.7%
associate-*r*74.7%
associate-*r*77.3%
Simplified77.3%
if -1.05000000000000006e58 < z < -5.60000000000000031e-10Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*93.8%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around 0 63.7%
cancel-sign-sub-inv63.7%
metadata-eval63.7%
*-commutative63.7%
associate-*l*63.7%
associate-*r*63.7%
+-commutative63.7%
*-commutative63.7%
associate-*r*63.7%
associate-*l*63.7%
Applied egg-rr63.7%
if -1.70000000000000014e-142 < z < 4.80000000000000024e-113Initial program 98.6%
sub-neg98.6%
sub-neg98.6%
associate-*l*98.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 93.4%
if 4.80000000000000024e-113 < z Initial program 91.1%
sub-neg91.1%
sub-neg91.1%
associate-*l*93.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 74.6%
cancel-sign-sub-inv74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*r*78.3%
+-commutative78.3%
associate-*l*78.3%
associate-*l*74.6%
*-commutative74.6%
associate-*l*74.6%
Applied egg-rr74.6%
Final simplification80.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* a (* 27.0 b))))
(if (<= z -1e+58)
(+ t_2 (* z (* t (* y -9.0))))
(if (<= z -2.65e-11)
(+ (* (* y z) (* t -9.0)) (* x 2.0))
(if (<= z -9e-143)
(- t_1 (* 9.0 (* t (* y z))))
(if (<= z 5e-113)
(+ (* x 2.0) t_1)
(+ t_2 (* t (* y (* z -9.0))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = a * (27.0 * b);
double tmp;
if (z <= -1e+58) {
tmp = t_2 + (z * (t * (y * -9.0)));
} else if (z <= -2.65e-11) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if (z <= -9e-143) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else if (z <= 5e-113) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_2 + (t * (y * (z * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = a * (27.0d0 * b)
if (z <= (-1d+58)) then
tmp = t_2 + (z * (t * (y * (-9.0d0))))
else if (z <= (-2.65d-11)) then
tmp = ((y * z) * (t * (-9.0d0))) + (x * 2.0d0)
else if (z <= (-9d-143)) then
tmp = t_1 - (9.0d0 * (t * (y * z)))
else if (z <= 5d-113) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_2 + (t * (y * (z * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = a * (27.0 * b);
double tmp;
if (z <= -1e+58) {
tmp = t_2 + (z * (t * (y * -9.0)));
} else if (z <= -2.65e-11) {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
} else if (z <= -9e-143) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else if (z <= 5e-113) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_2 + (t * (y * (z * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = a * (27.0 * b) tmp = 0 if z <= -1e+58: tmp = t_2 + (z * (t * (y * -9.0))) elif z <= -2.65e-11: tmp = ((y * z) * (t * -9.0)) + (x * 2.0) elif z <= -9e-143: tmp = t_1 - (9.0 * (t * (y * z))) elif z <= 5e-113: tmp = (x * 2.0) + t_1 else: tmp = t_2 + (t * (y * (z * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1e+58) tmp = Float64(t_2 + Float64(z * Float64(t * Float64(y * -9.0)))); elseif (z <= -2.65e-11) tmp = Float64(Float64(Float64(y * z) * Float64(t * -9.0)) + Float64(x * 2.0)); elseif (z <= -9e-143) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); elseif (z <= 5e-113) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_2 + Float64(t * Float64(y * Float64(z * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1e+58)
tmp = t_2 + (z * (t * (y * -9.0)));
elseif (z <= -2.65e-11)
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
elseif (z <= -9e-143)
tmp = t_1 - (9.0 * (t * (y * z)));
elseif (z <= 5e-113)
tmp = (x * 2.0) + t_1;
else
tmp = t_2 + (t * (y * (z * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+58], N[(t$95$2 + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.65e-11], N[(N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-143], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-113], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$2 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+58}:\\
\;\;\;\;t_2 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-11}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-143}:\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-113}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -9.99999999999999944e57Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*92.9%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in x around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-commutative72.7%
associate-*r*76.1%
+-commutative76.1%
associate-*l*76.1%
associate-*l*72.7%
*-commutative72.7%
associate-*l*72.7%
Applied egg-rr72.7%
Taylor expanded in t around 0 72.7%
associate-*r*72.7%
*-commutative72.7%
associate-*r*72.7%
associate-*r*72.7%
associate-*r*76.2%
Simplified76.2%
if -9.99999999999999944e57 < z < -2.6499999999999999e-11Initial program 87.7%
sub-neg87.7%
sub-neg87.7%
associate-*l*93.8%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around 0 63.7%
cancel-sign-sub-inv63.7%
metadata-eval63.7%
*-commutative63.7%
associate-*l*63.7%
associate-*r*63.7%
+-commutative63.7%
*-commutative63.7%
associate-*r*63.7%
associate-*l*63.7%
Applied egg-rr63.7%
if -2.6499999999999999e-11 < z < -9.00000000000000001e-143Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around 0 80.7%
if -9.00000000000000001e-143 < z < 4.9999999999999997e-113Initial program 98.6%
sub-neg98.6%
sub-neg98.6%
associate-*l*98.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 93.4%
if 4.9999999999999997e-113 < z Initial program 91.1%
sub-neg91.1%
sub-neg91.1%
associate-*l*93.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 74.6%
cancel-sign-sub-inv74.6%
metadata-eval74.6%
*-commutative74.6%
associate-*r*78.3%
+-commutative78.3%
associate-*l*78.3%
associate-*l*74.6%
*-commutative74.6%
associate-*l*74.6%
Applied egg-rr74.6%
Final simplification80.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= z -5.5e-27)
t_2
(if (<= z -1.55e-68)
t_1
(if (<= z -1.12e-99)
t_2
(if (<= z -5.1e-249)
(* a (* 27.0 b))
(if (<= z 2.45e-263) (* x 2.0) (if (<= z 6.8e-110) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -5.5e-27) {
tmp = t_2;
} else if (z <= -1.55e-68) {
tmp = t_1;
} else if (z <= -1.12e-99) {
tmp = t_2;
} else if (z <= -5.1e-249) {
tmp = a * (27.0 * b);
} else if (z <= 2.45e-263) {
tmp = x * 2.0;
} else if (z <= 6.8e-110) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (t * (y * z))
if (z <= (-5.5d-27)) then
tmp = t_2
else if (z <= (-1.55d-68)) then
tmp = t_1
else if (z <= (-1.12d-99)) then
tmp = t_2
else if (z <= (-5.1d-249)) then
tmp = a * (27.0d0 * b)
else if (z <= 2.45d-263) then
tmp = x * 2.0d0
else if (z <= 6.8d-110) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -5.5e-27) {
tmp = t_2;
} else if (z <= -1.55e-68) {
tmp = t_1;
} else if (z <= -1.12e-99) {
tmp = t_2;
} else if (z <= -5.1e-249) {
tmp = a * (27.0 * b);
} else if (z <= 2.45e-263) {
tmp = x * 2.0;
} else if (z <= 6.8e-110) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (t * (y * z)) tmp = 0 if z <= -5.5e-27: tmp = t_2 elif z <= -1.55e-68: tmp = t_1 elif z <= -1.12e-99: tmp = t_2 elif z <= -5.1e-249: tmp = a * (27.0 * b) elif z <= 2.45e-263: tmp = x * 2.0 elif z <= 6.8e-110: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -5.5e-27) tmp = t_2; elseif (z <= -1.55e-68) tmp = t_1; elseif (z <= -1.12e-99) tmp = t_2; elseif (z <= -5.1e-249) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 2.45e-263) tmp = Float64(x * 2.0); elseif (z <= 6.8e-110) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -5.5e-27)
tmp = t_2;
elseif (z <= -1.55e-68)
tmp = t_1;
elseif (z <= -1.12e-99)
tmp = t_2;
elseif (z <= -5.1e-249)
tmp = a * (27.0 * b);
elseif (z <= 2.45e-263)
tmp = x * 2.0;
elseif (z <= 6.8e-110)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e-27], t$95$2, If[LessEqual[z, -1.55e-68], t$95$1, If[LessEqual[z, -1.12e-99], t$95$2, If[LessEqual[z, -5.1e-249], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.8e-110], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-99}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-249}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.5000000000000002e-27 or -1.55e-68 < z < -1.11999999999999998e-99 or 6.8000000000000002e-110 < z Initial program 90.4%
sub-neg90.4%
sub-neg90.4%
associate-*l*93.4%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around inf 55.6%
if -5.5000000000000002e-27 < z < -1.55e-68 or 2.4499999999999999e-263 < z < 6.8000000000000002e-110Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 53.7%
if -1.11999999999999998e-99 < z < -5.0999999999999997e-249Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 51.7%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
Simplified51.8%
if -5.0999999999999997e-249 < z < 2.4499999999999999e-263Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*96.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 48.0%
Final simplification54.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* t (* -9.0 (* y z)))))
(if (<= z -6.2e-26)
t_2
(if (<= z -3.3e-68)
t_1
(if (<= z -1.38e-99)
(* -9.0 (* t (* y z)))
(if (<= z -6.5e-246)
(* a (* 27.0 b))
(if (<= z 8e-263) (* x 2.0) (if (<= z 2.6e-111) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = t * (-9.0 * (y * z));
double tmp;
if (z <= -6.2e-26) {
tmp = t_2;
} else if (z <= -3.3e-68) {
tmp = t_1;
} else if (z <= -1.38e-99) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -6.5e-246) {
tmp = a * (27.0 * b);
} else if (z <= 8e-263) {
tmp = x * 2.0;
} else if (z <= 2.6e-111) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = t * ((-9.0d0) * (y * z))
if (z <= (-6.2d-26)) then
tmp = t_2
else if (z <= (-3.3d-68)) then
tmp = t_1
else if (z <= (-1.38d-99)) then
tmp = (-9.0d0) * (t * (y * z))
else if (z <= (-6.5d-246)) then
tmp = a * (27.0d0 * b)
else if (z <= 8d-263) then
tmp = x * 2.0d0
else if (z <= 2.6d-111) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = t * (-9.0 * (y * z));
double tmp;
if (z <= -6.2e-26) {
tmp = t_2;
} else if (z <= -3.3e-68) {
tmp = t_1;
} else if (z <= -1.38e-99) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -6.5e-246) {
tmp = a * (27.0 * b);
} else if (z <= 8e-263) {
tmp = x * 2.0;
} else if (z <= 2.6e-111) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = t * (-9.0 * (y * z)) tmp = 0 if z <= -6.2e-26: tmp = t_2 elif z <= -3.3e-68: tmp = t_1 elif z <= -1.38e-99: tmp = -9.0 * (t * (y * z)) elif z <= -6.5e-246: tmp = a * (27.0 * b) elif z <= 8e-263: tmp = x * 2.0 elif z <= 2.6e-111: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(t * Float64(-9.0 * Float64(y * z))) tmp = 0.0 if (z <= -6.2e-26) tmp = t_2; elseif (z <= -3.3e-68) tmp = t_1; elseif (z <= -1.38e-99) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (z <= -6.5e-246) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 8e-263) tmp = Float64(x * 2.0); elseif (z <= 2.6e-111) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = t * (-9.0 * (y * z));
tmp = 0.0;
if (z <= -6.2e-26)
tmp = t_2;
elseif (z <= -3.3e-68)
tmp = t_1;
elseif (z <= -1.38e-99)
tmp = -9.0 * (t * (y * z));
elseif (z <= -6.5e-246)
tmp = a * (27.0 * b);
elseif (z <= 8e-263)
tmp = x * 2.0;
elseif (z <= 2.6e-111)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e-26], t$95$2, If[LessEqual[z, -3.3e-68], t$95$1, If[LessEqual[z, -1.38e-99], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.5e-246], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.6e-111], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{-99}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-246}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -6.19999999999999966e-26 or 2.59999999999999982e-111 < z Initial program 90.3%
sub-neg90.3%
sub-neg90.3%
associate-*l*93.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 72.7%
Taylor expanded in a around 0 54.5%
*-commutative54.5%
associate-*r*54.5%
*-commutative54.5%
associate-*l*54.5%
Simplified54.5%
Taylor expanded in z around 0 54.5%
if -6.19999999999999966e-26 < z < -3.2999999999999998e-68 or 8.0000000000000001e-263 < z < 2.59999999999999982e-111Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.7%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 50.9%
if -3.2999999999999998e-68 < z < -1.38e-99Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 75.5%
if -1.38e-99 < z < -6.50000000000000016e-246Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 51.7%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
Simplified51.8%
if -6.50000000000000016e-246 < z < 8.0000000000000001e-263Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*96.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 48.0%
Final simplification53.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -9.6e-25)
(* t (* -9.0 (* y z)))
(if (<= z -3e-68)
t_1
(if (<= z -4.35e-100)
(* -9.0 (* t (* y z)))
(if (<= z -1.75e-243)
(* a (* 27.0 b))
(if (<= z 6.6e-263)
(* x 2.0)
(if (<= z 5.5e-110) t_1 (* t (* z (* y -9.0)))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -9.6e-25) {
tmp = t * (-9.0 * (y * z));
} else if (z <= -3e-68) {
tmp = t_1;
} else if (z <= -4.35e-100) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -1.75e-243) {
tmp = a * (27.0 * b);
} else if (z <= 6.6e-263) {
tmp = x * 2.0;
} else if (z <= 5.5e-110) {
tmp = t_1;
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-9.6d-25)) then
tmp = t * ((-9.0d0) * (y * z))
else if (z <= (-3d-68)) then
tmp = t_1
else if (z <= (-4.35d-100)) then
tmp = (-9.0d0) * (t * (y * z))
else if (z <= (-1.75d-243)) then
tmp = a * (27.0d0 * b)
else if (z <= 6.6d-263) then
tmp = x * 2.0d0
else if (z <= 5.5d-110) then
tmp = t_1
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -9.6e-25) {
tmp = t * (-9.0 * (y * z));
} else if (z <= -3e-68) {
tmp = t_1;
} else if (z <= -4.35e-100) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -1.75e-243) {
tmp = a * (27.0 * b);
} else if (z <= 6.6e-263) {
tmp = x * 2.0;
} else if (z <= 5.5e-110) {
tmp = t_1;
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -9.6e-25: tmp = t * (-9.0 * (y * z)) elif z <= -3e-68: tmp = t_1 elif z <= -4.35e-100: tmp = -9.0 * (t * (y * z)) elif z <= -1.75e-243: tmp = a * (27.0 * b) elif z <= 6.6e-263: tmp = x * 2.0 elif z <= 5.5e-110: tmp = t_1 else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -9.6e-25) tmp = Float64(t * Float64(-9.0 * Float64(y * z))); elseif (z <= -3e-68) tmp = t_1; elseif (z <= -4.35e-100) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (z <= -1.75e-243) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 6.6e-263) tmp = Float64(x * 2.0); elseif (z <= 5.5e-110) tmp = t_1; else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -9.6e-25)
tmp = t * (-9.0 * (y * z));
elseif (z <= -3e-68)
tmp = t_1;
elseif (z <= -4.35e-100)
tmp = -9.0 * (t * (y * z));
elseif (z <= -1.75e-243)
tmp = a * (27.0 * b);
elseif (z <= 6.6e-263)
tmp = x * 2.0;
elseif (z <= 5.5e-110)
tmp = t_1;
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e-25], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e-68], t$95$1, If[LessEqual[z, -4.35e-100], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.75e-243], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5.5e-110], t$95$1, N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-25}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.35 \cdot 10^{-100}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-243}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -9.60000000000000037e-25Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around 0 70.1%
Taylor expanded in a around 0 56.6%
*-commutative56.6%
associate-*r*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in z around 0 56.6%
if -9.60000000000000037e-25 < z < -3e-68 or 6.5999999999999994e-263 < z < 5.4999999999999998e-110Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 54.9%
if -3e-68 < z < -4.34999999999999988e-100Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 75.5%
if -4.34999999999999988e-100 < z < -1.74999999999999989e-243Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 50.0%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.1%
Simplified50.1%
if -1.74999999999999989e-243 < z < 6.5999999999999994e-263Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*96.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 46.4%
if 5.4999999999999998e-110 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around 0 74.0%
Taylor expanded in a around 0 54.6%
*-commutative54.6%
associate-*r*54.6%
*-commutative54.6%
associate-*l*54.5%
Simplified54.5%
Final simplification54.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* z (* t y)))))
(if (<= z -4.5e-27)
t_2
(if (<= z -2e-69)
t_1
(if (<= z -2.45e-98)
t_2
(if (<= z -4.4e-246)
(* a (* 27.0 b))
(if (<= z 3.15e-263)
(* x 2.0)
(if (<= z 1.28e-110) t_1 (* t (* z (* y -9.0)))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (t * y));
double tmp;
if (z <= -4.5e-27) {
tmp = t_2;
} else if (z <= -2e-69) {
tmp = t_1;
} else if (z <= -2.45e-98) {
tmp = t_2;
} else if (z <= -4.4e-246) {
tmp = a * (27.0 * b);
} else if (z <= 3.15e-263) {
tmp = x * 2.0;
} else if (z <= 1.28e-110) {
tmp = t_1;
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (z * (t * y))
if (z <= (-4.5d-27)) then
tmp = t_2
else if (z <= (-2d-69)) then
tmp = t_1
else if (z <= (-2.45d-98)) then
tmp = t_2
else if (z <= (-4.4d-246)) then
tmp = a * (27.0d0 * b)
else if (z <= 3.15d-263) then
tmp = x * 2.0d0
else if (z <= 1.28d-110) then
tmp = t_1
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (z * (t * y));
double tmp;
if (z <= -4.5e-27) {
tmp = t_2;
} else if (z <= -2e-69) {
tmp = t_1;
} else if (z <= -2.45e-98) {
tmp = t_2;
} else if (z <= -4.4e-246) {
tmp = a * (27.0 * b);
} else if (z <= 3.15e-263) {
tmp = x * 2.0;
} else if (z <= 1.28e-110) {
tmp = t_1;
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (z * (t * y)) tmp = 0 if z <= -4.5e-27: tmp = t_2 elif z <= -2e-69: tmp = t_1 elif z <= -2.45e-98: tmp = t_2 elif z <= -4.4e-246: tmp = a * (27.0 * b) elif z <= 3.15e-263: tmp = x * 2.0 elif z <= 1.28e-110: tmp = t_1 else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(z * Float64(t * y))) tmp = 0.0 if (z <= -4.5e-27) tmp = t_2; elseif (z <= -2e-69) tmp = t_1; elseif (z <= -2.45e-98) tmp = t_2; elseif (z <= -4.4e-246) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 3.15e-263) tmp = Float64(x * 2.0); elseif (z <= 1.28e-110) tmp = t_1; else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (z * (t * y));
tmp = 0.0;
if (z <= -4.5e-27)
tmp = t_2;
elseif (z <= -2e-69)
tmp = t_1;
elseif (z <= -2.45e-98)
tmp = t_2;
elseif (z <= -4.4e-246)
tmp = a * (27.0 * b);
elseif (z <= 3.15e-263)
tmp = x * 2.0;
elseif (z <= 1.28e-110)
tmp = t_1;
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e-27], t$95$2, If[LessEqual[z, -2e-69], t$95$1, If[LessEqual[z, -2.45e-98], t$95$2, If[LessEqual[z, -4.4e-246], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.28e-110], t$95$1, N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-98}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-246}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.5000000000000002e-27 or -1.9999999999999999e-69 < z < -2.45000000000000007e-98Initial program 89.8%
sub-neg89.8%
sub-neg89.8%
associate-*l*93.7%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 56.8%
*-commutative56.8%
associate-*r*59.2%
Simplified59.2%
if -4.5000000000000002e-27 < z < -1.9999999999999999e-69 or 3.14999999999999986e-263 < z < 1.2799999999999999e-110Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 52.3%
if -2.45000000000000007e-98 < z < -4.39999999999999996e-246Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 51.7%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
Simplified51.8%
if -4.39999999999999996e-246 < z < 3.14999999999999986e-263Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*96.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 48.0%
if 1.2799999999999999e-110 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 74.3%
Taylor expanded in a around 0 53.9%
*-commutative53.9%
associate-*r*53.9%
*-commutative53.9%
associate-*l*53.9%
Simplified53.9%
Final simplification54.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2.85e+79) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (+ (* (* y z) (* t -9.0)) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.85e+79) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= 2.85d+79) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
else
tmp = ((y * z) * (t * (-9.0d0))) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.85e+79) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2.85e+79: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) else: tmp = ((y * z) * (t * -9.0)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.85e+79) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(y * z) * Float64(t * -9.0)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2.85e+79)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
else
tmp = ((y * z) * (t * -9.0)) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.85e+79], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.85 \cdot 10^{+79}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right) + x \cdot 2\\
\end{array}
\end{array}
if z < 2.8499999999999998e79Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*97.1%
associate-*l*97.5%
Simplified97.5%
if 2.8499999999999998e79 < z Initial program 85.0%
sub-neg85.0%
sub-neg85.0%
associate-*l*87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in a around 0 72.4%
cancel-sign-sub-inv72.4%
metadata-eval72.4%
*-commutative72.4%
associate-*l*72.4%
associate-*r*72.4%
+-commutative72.4%
*-commutative72.4%
associate-*r*72.4%
associate-*l*72.4%
Applied egg-rr72.4%
Final simplification93.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2e-11) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-11) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-2d-11)) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-11) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2e-11: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e-11) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2e-11)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e-11], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -1.99999999999999988e-11Initial program 88.9%
sub-neg88.9%
sub-neg88.9%
associate-*l*93.1%
associate-*l*93.0%
Simplified93.0%
if -1.99999999999999988e-11 < z Initial program 95.1%
Final simplification94.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= x -5e+42)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= x 1e+77)
(+ (* a (* 27.0 b)) (* t (* y (* z -9.0))))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5e+42) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (x <= 1e+77) {
tmp = (a * (27.0 * b)) + (t * (y * (z * -9.0)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-5d+42)) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (x <= 1d+77) then
tmp = (a * (27.0d0 * b)) + (t * (y * (z * (-9.0d0))))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5e+42) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (x <= 1e+77) {
tmp = (a * (27.0 * b)) + (t * (y * (z * -9.0)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -5e+42: tmp = (x * 2.0) + (27.0 * (a * b)) elif x <= 1e+77: tmp = (a * (27.0 * b)) + (t * (y * (z * -9.0))) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5e+42) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (x <= 1e+77) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(t * Float64(y * Float64(z * -9.0)))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -5e+42)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (x <= 1e+77)
tmp = (a * (27.0 * b)) + (t * (y * (z * -9.0)));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5e+42], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e+77], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+42}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 10^{+77}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -5.00000000000000007e42Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*98.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around 0 81.6%
if -5.00000000000000007e42 < x < 9.99999999999999983e76Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*93.1%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around 0 86.5%
cancel-sign-sub-inv86.5%
metadata-eval86.5%
*-commutative86.5%
associate-*r*88.9%
+-commutative88.9%
associate-*l*88.9%
associate-*l*86.5%
*-commutative86.5%
associate-*l*86.5%
Applied egg-rr86.5%
if 9.99999999999999983e76 < x Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 82.5%
Final simplification84.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.8e+59) (* -9.0 (* z (* t y))) (if (<= z 6.5e-20) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* z (* y -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e+59) {
tmp = -9.0 * (z * (t * y));
} else if (z <= 6.5e-20) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.8d+59)) then
tmp = (-9.0d0) * (z * (t * y))
else if (z <= 6.5d-20) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e+59) {
tmp = -9.0 * (z * (t * y));
} else if (z <= 6.5e-20) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.8e+59: tmp = -9.0 * (z * (t * y)) elif z <= 6.5e-20: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.8e+59) tmp = Float64(-9.0 * Float64(z * Float64(t * y))); elseif (z <= 6.5e-20) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.8e+59)
tmp = -9.0 * (z * (t * y));
elseif (z <= 6.5e-20)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.8e+59], N[(-9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-20], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+59}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-20}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.7999999999999999e59Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*92.9%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in y around inf 61.8%
*-commutative61.8%
associate-*r*63.4%
Simplified63.4%
if -1.7999999999999999e59 < z < 6.50000000000000032e-20Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*98.4%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 83.2%
if 6.50000000000000032e-20 < z Initial program 88.6%
sub-neg88.6%
sub-neg88.6%
associate-*l*91.5%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in x around 0 74.1%
Taylor expanded in a around 0 61.2%
*-commutative61.2%
associate-*r*61.2%
*-commutative61.2%
associate-*l*61.2%
Simplified61.2%
Final simplification73.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.8e+49) (not (<= x 1.6e+78))) (* x 2.0) (* 27.0 (* a b))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.8e+49) || !(x <= 1.6e+78)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((x <= (-4.8d+49)) .or. (.not. (x <= 1.6d+78))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.8e+49) || !(x <= 1.6e+78)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.8e+49) or not (x <= 1.6e+78): tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.8e+49) || !(x <= 1.6e+78)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -4.8e+49) || ~((x <= 1.6e+78)))
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.8e+49], N[Not[LessEqual[x, 1.6e+78]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+49} \lor \neg \left(x \leq 1.6 \cdot 10^{+78}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -4.8e49 or 1.59999999999999997e78 < x Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in x around inf 60.4%
if -4.8e49 < x < 1.59999999999999997e78Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.2%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around inf 44.8%
Final simplification50.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*95.3%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 28.6%
Final simplification28.6%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023334
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))