
(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 13 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 (<= z 2e+37) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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+37) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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+37) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.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[z, 2e+37], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\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^{+37}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.99999999999999991e37Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*91.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-+r-91.9%
associate-*l*92.0%
fma-define93.0%
fma-neg93.0%
associate-*l*98.1%
distribute-rgt-neg-in98.1%
*-commutative98.1%
associate-*l*98.1%
*-commutative98.1%
distribute-lft-neg-in98.1%
associate-*r*98.2%
Simplified98.2%
if 1.99999999999999991e37 < z Initial program 92.2%
Final simplification96.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 (if (<= z 7.8e+57) (fma a (* 27.0 b) (- (* x 2.0) (* y (* 9.0 (* z t))))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= 7.8e+57) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 7.8e+57) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.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[z, 7.8e+57], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.8 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 7.79999999999999937e57Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*92.1%
distribute-lft-neg-in92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-+r-92.1%
associate-*l*92.1%
fma-define93.1%
fma-neg93.1%
associate-*l*98.2%
distribute-rgt-neg-in98.2%
*-commutative98.2%
associate-*l*98.1%
*-commutative98.1%
distribute-lft-neg-in98.1%
associate-*r*98.2%
Simplified98.2%
*-commutative98.2%
associate-*r*98.1%
associate-*l*98.2%
metadata-eval98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
distribute-rgt-neg-in98.2%
*-commutative98.2%
fma-neg98.2%
associate-*l*98.1%
Applied egg-rr98.1%
if 7.79999999999999937e57 < z Initial program 91.6%
Final simplification96.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 (* z y)))))
(if (<= z -8e+24)
t_1
(if (<= z -1.25e-29)
(* b (* a 27.0))
(if (<= z -2.6e-135)
t_1
(if (<= z -2.2e-232)
(* 27.0 (* a b))
(if (<= z 5.6e-72) (* x 2.0) 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 * (z * y));
double tmp;
if (z <= -8e+24) {
tmp = t_1;
} else if (z <= -1.25e-29) {
tmp = b * (a * 27.0);
} else if (z <= -2.6e-135) {
tmp = t_1;
} else if (z <= -2.2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 5.6e-72) {
tmp = x * 2.0;
} else {
tmp = 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) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (z <= (-8d+24)) then
tmp = t_1
else if (z <= (-1.25d-29)) then
tmp = b * (a * 27.0d0)
else if (z <= (-2.6d-135)) then
tmp = t_1
else if (z <= (-2.2d-232)) then
tmp = 27.0d0 * (a * b)
else if (z <= 5.6d-72) then
tmp = x * 2.0d0
else
tmp = 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 * (z * y));
double tmp;
if (z <= -8e+24) {
tmp = t_1;
} else if (z <= -1.25e-29) {
tmp = b * (a * 27.0);
} else if (z <= -2.6e-135) {
tmp = t_1;
} else if (z <= -2.2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 5.6e-72) {
tmp = x * 2.0;
} else {
tmp = 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 * (z * y)) tmp = 0 if z <= -8e+24: tmp = t_1 elif z <= -1.25e-29: tmp = b * (a * 27.0) elif z <= -2.6e-135: tmp = t_1 elif z <= -2.2e-232: tmp = 27.0 * (a * b) elif z <= 5.6e-72: tmp = x * 2.0 else: tmp = 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(z * y))) tmp = 0.0 if (z <= -8e+24) tmp = t_1; elseif (z <= -1.25e-29) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= -2.6e-135) tmp = t_1; elseif (z <= -2.2e-232) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 5.6e-72) tmp = Float64(x * 2.0); else tmp = 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 * (z * y));
tmp = 0.0;
if (z <= -8e+24)
tmp = t_1;
elseif (z <= -1.25e-29)
tmp = b * (a * 27.0);
elseif (z <= -2.6e-135)
tmp = t_1;
elseif (z <= -2.2e-232)
tmp = 27.0 * (a * b);
elseif (z <= 5.6e-72)
tmp = x * 2.0;
else
tmp = 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[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+24], t$95$1, If[LessEqual[z, -1.25e-29], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-135], t$95$1, If[LessEqual[z, -2.2e-232], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-72], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]
\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(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-232}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-72}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.9999999999999999e24 or -1.24999999999999996e-29 < z < -2.60000000000000004e-135 or 5.5999999999999996e-72 < z Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*91.3%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in y around inf 51.6%
if -7.9999999999999999e24 < z < -1.24999999999999996e-29Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 38.2%
associate-*r*38.2%
Simplified38.2%
if -2.60000000000000004e-135 < z < -2.20000000000000002e-232Initial 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 67.8%
if -2.20000000000000002e-232 < z < 5.5999999999999996e-72Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 54.8%
Final simplification53.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 (- (* x 2.0) (* 9.0 (* t (* z y))))))
(if (<= (* x 2.0) -2e-42)
t_2
(if (<= (* x 2.0) 4e-37)
(+ t_1 (* t (* z (* y -9.0))))
(if (<= (* x 2.0) 5e+184) t_2 (+ (* x 2.0) 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 = 27.0 * (a * b);
double t_2 = (x * 2.0) - (9.0 * (t * (z * y)));
double tmp;
if ((x * 2.0) <= -2e-42) {
tmp = t_2;
} else if ((x * 2.0) <= 4e-37) {
tmp = t_1 + (t * (z * (y * -9.0)));
} else if ((x * 2.0) <= 5e+184) {
tmp = t_2;
} else {
tmp = (x * 2.0) + 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 = 27.0d0 * (a * b)
t_2 = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
if ((x * 2.0d0) <= (-2d-42)) then
tmp = t_2
else if ((x * 2.0d0) <= 4d-37) then
tmp = t_1 + (t * (z * (y * (-9.0d0))))
else if ((x * 2.0d0) <= 5d+184) then
tmp = t_2
else
tmp = (x * 2.0d0) + 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 = 27.0 * (a * b);
double t_2 = (x * 2.0) - (9.0 * (t * (z * y)));
double tmp;
if ((x * 2.0) <= -2e-42) {
tmp = t_2;
} else if ((x * 2.0) <= 4e-37) {
tmp = t_1 + (t * (z * (y * -9.0)));
} else if ((x * 2.0) <= 5e+184) {
tmp = t_2;
} else {
tmp = (x * 2.0) + 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 = 27.0 * (a * b) t_2 = (x * 2.0) - (9.0 * (t * (z * y))) tmp = 0 if (x * 2.0) <= -2e-42: tmp = t_2 elif (x * 2.0) <= 4e-37: tmp = t_1 + (t * (z * (y * -9.0))) elif (x * 2.0) <= 5e+184: tmp = t_2 else: tmp = (x * 2.0) + 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(27.0 * Float64(a * b)) t_2 = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))) tmp = 0.0 if (Float64(x * 2.0) <= -2e-42) tmp = t_2; elseif (Float64(x * 2.0) <= 4e-37) tmp = Float64(t_1 + Float64(t * Float64(z * Float64(y * -9.0)))); elseif (Float64(x * 2.0) <= 5e+184) tmp = t_2; else tmp = Float64(Float64(x * 2.0) + 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 = 27.0 * (a * b);
t_2 = (x * 2.0) - (9.0 * (t * (z * y)));
tmp = 0.0;
if ((x * 2.0) <= -2e-42)
tmp = t_2;
elseif ((x * 2.0) <= 4e-37)
tmp = t_1 + (t * (z * (y * -9.0)));
elseif ((x * 2.0) <= 5e+184)
tmp = t_2;
else
tmp = (x * 2.0) + 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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -2e-42], t$95$2, If[LessEqual[N[(x * 2.0), $MachinePrecision], 4e-37], N[(t$95$1 + N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 5e+184], t$95$2, N[(N[(x * 2.0), $MachinePrecision] + 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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;x \cdot 2 \leq -2 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot 2 \leq 4 \cdot 10^{-37}:\\
\;\;\;\;t\_1 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \cdot 2 \leq 5 \cdot 10^{+184}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\end{array}
\end{array}
if (*.f64 x 2) < -2.00000000000000008e-42 or 4.00000000000000027e-37 < (*.f64 x 2) < 4.9999999999999999e184Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around 0 76.9%
if -2.00000000000000008e-42 < (*.f64 x 2) < 4.00000000000000027e-37Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*94.6%
fma-define94.6%
fma-neg94.6%
associate-*l*90.9%
distribute-rgt-neg-in90.9%
*-commutative90.9%
associate-*l*90.9%
*-commutative90.9%
distribute-lft-neg-in90.9%
associate-*r*91.0%
Simplified91.0%
*-commutative91.0%
associate-*r*90.9%
associate-*l*90.9%
metadata-eval90.9%
distribute-lft-neg-in90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
*-commutative90.9%
fma-neg90.9%
associate-*l*90.9%
Applied egg-rr90.9%
Taylor expanded in x around 0 90.3%
cancel-sign-sub-inv90.3%
metadata-eval90.3%
associate-*r*90.2%
*-commutative90.2%
associate-*l*86.8%
*-commutative86.8%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around 0 90.3%
associate-*r*90.2%
*-commutative90.2%
associate-*l*86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*r*83.8%
*-commutative83.8%
associate-*l*90.2%
Simplified90.2%
if 4.9999999999999999e184 < (*.f64 x 2) Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around 0 92.0%
Final simplification84.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 (if (<= z 1.3e+91) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (+ (* 27.0 (* a b)) (* z (* t (* 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.3e+91) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (27.0 * (a * b)) + (z * (t * (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.3d+91) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = (27.0d0 * (a * b)) + (z * (t * (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.3e+91) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (27.0 * (a * b)) + (z * (t * (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.3e+91: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = (27.0 * (a * b)) + (z * (t * (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.3e+91) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(z * Float64(t * 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.3e+91)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = (27.0 * (a * b)) + (z * (t * (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.3e+91], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * N[(y * -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}
\mathbf{if}\;z \leq 1.3 \cdot 10^{+91}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < 1.3e91Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
sub-neg97.2%
+-commutative97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
*-commutative97.2%
distribute-lft-neg-in97.2%
metadata-eval97.2%
associate-*l*97.1%
associate-*r*97.2%
*-commutative97.2%
Applied egg-rr97.2%
if 1.3e91 < z Initial program 91.5%
+-commutative91.5%
associate-+r-91.5%
*-commutative91.5%
cancel-sign-sub-inv91.5%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*99.8%
fma-define99.8%
fma-neg99.8%
associate-*l*84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
associate-*l*84.5%
*-commutative84.5%
distribute-lft-neg-in84.5%
associate-*r*84.5%
Simplified84.5%
*-commutative84.5%
associate-*r*84.5%
associate-*l*84.5%
metadata-eval84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
fma-neg84.5%
associate-*l*84.5%
Applied egg-rr84.5%
Taylor expanded in x around 0 80.1%
cancel-sign-sub-inv80.1%
metadata-eval80.1%
associate-*r*80.0%
*-commutative80.0%
associate-*l*86.8%
*-commutative86.8%
associate-*l*86.7%
Simplified86.7%
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 1.32e+91) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (* 27.0 (* a b)) (* z (* t (* 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.32e+91) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) + (z * (t * (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.32d+91) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (a * b)) + (z * (t * (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.32e+91) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) + (z * (t * (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.32e+91: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = (27.0 * (a * b)) + (z * (t * (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.32e+91) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(z * Float64(t * 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.32e+91)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = (27.0 * (a * b)) + (z * (t * (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.32e+91], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * N[(y * -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}
\mathbf{if}\;z \leq 1.32 \cdot 10^{+91}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < 1.32000000000000003e91Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
if 1.32000000000000003e91 < z Initial program 91.5%
+-commutative91.5%
associate-+r-91.5%
*-commutative91.5%
cancel-sign-sub-inv91.5%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*99.8%
fma-define99.8%
fma-neg99.8%
associate-*l*84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
associate-*l*84.5%
*-commutative84.5%
distribute-lft-neg-in84.5%
associate-*r*84.5%
Simplified84.5%
*-commutative84.5%
associate-*r*84.5%
associate-*l*84.5%
metadata-eval84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
distribute-rgt-neg-in84.5%
*-commutative84.5%
fma-neg84.5%
associate-*l*84.5%
Applied egg-rr84.5%
Taylor expanded in x around 0 80.1%
cancel-sign-sub-inv80.1%
metadata-eval80.1%
associate-*r*80.0%
*-commutative80.0%
associate-*l*86.8%
*-commutative86.8%
associate-*l*86.7%
Simplified86.7%
Final simplification94.9%
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.25e+22) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= 1.25e+22) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 1.25d+22) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (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 <= 1.25e+22) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 1.25e+22: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 1.25e+22) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + 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 <= 1.25e+22)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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, 1.25e+22], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\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.25 \cdot 10^{+22}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.2499999999999999e22Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
if 1.2499999999999999e22 < z Initial program 91.4%
Final simplification95.9%
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 (<= z -1.3e+54) (not (<= z 1.15e-73))) (+ (* x 2.0) (* z (* t (* y -9.0)))) (+ (* 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 ((z <= -1.3e+54) || !(z <= 1.15e-73)) {
tmp = (x * 2.0) + (z * (t * (y * -9.0)));
} else {
tmp = (x * 2.0) + (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 ((z <= (-1.3d+54)) .or. (.not. (z <= 1.15d-73))) then
tmp = (x * 2.0d0) + (z * (t * (y * (-9.0d0))))
else
tmp = (x * 2.0d0) + (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 ((z <= -1.3e+54) || !(z <= 1.15e-73)) {
tmp = (x * 2.0) + (z * (t * (y * -9.0)));
} else {
tmp = (x * 2.0) + (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 (z <= -1.3e+54) or not (z <= 1.15e-73): tmp = (x * 2.0) + (z * (t * (y * -9.0))) else: tmp = (x * 2.0) + (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 ((z <= -1.3e+54) || !(z <= 1.15e-73)) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(t * Float64(y * -9.0)))); else tmp = Float64(Float64(x * 2.0) + 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 ((z <= -1.3e+54) || ~((z <= 1.15e-73)))
tmp = (x * 2.0) + (z * (t * (y * -9.0)));
else
tmp = (x * 2.0) + (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[z, -1.3e+54], N[Not[LessEqual[z, 1.15e-73]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $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.3 \cdot 10^{+54} \lor \neg \left(z \leq 1.15 \cdot 10^{-73}\right):\\
\;\;\;\;x \cdot 2 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -1.30000000000000003e54 or 1.14999999999999994e-73 < z Initial program 93.5%
+-commutative93.5%
associate-+r-93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-*r*97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
associate-+r-97.6%
associate-*l*98.3%
fma-define99.8%
fma-neg99.8%
associate-*l*92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
associate-*l*92.1%
*-commutative92.1%
distribute-lft-neg-in92.1%
associate-*r*92.1%
Simplified92.1%
*-commutative92.1%
associate-*r*92.1%
associate-*l*92.1%
metadata-eval92.1%
distribute-lft-neg-in92.1%
*-commutative92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
fma-neg92.1%
associate-*l*92.1%
Applied egg-rr92.1%
Taylor expanded in a around 0 71.5%
cancel-sign-sub-inv71.5%
metadata-eval71.5%
+-commutative71.5%
associate-*r*71.5%
*-commutative71.5%
associate-*l*75.7%
*-commutative75.7%
*-commutative75.7%
fma-define75.7%
associate-*l*75.6%
*-commutative75.6%
*-commutative75.6%
Simplified75.6%
fma-undefine75.6%
*-commutative75.6%
*-commutative75.6%
Applied egg-rr75.6%
if -1.30000000000000003e54 < z < 1.14999999999999994e-73Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.6%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 79.5%
Final simplification77.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 (<= y -2.6e+106)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= y 3.8e-169)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* z (* t (* 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 (y <= -2.6e+106) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 3.8e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (z * (t * (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 (y <= (-2.6d+106)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (y <= 3.8d-169) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + (z * (t * (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 (y <= -2.6e+106) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 3.8e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (z * (t * (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 y <= -2.6e+106: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif y <= 3.8e-169: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + (z * (t * (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 (y <= -2.6e+106) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (y <= 3.8e-169) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(t * 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 (y <= -2.6e+106)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (y <= 3.8e-169)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + (z * (t * (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[y, -2.6e+106], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-169], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(t * N[(y * -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}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+106}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -2.6000000000000002e106Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 83.3%
if -2.6000000000000002e106 < y < 3.8e-169Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 82.4%
if 3.8e-169 < y Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*91.1%
distribute-lft-neg-in91.1%
*-commutative91.1%
cancel-sign-sub-inv91.1%
associate-+r-91.1%
associate-*l*92.0%
fma-define92.9%
fma-neg92.9%
associate-*l*98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
associate-*l*98.6%
*-commutative98.6%
distribute-lft-neg-in98.6%
associate-*r*98.7%
Simplified98.7%
*-commutative98.7%
associate-*r*98.6%
associate-*l*98.6%
metadata-eval98.6%
distribute-lft-neg-in98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
fma-neg98.6%
associate-*l*98.6%
Applied egg-rr98.6%
Taylor expanded in a around 0 68.9%
cancel-sign-sub-inv68.9%
metadata-eval68.9%
+-commutative68.9%
associate-*r*69.0%
*-commutative69.0%
associate-*l*68.0%
*-commutative68.0%
*-commutative68.0%
fma-define68.0%
associate-*l*68.0%
*-commutative68.0%
*-commutative68.0%
Simplified68.0%
fma-undefine67.9%
*-commutative67.9%
*-commutative67.9%
Applied egg-rr67.9%
Final simplification76.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 (<= z -3.4e+54) (not (<= z 1.15e-69))) (* -9.0 (* t (* z y))) (+ (* 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 ((z <= -3.4e+54) || !(z <= 1.15e-69)) {
tmp = -9.0 * (t * (z * y));
} else {
tmp = (x * 2.0) + (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 ((z <= (-3.4d+54)) .or. (.not. (z <= 1.15d-69))) then
tmp = (-9.0d0) * (t * (z * y))
else
tmp = (x * 2.0d0) + (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 ((z <= -3.4e+54) || !(z <= 1.15e-69)) {
tmp = -9.0 * (t * (z * y));
} else {
tmp = (x * 2.0) + (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 (z <= -3.4e+54) or not (z <= 1.15e-69): tmp = -9.0 * (t * (z * y)) else: tmp = (x * 2.0) + (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 ((z <= -3.4e+54) || !(z <= 1.15e-69)) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); else tmp = Float64(Float64(x * 2.0) + 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 ((z <= -3.4e+54) || ~((z <= 1.15e-69)))
tmp = -9.0 * (t * (z * y));
else
tmp = (x * 2.0) + (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[z, -3.4e+54], N[Not[LessEqual[z, 1.15e-69]], $MachinePrecision]], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $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 -3.4 \cdot 10^{+54} \lor \neg \left(z \leq 1.15 \cdot 10^{-69}\right):\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -3.4000000000000001e54 or 1.15e-69 < z Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*89.7%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in y around inf 53.0%
if -3.4000000000000001e54 < z < 1.15e-69Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.6%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 79.8%
Final simplification66.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 (or (<= x -3.3e-37) (not (<= x 2.3e-36))) (* 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 <= -3.3e-37) || !(x <= 2.3e-36)) {
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 <= (-3.3d-37)) .or. (.not. (x <= 2.3d-36))) 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 <= -3.3e-37) || !(x <= 2.3e-36)) {
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 <= -3.3e-37) or not (x <= 2.3e-36): 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 <= -3.3e-37) || !(x <= 2.3e-36)) 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 <= -3.3e-37) || ~((x <= 2.3e-36)))
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, -3.3e-37], N[Not[LessEqual[x, 2.3e-36]], $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 -3.3 \cdot 10^{-37} \lor \neg \left(x \leq 2.3 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -3.29999999999999982e-37 or 2.29999999999999996e-36 < x Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 51.3%
if -3.29999999999999982e-37 < x < 2.29999999999999996e-36Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*90.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in a around inf 42.4%
Final simplification47.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 (if (or (<= x -3.3e-37) (not (<= x 5.2e-37))) (* x 2.0) (* 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 ((x <= -3.3e-37) || !(x <= 5.2e-37)) {
tmp = x * 2.0;
} else {
tmp = 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 ((x <= (-3.3d-37)) .or. (.not. (x <= 5.2d-37))) then
tmp = x * 2.0d0
else
tmp = 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 ((x <= -3.3e-37) || !(x <= 5.2e-37)) {
tmp = x * 2.0;
} else {
tmp = 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 (x <= -3.3e-37) or not (x <= 5.2e-37): tmp = x * 2.0 else: tmp = 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 ((x <= -3.3e-37) || !(x <= 5.2e-37)) tmp = Float64(x * 2.0); else tmp = 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 ((x <= -3.3e-37) || ~((x <= 5.2e-37)))
tmp = x * 2.0;
else
tmp = 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[Or[LessEqual[x, -3.3e-37], N[Not[LessEqual[x, 5.2e-37]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.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}\;x \leq -3.3 \cdot 10^{-37} \lor \neg \left(x \leq 5.2 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if x < -3.29999999999999982e-37 or 5.19999999999999959e-37 < x Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 51.3%
if -3.29999999999999982e-37 < x < 5.19999999999999959e-37Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*90.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in a around inf 42.4%
associate-*r*43.1%
Simplified43.1%
Final simplification47.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 (* 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 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*94.0%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 32.6%
Final simplification32.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 2024040
(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)))