
(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 14 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 4.2e+225) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* z -9.0))))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* 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 (t <= 4.2e+225) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (z * -9.0)))));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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 (t <= 4.2e+225) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(z * -9.0))))); else tmp = Float64(t * Float64(Float64(Float64(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * Float64(y * z)))); 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, 4.2e+225], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * 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}\;t \leq 4.2 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 4.2e225Initial program 94.2%
+-commutative94.2%
associate-+r-94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.2%
fma-define97.0%
fma-neg97.0%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
*-commutative97.4%
associate-*l*97.4%
*-commutative97.4%
distribute-lft-neg-in97.4%
associate-*r*97.4%
Simplified97.4%
Taylor expanded in z around 0 97.4%
*-commutative97.4%
associate-*l*97.4%
Simplified97.4%
if 4.2e225 < t Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*75.4%
associate-+l-75.4%
associate-*l*75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*75.2%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in t around inf 93.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 (let* ((t_1 (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0))))) (if (<= t_1 INFINITY) t_1 (* a (* 27.0 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 t_1 = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
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) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (27.0 * b);
}
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) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (27.0 * b) 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(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(27.0 * 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)
t_1 = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = a * (27.0 * 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_] := Block[{t$95$1 = N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) < +inf.0Initial program 96.0%
if +inf.0 < (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) Initial program 0.0%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
cancel-sign-sub-inv0.0%
associate-*r*0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
cancel-sign-sub-inv0.0%
associate-+r-0.0%
associate-*l*12.5%
fma-define37.5%
fma-neg37.5%
associate-*l*37.5%
distribute-rgt-neg-in37.5%
*-commutative37.5%
associate-*l*37.5%
*-commutative37.5%
distribute-lft-neg-in37.5%
associate-*r*37.5%
Simplified37.5%
Taylor expanded in z around 0 37.5%
*-commutative37.5%
associate-*l*37.5%
Simplified37.5%
Taylor expanded in a around inf 62.5%
associate-*r*62.5%
*-commutative62.5%
associate-*r*62.5%
Simplified62.5%
Final simplification95.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
(if (<= z -6.2e+81)
(+ (* y (* t (* z -9.0))) (* a (* 27.0 b)))
(if (<= z -2.65e-15)
(- (* x 2.0) (* 9.0 (* t (* y z))))
(if (<= z 1.35e-78)
(+ (* x 2.0) (* 27.0 (* a b)))
(* t (- (* 27.0 (/ (* a b) t)) (* 9.0 (* 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 (z <= -6.2e+81) {
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
} else if (z <= -2.65e-15) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else if (z <= 1.35e-78) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (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 (z <= (-6.2d+81)) then
tmp = (y * (t * (z * (-9.0d0)))) + (a * (27.0d0 * b))
else if (z <= (-2.65d-15)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else if (z <= 1.35d-78) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * ((27.0d0 * ((a * b) / t)) - (9.0d0 * (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 (z <= -6.2e+81) {
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
} else if (z <= -2.65e-15) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else if (z <= 1.35e-78) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (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 z <= -6.2e+81: tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b)) elif z <= -2.65e-15: tmp = (x * 2.0) - (9.0 * (t * (y * z))) elif z <= 1.35e-78: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (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 (z <= -6.2e+81) tmp = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(a * Float64(27.0 * b))); elseif (z <= -2.65e-15) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); elseif (z <= 1.35e-78) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(Float64(27.0 * Float64(Float64(a * b) / t)) - Float64(9.0 * 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 (z <= -6.2e+81)
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
elseif (z <= -2.65e-15)
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
elseif (z <= 1.35e-78)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (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[z, -6.2e+81], N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.65e-15], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-78], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * 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}\;z \leq -6.2 \cdot 10^{+81}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -2.65 \cdot 10^{-15}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-78}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(27 \cdot \frac{a \cdot b}{t} - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -6.2e81Initial program 92.1%
associate-+l-92.1%
*-commutative92.1%
*-commutative92.1%
associate-*l*92.2%
associate-+l-92.2%
associate-*l*92.1%
*-commutative92.1%
*-commutative92.1%
associate-*l*96.0%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around 0 76.7%
cancel-sign-sub-inv76.7%
metadata-eval76.7%
+-commutative76.7%
*-commutative76.7%
associate-*r*82.4%
*-commutative82.4%
associate-*r*82.3%
associate-*r*80.6%
*-commutative80.6%
associate-*r*80.6%
*-commutative80.6%
Applied egg-rr80.6%
if -6.2e81 < z < -2.6500000000000001e-15Initial program 95.5%
associate-+l-95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around 0 58.5%
if -2.6500000000000001e-15 < z < 1.34999999999999997e-78Initial program 99.0%
+-commutative99.0%
associate-+r-99.0%
*-commutative99.0%
cancel-sign-sub-inv99.0%
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-define95.4%
cancel-sign-sub-inv95.4%
fma-define95.4%
distribute-lft-neg-in95.4%
distribute-rgt-neg-in95.4%
*-commutative95.4%
associate-*r*98.9%
associate-*l*99.0%
neg-mul-199.0%
associate-*r*99.0%
Simplified99.0%
Taylor expanded in t around 0 85.6%
if 1.34999999999999997e-78 < z Initial program 84.9%
associate-+l-84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
associate-+l-84.9%
associate-*l*84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*87.3%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around 0 68.5%
Taylor expanded in t around inf 66.4%
Final simplification76.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 (<= b -6.2e-77)
(* b (* a 27.0))
(if (<= b 8.8e-178)
(* -9.0 (* y (* t z)))
(if (<= b 1.25e-26)
(* x 2.0)
(if (<= b 2.15e-7) (* -9.0 (* t (* y z))) (* a (* 27.0 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 (b <= -6.2e-77) {
tmp = b * (a * 27.0);
} else if (b <= 8.8e-178) {
tmp = -9.0 * (y * (t * z));
} else if (b <= 1.25e-26) {
tmp = x * 2.0;
} else if (b <= 2.15e-7) {
tmp = -9.0 * (t * (y * z));
} else {
tmp = a * (27.0 * 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 (b <= (-6.2d-77)) then
tmp = b * (a * 27.0d0)
else if (b <= 8.8d-178) then
tmp = (-9.0d0) * (y * (t * z))
else if (b <= 1.25d-26) then
tmp = x * 2.0d0
else if (b <= 2.15d-7) then
tmp = (-9.0d0) * (t * (y * z))
else
tmp = a * (27.0d0 * 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 (b <= -6.2e-77) {
tmp = b * (a * 27.0);
} else if (b <= 8.8e-178) {
tmp = -9.0 * (y * (t * z));
} else if (b <= 1.25e-26) {
tmp = x * 2.0;
} else if (b <= 2.15e-7) {
tmp = -9.0 * (t * (y * z));
} else {
tmp = a * (27.0 * 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 b <= -6.2e-77: tmp = b * (a * 27.0) elif b <= 8.8e-178: tmp = -9.0 * (y * (t * z)) elif b <= 1.25e-26: tmp = x * 2.0 elif b <= 2.15e-7: tmp = -9.0 * (t * (y * z)) else: tmp = a * (27.0 * 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 (b <= -6.2e-77) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 8.8e-178) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (b <= 1.25e-26) tmp = Float64(x * 2.0); elseif (b <= 2.15e-7) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); else tmp = Float64(a * Float64(27.0 * 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 (b <= -6.2e-77)
tmp = b * (a * 27.0);
elseif (b <= 8.8e-178)
tmp = -9.0 * (y * (t * z));
elseif (b <= 1.25e-26)
tmp = x * 2.0;
elseif (b <= 2.15e-7)
tmp = -9.0 * (t * (y * z));
else
tmp = a * (27.0 * 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[LessEqual[b, -6.2e-77], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.8e-178], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e-26], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.15e-7], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * 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}\;b \leq -6.2 \cdot 10^{-77}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 8.8 \cdot 10^{-178}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-7}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -6.20000000000000016e-77Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.4%
associate-*l*92.3%
fma-define94.9%
cancel-sign-sub-inv94.9%
fma-define94.9%
distribute-lft-neg-in94.9%
distribute-rgt-neg-in94.9%
*-commutative94.9%
associate-*r*92.5%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in a around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.3%
*-commutative61.3%
Simplified61.3%
if -6.20000000000000016e-77 < b < 8.8000000000000005e-178Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define97.2%
fma-neg97.2%
associate-*l*98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
associate-*l*98.5%
*-commutative98.5%
distribute-lft-neg-in98.5%
associate-*r*98.4%
Simplified98.4%
Taylor expanded in z around 0 98.5%
*-commutative98.5%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around inf 46.8%
associate-*r*48.2%
*-commutative48.2%
associate-*r*49.4%
Simplified49.4%
if 8.8000000000000005e-178 < b < 1.25000000000000005e-26Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-*r*96.8%
distribute-lft-neg-in96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-+r-96.8%
associate-*l*99.9%
fma-define99.9%
fma-neg99.9%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
*-commutative99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 61.2%
if 1.25000000000000005e-26 < b < 2.1500000000000001e-7Initial program 68.1%
+-commutative68.1%
associate-+r-68.1%
*-commutative68.1%
cancel-sign-sub-inv68.1%
associate-*r*99.5%
distribute-lft-neg-in99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
associate-+r-99.5%
associate-*l*99.5%
fma-define99.5%
cancel-sign-sub-inv99.5%
fma-define99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
*-commutative99.5%
associate-*r*68.1%
associate-*l*68.3%
neg-mul-168.3%
associate-*r*68.3%
Simplified68.3%
Taylor expanded in t around inf 68.1%
if 2.1500000000000001e-7 < b Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r-93.9%
associate-*l*93.9%
fma-define93.9%
fma-neg93.9%
associate-*l*92.3%
distribute-rgt-neg-in92.3%
*-commutative92.3%
associate-*l*92.3%
*-commutative92.3%
distribute-lft-neg-in92.3%
associate-*r*92.4%
Simplified92.4%
Taylor expanded in z around 0 92.3%
*-commutative92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around inf 63.9%
associate-*r*64.0%
*-commutative64.0%
associate-*r*63.9%
Simplified63.9%
Final simplification58.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
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= b -1.85e-79)
(* b (* a 27.0))
(if (<= b 1e-199)
t_1
(if (<= b 1.26e-26)
(* x 2.0)
(if (<= b 2.2e-7) t_1 (* a (* 27.0 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 t_1 = -9.0 * (t * (y * z));
double tmp;
if (b <= -1.85e-79) {
tmp = b * (a * 27.0);
} else if (b <= 1e-199) {
tmp = t_1;
} else if (b <= 1.26e-26) {
tmp = x * 2.0;
} else if (b <= 2.2e-7) {
tmp = t_1;
} else {
tmp = a * (27.0 * 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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (b <= (-1.85d-79)) then
tmp = b * (a * 27.0d0)
else if (b <= 1d-199) then
tmp = t_1
else if (b <= 1.26d-26) then
tmp = x * 2.0d0
else if (b <= 2.2d-7) then
tmp = t_1
else
tmp = a * (27.0d0 * 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 t_1 = -9.0 * (t * (y * z));
double tmp;
if (b <= -1.85e-79) {
tmp = b * (a * 27.0);
} else if (b <= 1e-199) {
tmp = t_1;
} else if (b <= 1.26e-26) {
tmp = x * 2.0;
} else if (b <= 2.2e-7) {
tmp = t_1;
} else {
tmp = a * (27.0 * b);
}
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 = -9.0 * (t * (y * z)) tmp = 0 if b <= -1.85e-79: tmp = b * (a * 27.0) elif b <= 1e-199: tmp = t_1 elif b <= 1.26e-26: tmp = x * 2.0 elif b <= 2.2e-7: tmp = t_1 else: tmp = a * (27.0 * b) 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(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (b <= -1.85e-79) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 1e-199) tmp = t_1; elseif (b <= 1.26e-26) tmp = Float64(x * 2.0); elseif (b <= 2.2e-7) tmp = t_1; else tmp = Float64(a * Float64(27.0 * 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)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (b <= -1.85e-79)
tmp = b * (a * 27.0);
elseif (b <= 1e-199)
tmp = t_1;
elseif (b <= 1.26e-26)
tmp = x * 2.0;
elseif (b <= 2.2e-7)
tmp = t_1;
else
tmp = a * (27.0 * 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_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.85e-79], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-199], t$95$1, If[LessEqual[b, 1.26e-26], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.2e-7], t$95$1, N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;b \leq -1.85 \cdot 10^{-79}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.26 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -1.85000000000000009e-79Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.4%
associate-*l*92.3%
fma-define94.9%
cancel-sign-sub-inv94.9%
fma-define94.9%
distribute-lft-neg-in94.9%
distribute-rgt-neg-in94.9%
*-commutative94.9%
associate-*r*92.5%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in a around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.3%
*-commutative61.3%
Simplified61.3%
if -1.85000000000000009e-79 < b < 9.99999999999999982e-200 or 1.26000000000000002e-26 < b < 2.2000000000000001e-7Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*97.3%
distribute-lft-neg-in97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-+r-97.3%
associate-*l*97.3%
fma-define97.3%
cancel-sign-sub-inv97.3%
fma-define97.3%
distribute-lft-neg-in97.3%
distribute-rgt-neg-in97.3%
*-commutative97.3%
associate-*r*93.6%
associate-*l*93.6%
neg-mul-193.6%
associate-*r*93.6%
Simplified93.6%
Taylor expanded in t around inf 48.9%
if 9.99999999999999982e-200 < b < 1.26000000000000002e-26Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-*r*97.0%
distribute-lft-neg-in97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-+r-97.0%
associate-*l*99.9%
fma-define99.9%
fma-neg99.9%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 56.5%
if 2.2000000000000001e-7 < b Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r-93.9%
associate-*l*93.9%
fma-define93.9%
fma-neg93.9%
associate-*l*92.3%
distribute-rgt-neg-in92.3%
*-commutative92.3%
associate-*l*92.3%
*-commutative92.3%
distribute-lft-neg-in92.3%
associate-*r*92.4%
Simplified92.4%
Taylor expanded in z around 0 92.3%
*-commutative92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around inf 63.9%
associate-*r*64.0%
*-commutative64.0%
associate-*r*63.9%
Simplified63.9%
Final simplification57.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 (<= t 1.4e+123) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* 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 (t <= 1.4e+123) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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 (t <= 1.4d+123) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
else
tmp = t * (((2.0d0 * (x / t)) + (27.0d0 * ((a * b) / t))) - (9.0d0 * (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 (t <= 1.4e+123) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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 t <= 1.4e+123: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) else: tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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 (t <= 1.4e+123) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(t * Float64(Float64(Float64(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * 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 (t <= 1.4e+123)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
else
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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[t, 1.4e+123], 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[(t * N[(N[(N[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * 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}\;t \leq 1.4 \cdot 10^{+123}:\\
\;\;\;\;\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}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 1.40000000000000006e123Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
if 1.40000000000000006e123 < t Initial program 87.5%
associate-+l-87.5%
*-commutative87.5%
*-commutative87.5%
associate-*l*87.5%
associate-+l-87.5%
associate-*l*87.5%
*-commutative87.5%
*-commutative87.5%
associate-*l*87.4%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in t around inf 96.7%
Final simplification96.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 (* 9.0 (* t (* y z)))) (t_2 (* 27.0 (* a b))))
(if (<= b -1.35e-50)
(+ (* x 2.0) t_2)
(if (<= b 2.05e+54) (- (* x 2.0) t_1) (- t_2 t_1)))))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 = 9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.35e-50) {
tmp = (x * 2.0) + t_2;
} else if (b <= 2.05e+54) {
tmp = (x * 2.0) - t_1;
} else {
tmp = t_2 - t_1;
}
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 = 9.0d0 * (t * (y * z))
t_2 = 27.0d0 * (a * b)
if (b <= (-1.35d-50)) then
tmp = (x * 2.0d0) + t_2
else if (b <= 2.05d+54) then
tmp = (x * 2.0d0) - t_1
else
tmp = t_2 - t_1
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 = 9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.35e-50) {
tmp = (x * 2.0) + t_2;
} else if (b <= 2.05e+54) {
tmp = (x * 2.0) - t_1;
} else {
tmp = t_2 - t_1;
}
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 = 9.0 * (t * (y * z)) t_2 = 27.0 * (a * b) tmp = 0 if b <= -1.35e-50: tmp = (x * 2.0) + t_2 elif b <= 2.05e+54: tmp = (x * 2.0) - t_1 else: tmp = t_2 - t_1 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(9.0 * Float64(t * Float64(y * z))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -1.35e-50) tmp = Float64(Float64(x * 2.0) + t_2); elseif (b <= 2.05e+54) tmp = Float64(Float64(x * 2.0) - t_1); else tmp = Float64(t_2 - t_1); 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 = 9.0 * (t * (y * z));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -1.35e-50)
tmp = (x * 2.0) + t_2;
elseif (b <= 2.05e+54)
tmp = (x * 2.0) - t_1;
else
tmp = t_2 - t_1;
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[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.35e-50], N[(N[(x * 2.0), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[b, 2.05e+54], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.35 \cdot 10^{-50}:\\
\;\;\;\;x \cdot 2 + t\_2\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{+54}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_1\\
\end{array}
\end{array}
if b < -1.35e-50Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
*-commutative89.4%
cancel-sign-sub-inv89.4%
associate-*r*91.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-+r-91.9%
associate-*l*91.9%
fma-define94.6%
cancel-sign-sub-inv94.6%
fma-define94.6%
distribute-lft-neg-in94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*r*92.1%
associate-*l*92.1%
neg-mul-192.1%
associate-*r*92.1%
Simplified92.1%
Taylor expanded in t around 0 76.7%
if -1.35e-50 < b < 2.04999999999999984e54Initial program 94.7%
associate-+l-94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*94.7%
associate-+l-94.7%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
associate-*l*98.3%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in a around 0 83.4%
if 2.04999999999999984e54 < b Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+l-94.2%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*90.6%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in x around 0 83.3%
Final simplification81.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 (<= z 9e+98) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (- (* 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 (z <= 9e+98) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} 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 (z <= 9d+98) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
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 (z <= 9e+98) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} 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 z <= 9e+98: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) 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 (z <= 9e+98) 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(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 (z <= 9e+98)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
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[z, 9e+98], 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[(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}\;z \leq 9 \cdot 10^{+98}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 9.0000000000000004e98Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*96.7%
associate-+l-96.7%
associate-*l*96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*98.5%
associate-*l*98.4%
Simplified98.4%
if 9.0000000000000004e98 < z Initial program 74.4%
associate-+l-74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*74.4%
associate-+l-74.4%
associate-*l*74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*78.7%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in a around 0 69.8%
Final simplification93.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 (or (<= b -1.46e-49) (not (<= b 6.6e-8))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* 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 ((b <= -1.46e-49) || !(b <= 6.6e-8)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 ((b <= (-1.46d-49)) .or. (.not. (b <= 6.6d-8))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
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 ((b <= -1.46e-49) || !(b <= 6.6e-8)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 (b <= -1.46e-49) or not (b <= 6.6e-8): tmp = (x * 2.0) + (27.0 * (a * b)) 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 ((b <= -1.46e-49) || !(b <= 6.6e-8)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); 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 ((b <= -1.46e-49) || ~((b <= 6.6e-8)))
tmp = (x * 2.0) + (27.0 * (a * b));
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[Or[LessEqual[b, -1.46e-49], N[Not[LessEqual[b, 6.6e-8]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $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}\;b \leq -1.46 \cdot 10^{-49} \lor \neg \left(b \leq 6.6 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if b < -1.46000000000000007e-49 or 6.59999999999999954e-8 < b Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-+r-92.9%
associate-*l*92.8%
fma-define94.3%
cancel-sign-sub-inv94.3%
fma-define94.3%
distribute-lft-neg-in94.3%
distribute-rgt-neg-in94.3%
*-commutative94.3%
associate-*r*93.6%
associate-*l*93.6%
neg-mul-193.6%
associate-*r*93.6%
Simplified93.6%
Taylor expanded in t around 0 77.0%
if -1.46000000000000007e-49 < b < 6.59999999999999954e-8Initial program 94.1%
associate-+l-94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
associate-+l-94.1%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*98.1%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in a around 0 87.1%
Final simplification81.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.05e-8) (* -9.0 (* y (* t z))) (if (<= z 4.4e+94) (+ (* x 2.0) (* 27.0 (* a b))) (* z (* y (* t -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.05e-8) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 4.4e+94) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = z * (y * (t * -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.05d-8)) then
tmp = (-9.0d0) * (y * (t * z))
else if (z <= 4.4d+94) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = z * (y * (t * (-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.05e-8) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 4.4e+94) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = z * (y * (t * -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.05e-8: tmp = -9.0 * (y * (t * z)) elif z <= 4.4e+94: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = z * (y * (t * -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.05e-8) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (z <= 4.4e+94) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(z * Float64(y * Float64(t * -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.05e-8)
tmp = -9.0 * (y * (t * z));
elseif (z <= 4.4e+94)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = z * (y * (t * -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.05e-8], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+94], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(t * -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.05 \cdot 10^{-8}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+94}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.04999999999999997e-8Initial program 92.9%
+-commutative92.9%
associate-+r-92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-*r*98.4%
distribute-lft-neg-in98.4%
*-commutative98.4%
cancel-sign-sub-inv98.4%
associate-+r-98.4%
associate-*l*98.4%
fma-define98.4%
fma-neg98.4%
associate-*l*97.0%
distribute-rgt-neg-in97.0%
*-commutative97.0%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*r*97.0%
Simplified97.0%
Taylor expanded in z around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around inf 48.8%
associate-*r*51.5%
*-commutative51.5%
associate-*r*50.1%
Simplified50.1%
if -1.04999999999999997e-8 < z < 4.40000000000000024e94Initial program 98.5%
+-commutative98.5%
associate-+r-98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
associate-*r*95.9%
distribute-lft-neg-in95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-+r-95.9%
associate-*l*95.9%
fma-define95.9%
cancel-sign-sub-inv95.9%
fma-define95.9%
distribute-lft-neg-in95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*r*98.5%
associate-*l*98.5%
neg-mul-198.5%
associate-*r*98.5%
Simplified98.5%
Taylor expanded in t around 0 81.5%
if 4.40000000000000024e94 < z Initial program 74.4%
+-commutative74.4%
associate-+r-74.4%
*-commutative74.4%
cancel-sign-sub-inv74.4%
associate-*r*85.6%
distribute-lft-neg-in85.6%
*-commutative85.6%
cancel-sign-sub-inv85.6%
associate-+r-85.6%
associate-*l*87.9%
fma-define92.7%
fma-neg92.7%
associate-*l*85.9%
distribute-rgt-neg-in85.9%
*-commutative85.9%
associate-*l*85.9%
*-commutative85.9%
distribute-lft-neg-in85.9%
associate-*r*85.9%
Simplified85.9%
Taylor expanded in z around 0 85.9%
*-commutative85.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in y around inf 61.0%
associate-*r*70.1%
associate-*r*69.9%
*-commutative69.9%
associate-*r*70.1%
*-commutative70.1%
Simplified70.1%
Final simplification71.2%
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 (<= b -5e-6) (not (<= b 3.9e+50))) (* a (* 27.0 b)) (* 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 ((b <= -5e-6) || !(b <= 3.9e+50)) {
tmp = a * (27.0 * b);
} else {
tmp = 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 ((b <= (-5d-6)) .or. (.not. (b <= 3.9d+50))) then
tmp = a * (27.0d0 * b)
else
tmp = 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 ((b <= -5e-6) || !(b <= 3.9e+50)) {
tmp = a * (27.0 * b);
} else {
tmp = 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 (b <= -5e-6) or not (b <= 3.9e+50): tmp = a * (27.0 * b) else: tmp = 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 ((b <= -5e-6) || !(b <= 3.9e+50)) tmp = Float64(a * Float64(27.0 * b)); else tmp = 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 ((b <= -5e-6) || ~((b <= 3.9e+50)))
tmp = a * (27.0 * b);
else
tmp = 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[Or[LessEqual[b, -5e-6], N[Not[LessEqual[b, 3.9e+50]], $MachinePrecision]], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-6} \lor \neg \left(b \leq 3.9 \cdot 10^{+50}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -5.00000000000000041e-6 or 3.89999999999999967e50 < b Initial program 90.7%
+-commutative90.7%
associate-+r-90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.4%
associate-*l*92.3%
fma-define94.0%
fma-neg94.0%
associate-*l*93.2%
distribute-rgt-neg-in93.2%
*-commutative93.2%
associate-*l*93.2%
*-commutative93.2%
distribute-lft-neg-in93.2%
associate-*r*93.2%
Simplified93.2%
Taylor expanded in z around 0 93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 67.8%
associate-*r*67.8%
*-commutative67.8%
associate-*r*67.8%
Simplified67.8%
if -5.00000000000000041e-6 < b < 3.89999999999999967e50Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-*r*97.0%
distribute-lft-neg-in97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-+r-97.0%
associate-*l*97.7%
fma-define97.7%
fma-neg97.7%
associate-*l*99.1%
distribute-rgt-neg-in99.1%
*-commutative99.1%
associate-*l*99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
associate-*r*99.1%
Simplified99.1%
Taylor expanded in z around 0 99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around inf 42.6%
Final simplification54.2%
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 (<= b -13.5) (not (<= b 1.15e+51))) (* 27.0 (* a b)) (* 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 ((b <= -13.5) || !(b <= 1.15e+51)) {
tmp = 27.0 * (a * b);
} else {
tmp = 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 ((b <= (-13.5d0)) .or. (.not. (b <= 1.15d+51))) then
tmp = 27.0d0 * (a * b)
else
tmp = 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 ((b <= -13.5) || !(b <= 1.15e+51)) {
tmp = 27.0 * (a * b);
} else {
tmp = 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 (b <= -13.5) or not (b <= 1.15e+51): tmp = 27.0 * (a * b) else: tmp = 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 ((b <= -13.5) || !(b <= 1.15e+51)) tmp = Float64(27.0 * Float64(a * b)); else tmp = 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 ((b <= -13.5) || ~((b <= 1.15e+51)))
tmp = 27.0 * (a * b);
else
tmp = 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[Or[LessEqual[b, -13.5], N[Not[LessEqual[b, 1.15e+51]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -13.5 \lor \neg \left(b \leq 1.15 \cdot 10^{+51}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -13.5 or 1.15000000000000003e51 < b Initial program 90.7%
+-commutative90.7%
associate-+r-90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.4%
associate-*l*92.3%
fma-define94.0%
cancel-sign-sub-inv94.0%
fma-define94.0%
distribute-lft-neg-in94.0%
distribute-rgt-neg-in94.0%
*-commutative94.0%
associate-*r*92.4%
associate-*l*92.4%
neg-mul-192.4%
associate-*r*92.4%
Simplified92.4%
Taylor expanded in a around inf 67.8%
if -13.5 < b < 1.15000000000000003e51Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-*r*97.0%
distribute-lft-neg-in97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-+r-97.0%
associate-*l*97.7%
fma-define97.7%
fma-neg97.7%
associate-*l*99.1%
distribute-rgt-neg-in99.1%
*-commutative99.1%
associate-*l*99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
associate-*r*99.1%
Simplified99.1%
Taylor expanded in z around 0 99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around inf 42.6%
Final simplification54.2%
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 (<= b -0.0142) (* b (* a 27.0)) (if (<= b 3.9e+50) (* x 2.0) (* a (* 27.0 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 (b <= -0.0142) {
tmp = b * (a * 27.0);
} else if (b <= 3.9e+50) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 (b <= (-0.0142d0)) then
tmp = b * (a * 27.0d0)
else if (b <= 3.9d+50) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * 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 (b <= -0.0142) {
tmp = b * (a * 27.0);
} else if (b <= 3.9e+50) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 b <= -0.0142: tmp = b * (a * 27.0) elif b <= 3.9e+50: tmp = x * 2.0 else: tmp = a * (27.0 * 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 (b <= -0.0142) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 3.9e+50) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * 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 (b <= -0.0142)
tmp = b * (a * 27.0);
elseif (b <= 3.9e+50)
tmp = x * 2.0;
else
tmp = a * (27.0 * 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[LessEqual[b, -0.0142], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e+50], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * 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}\;b \leq -0.0142:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 3.9 \cdot 10^{+50}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -0.014200000000000001Initial program 87.9%
+-commutative87.9%
associate-+r-87.9%
*-commutative87.9%
cancel-sign-sub-inv87.9%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define95.3%
distribute-lft-neg-in95.3%
distribute-rgt-neg-in95.3%
*-commutative95.3%
associate-*r*91.0%
associate-*l*91.0%
neg-mul-191.0%
associate-*r*91.0%
Simplified91.0%
Taylor expanded in a around inf 68.4%
*-commutative68.4%
*-commutative68.4%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -0.014200000000000001 < b < 3.89999999999999967e50Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-*r*97.0%
distribute-lft-neg-in97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-+r-97.0%
associate-*l*97.7%
fma-define97.7%
fma-neg97.7%
associate-*l*99.1%
distribute-rgt-neg-in99.1%
*-commutative99.1%
associate-*l*99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
associate-*r*99.1%
Simplified99.1%
Taylor expanded in z around 0 99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in x around inf 42.6%
if 3.89999999999999967e50 < b Initial program 94.2%
+-commutative94.2%
associate-+r-94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-*r*92.4%
distribute-lft-neg-in92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
associate-+r-92.4%
associate-*l*92.4%
fma-define92.4%
fma-neg92.4%
associate-*l*90.5%
distribute-rgt-neg-in90.5%
*-commutative90.5%
associate-*l*90.5%
*-commutative90.5%
distribute-lft-neg-in90.5%
associate-*r*90.6%
Simplified90.6%
Taylor expanded in z around 0 90.5%
*-commutative90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in a around inf 66.9%
associate-*r*67.0%
*-commutative67.0%
associate-*r*67.0%
Simplified67.0%
Final simplification54.3%
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.0%
+-commutative93.0%
associate-+r-93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*95.3%
fma-define96.0%
fma-neg96.0%
associate-*l*96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*l*96.4%
*-commutative96.4%
distribute-lft-neg-in96.4%
associate-*r*96.4%
Simplified96.4%
Taylor expanded in z around 0 96.4%
*-commutative96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 29.0%
Final simplification29.0%
(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 2024133
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))