
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 6e-73) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e-73) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6e-73) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e-73], 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{-73}:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 6e-73Initial program 95.3%
Simplified96.9%
if 6e-73 < z Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
*-commutative95.2%
cancel-sign-sub-inv95.2%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.6%
fma-define96.7%
cancel-sign-sub-inv96.7%
fma-define96.7%
distribute-lft-neg-in96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-*r*98.2%
associate-*l*96.6%
neg-mul-196.6%
associate-*r*96.6%
Simplified96.6%
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 (* y 9.0)) 4e+263) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0))))) (* z (- (* 27.0 (* a (/ b z))) (* 9.0 (* y t))))))
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 * (y * 9.0)) <= 4e+263) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
} else {
tmp = z * ((27.0 * (a * (b / z))) - (9.0 * (y * t)));
}
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 (Float64(z * Float64(y * 9.0)) <= 4e+263) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); else tmp = Float64(z * Float64(Float64(27.0 * Float64(a * Float64(b / z))) - Float64(9.0 * Float64(y * t)))); 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[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 4e+263], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(27.0 * N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $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 \cdot \left(y \cdot 9\right) \leq 4 \cdot 10^{+263}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(27 \cdot \left(a \cdot \frac{b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 4.00000000000000006e263Initial program 96.5%
+-commutative96.5%
associate-+r-96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.7%
fma-define95.0%
cancel-sign-sub-inv95.0%
fma-define95.0%
distribute-lft-neg-in95.0%
distribute-rgt-neg-in95.0%
*-commutative95.0%
associate-*r*97.8%
associate-*l*97.3%
neg-mul-197.3%
associate-*r*97.3%
Simplified97.3%
if 4.00000000000000006e263 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 82.1%
sub-neg82.1%
sub-neg82.1%
associate-*l*86.4%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in x around 0 82.1%
Taylor expanded in z around inf 86.4%
associate-/l*95.5%
Simplified95.5%
Final simplification97.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 (* b (* a 27.0))))
(if (<= (+ (- (* x 2.0) (* t (* z (* y 9.0)))) t_1) INFINITY)
(- (+ t_1 (* x 2.0)) (* y (* 9.0 (* z t))))
(* -9.0 (* t (* z y))))))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 = b * (a * 27.0);
double tmp;
if ((((x * 2.0) - (t * (z * (y * 9.0)))) + t_1) <= ((double) INFINITY)) {
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = -9.0 * (t * (z * y));
}
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 = b * (a * 27.0);
double tmp;
if ((((x * 2.0) - (t * (z * (y * 9.0)))) + t_1) <= Double.POSITIVE_INFINITY) {
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = -9.0 * (t * (z * y));
}
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 = b * (a * 27.0) tmp = 0 if (((x * 2.0) - (t * (z * (y * 9.0)))) + t_1) <= math.inf: tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t))) else: tmp = -9.0 * (t * (z * y)) 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(b * Float64(a * 27.0)) tmp = 0.0 if (Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + t_1) <= Inf) tmp = Float64(Float64(t_1 + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); 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 = b * (a * 27.0);
tmp = 0.0;
if ((((x * 2.0) - (t * (z * (y * 9.0)))) + t_1) <= Inf)
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
else
tmp = -9.0 * (t * (z * y));
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + t\_1 \leq \infty:\\
\;\;\;\;\left(t\_1 + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\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 97.6%
+-commutative97.6%
associate-+r-97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
associate-*r*95.3%
distribute-lft-neg-in95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-+r-95.3%
associate-*l*95.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*97.5%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
fma-undefine97.1%
fma-undefine97.1%
associate-+r+97.1%
*-commutative97.1%
associate-*l*96.3%
*-commutative96.3%
associate-*r*96.7%
*-commutative96.7%
*-commutative96.7%
associate-*r*96.7%
associate-*l*96.7%
metadata-eval96.7%
distribute-lft-neg-in96.7%
*-commutative96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-+r+96.7%
sub-neg96.7%
Applied egg-rr96.7%
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*0.0%
fma-define100.0%
cancel-sign-sub-inv100.0%
fma-define100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
neg-mul-1100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
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 (<= (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0))) INFINITY) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* -9.0 (* t (* z y)))))
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 * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0))) <= ((double) INFINITY)) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = -9.0 * (t * (z * y));
}
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 tmp;
if ((((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = -9.0 * (t * (z * y));
}
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 * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0))) <= math.inf: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = -9.0 * (t * (z * y)) 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 (Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))) <= Inf) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); 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 * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0))) <= Inf)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = -9.0 * (t * (z * y));
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[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], Infinity], 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[(-9.0 * N[(t * N[(z * y), $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}\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right) \leq \infty:\\
\;\;\;\;\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}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\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 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*96.8%
associate-*l*96.7%
Simplified96.7%
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*0.0%
fma-define100.0%
cancel-sign-sub-inv100.0%
fma-define100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
neg-mul-1100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
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 (or (<= y -1.22e+76) (not (<= y 1.25e-160))) (+ (* x 2.0) (* t (* z (* 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 ((y <= -1.22e+76) || !(y <= 1.25e-160)) {
tmp = (x * 2.0) + (t * (z * (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 ((y <= (-1.22d+76)) .or. (.not. (y <= 1.25d-160))) then
tmp = (x * 2.0d0) + (t * (z * (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 ((y <= -1.22e+76) || !(y <= 1.25e-160)) {
tmp = (x * 2.0) + (t * (z * (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 (y <= -1.22e+76) or not (y <= 1.25e-160): tmp = (x * 2.0) + (t * (z * (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 ((y <= -1.22e+76) || !(y <= 1.25e-160)) tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(z * 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 ((y <= -1.22e+76) || ~((y <= 1.25e-160)))
tmp = (x * 2.0) + (t * (z * (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[y, -1.22e+76], N[Not[LessEqual[y, 1.25e-160]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(z * 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}\;y \leq -1.22 \cdot 10^{+76} \lor \neg \left(y \leq 1.25 \cdot 10^{-160}\right):\\
\;\;\;\;x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.22000000000000002e76 or 1.24999999999999999e-160 < y Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*92.8%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 68.4%
sub-neg68.4%
*-commutative68.4%
distribute-rgt-neg-in68.4%
metadata-eval68.4%
associate-*r*68.5%
*-commutative68.5%
associate-*r*68.5%
Applied egg-rr68.5%
if -1.22000000000000002e76 < y < 1.24999999999999999e-160Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
Final simplification76.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 (<= y -5.2e+75)
(- (* x 2.0) (* y (* z (* t 9.0))))
(if (<= y 2.8e-159)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* t (* z (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+75) {
tmp = (x * 2.0) - (y * (z * (t * 9.0)));
} else if (y <= 2.8e-159) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5.2d+75)) then
tmp = (x * 2.0d0) - (y * (z * (t * 9.0d0)))
else if (y <= 2.8d-159) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + (t * (z * (y * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+75) {
tmp = (x * 2.0) - (y * (z * (t * 9.0)));
} else if (y <= 2.8e-159) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -5.2e+75: tmp = (x * 2.0) - (y * (z * (t * 9.0))) elif y <= 2.8e-159: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + (t * (z * (y * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.2e+75) tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(z * Float64(t * 9.0)))); elseif (y <= 2.8e-159) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(z * Float64(y * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -5.2e+75)
tmp = (x * 2.0) - (y * (z * (t * 9.0)));
elseif (y <= 2.8e-159)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.2e+75], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-159], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(z * 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 -5.2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(z \cdot \left(t \cdot 9\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-159}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -5.1999999999999997e75Initial program 88.8%
+-commutative88.8%
associate-+r-88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-*r*80.1%
distribute-lft-neg-in80.1%
*-commutative80.1%
cancel-sign-sub-inv80.1%
associate-+r-80.1%
associate-*l*80.1%
fma-define87.6%
cancel-sign-sub-inv87.6%
fma-define87.6%
distribute-lft-neg-in87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r*96.4%
associate-*l*96.2%
neg-mul-196.2%
associate-*r*96.2%
Simplified96.2%
fma-undefine88.7%
fma-undefine88.7%
associate-+r+88.7%
*-commutative88.7%
associate-*l*92.2%
*-commutative92.2%
associate-*r*92.4%
*-commutative92.4%
*-commutative92.4%
associate-*r*92.2%
associate-*l*92.3%
metadata-eval92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
*-commutative92.3%
associate-+r+92.3%
sub-neg92.3%
Applied egg-rr92.3%
Taylor expanded in b around 0 85.3%
*-commutative85.3%
*-commutative85.3%
associate-*r*76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in z around 0 85.3%
associate-*r*76.6%
associate-*r*76.6%
*-commutative76.6%
associate-*r*76.7%
*-commutative76.7%
associate-*l*88.8%
*-commutative88.8%
associate-*l*88.8%
*-commutative88.8%
associate-*l*88.9%
Simplified88.9%
if -5.1999999999999997e75 < y < 2.8000000000000002e-159Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
if 2.8000000000000002e-159 < y Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*93.0%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in a around 0 59.3%
sub-neg59.3%
*-commutative59.3%
distribute-rgt-neg-in59.3%
metadata-eval59.3%
associate-*r*59.4%
*-commutative59.4%
associate-*r*59.4%
Applied egg-rr59.4%
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 -4.2e+75)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= y 2.8e-159)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* t (* z (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e+75) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 2.8e-159) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-4.2d+75)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (y <= 2.8d-159) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + (t * (z * (y * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e+75) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 2.8e-159) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -4.2e+75: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif y <= 2.8e-159: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + (t * (z * (y * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.2e+75) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (y <= 2.8e-159) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(z * Float64(y * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -4.2e+75)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (y <= 2.8e-159)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + (t * (z * (y * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.2e+75], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-159], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(z * 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 -4.2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-159}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -4.19999999999999997e75Initial program 88.8%
sub-neg88.8%
sub-neg88.8%
associate-*l*92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around 0 85.3%
if -4.19999999999999997e75 < y < 2.8000000000000002e-159Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
if 2.8000000000000002e-159 < y Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*93.0%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in a around 0 59.3%
sub-neg59.3%
*-commutative59.3%
distribute-rgt-neg-in59.3%
metadata-eval59.3%
associate-*r*59.4%
*-commutative59.4%
associate-*r*59.4%
Applied egg-rr59.4%
Final simplification76.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 (<= y -6.9e+75) (* y (* t (* z -9.0))) (if (<= y 1.5e-108) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* y (* z -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.9e+75) {
tmp = y * (t * (z * -9.0));
} else if (y <= 1.5e-108) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-6.9d+75)) then
tmp = y * (t * (z * (-9.0d0)))
else if (y <= 1.5d-108) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.9e+75) {
tmp = y * (t * (z * -9.0));
} else if (y <= 1.5e-108) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -6.9e+75: tmp = y * (t * (z * -9.0)) elif y <= 1.5e-108: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.9e+75) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (y <= 1.5e-108) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -6.9e+75)
tmp = y * (t * (z * -9.0));
elseif (y <= 1.5e-108)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.9e+75], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-108], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -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}\;y \leq -6.9 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-108}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -6.9000000000000004e75Initial program 88.8%
+-commutative88.8%
associate-+r-88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-*r*80.1%
distribute-lft-neg-in80.1%
*-commutative80.1%
cancel-sign-sub-inv80.1%
associate-+r-80.1%
associate-*l*80.1%
fma-define87.6%
cancel-sign-sub-inv87.6%
fma-define87.6%
distribute-lft-neg-in87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r*96.4%
associate-*l*96.2%
neg-mul-196.2%
associate-*r*96.2%
Simplified96.2%
Taylor expanded in t around inf 76.2%
*-commutative76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in t around 0 76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*79.8%
*-commutative79.8%
associate-*r*79.7%
*-commutative79.7%
associate-*l*79.7%
Simplified79.7%
if -6.9000000000000004e75 < y < 1.49999999999999996e-108Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.0%
distribute-lft-neg-in99.0%
*-commutative99.0%
cancel-sign-sub-inv99.0%
associate-+r-99.0%
associate-*l*99.1%
fma-define99.1%
cancel-sign-sub-inv99.1%
fma-define99.1%
distribute-lft-neg-in99.1%
distribute-rgt-neg-in99.1%
*-commutative99.1%
associate-*r*99.8%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Taylor expanded in t around 0 85.8%
if 1.49999999999999996e-108 < y Initial program 92.9%
+-commutative92.9%
associate-+r-92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-*r*92.8%
distribute-lft-neg-in92.8%
*-commutative92.8%
cancel-sign-sub-inv92.8%
associate-+r-92.8%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
distribute-lft-neg-in95.1%
distribute-rgt-neg-in95.1%
*-commutative95.1%
associate-*r*95.2%
associate-*l*95.2%
neg-mul-195.2%
associate-*r*95.2%
Simplified95.2%
Taylor expanded in t around inf 44.0%
*-commutative44.0%
associate-*r*44.0%
associate-*l*44.0%
Simplified44.0%
Final simplification70.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 (or (<= y -7.2e+69) (not (<= y 2.8e-159))) (* -9.0 (* t (* z y))) (* 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 ((y <= -7.2e+69) || !(y <= 2.8e-159)) {
tmp = -9.0 * (t * (z * y));
} 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 ((y <= (-7.2d+69)) .or. (.not. (y <= 2.8d-159))) then
tmp = (-9.0d0) * (t * (z * y))
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 ((y <= -7.2e+69) || !(y <= 2.8e-159)) {
tmp = -9.0 * (t * (z * y));
} 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 (y <= -7.2e+69) or not (y <= 2.8e-159): tmp = -9.0 * (t * (z * y)) 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 ((y <= -7.2e+69) || !(y <= 2.8e-159)) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); 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 ((y <= -7.2e+69) || ~((y <= 2.8e-159)))
tmp = -9.0 * (t * (z * y));
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[y, -7.2e+69], N[Not[LessEqual[y, 2.8e-159]], $MachinePrecision]], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -7.2 \cdot 10^{+69} \lor \neg \left(y \leq 2.8 \cdot 10^{-159}\right):\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if y < -7.2000000000000005e69 or 2.8000000000000002e-159 < y Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-*r*89.0%
distribute-lft-neg-in89.0%
*-commutative89.0%
cancel-sign-sub-inv89.0%
associate-+r-89.0%
associate-*l*88.9%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*96.1%
associate-*l*96.0%
neg-mul-196.0%
associate-*r*96.0%
Simplified96.0%
Taylor expanded in t around inf 54.7%
if -7.2000000000000005e69 < y < 2.8000000000000002e-159Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
Taylor expanded in b around inf 76.0%
Taylor expanded in x around 0 49.9%
*-commutative49.9%
Simplified49.9%
Final simplification52.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 (<= y -5.6e+75) (* y (* t (* z -9.0))) (if (<= y 2.8e-159) (* b (* a 27.0)) (* t (* y (* z -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e+75) {
tmp = y * (t * (z * -9.0));
} else if (y <= 2.8e-159) {
tmp = b * (a * 27.0);
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5.6d+75)) then
tmp = y * (t * (z * (-9.0d0)))
else if (y <= 2.8d-159) then
tmp = b * (a * 27.0d0)
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e+75) {
tmp = y * (t * (z * -9.0));
} else if (y <= 2.8e-159) {
tmp = b * (a * 27.0);
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -5.6e+75: tmp = y * (t * (z * -9.0)) elif y <= 2.8e-159: tmp = b * (a * 27.0) else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.6e+75) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (y <= 2.8e-159) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -5.6e+75)
tmp = y * (t * (z * -9.0));
elseif (y <= 2.8e-159)
tmp = b * (a * 27.0);
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.6e+75], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-159], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -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}\;y \leq -5.6 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-159}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -5.60000000000000023e75Initial program 88.8%
+-commutative88.8%
associate-+r-88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-*r*80.1%
distribute-lft-neg-in80.1%
*-commutative80.1%
cancel-sign-sub-inv80.1%
associate-+r-80.1%
associate-*l*80.1%
fma-define87.6%
cancel-sign-sub-inv87.6%
fma-define87.6%
distribute-lft-neg-in87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r*96.4%
associate-*l*96.2%
neg-mul-196.2%
associate-*r*96.2%
Simplified96.2%
Taylor expanded in t around inf 76.2%
*-commutative76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in t around 0 76.2%
associate-*r*76.2%
*-commutative76.2%
associate-*l*79.8%
*-commutative79.8%
associate-*r*79.7%
*-commutative79.7%
associate-*l*79.7%
Simplified79.7%
if -5.60000000000000023e75 < y < 2.8000000000000002e-159Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
Taylor expanded in b around inf 76.0%
Taylor expanded in x around 0 49.9%
*-commutative49.9%
Simplified49.9%
if 2.8000000000000002e-159 < y Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-*r*93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-+r-93.8%
associate-*l*93.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*95.9%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Taylor expanded in t around inf 43.1%
*-commutative43.1%
associate-*r*43.1%
associate-*l*43.1%
Simplified43.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -5.2e+69) (* -9.0 (* t (* z y))) (if (<= y 2.8e-159) (* b (* a 27.0)) (* t (* y (* z -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+69) {
tmp = -9.0 * (t * (z * y));
} else if (y <= 2.8e-159) {
tmp = b * (a * 27.0);
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5.2d+69)) then
tmp = (-9.0d0) * (t * (z * y))
else if (y <= 2.8d-159) then
tmp = b * (a * 27.0d0)
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.2e+69) {
tmp = -9.0 * (t * (z * y));
} else if (y <= 2.8e-159) {
tmp = b * (a * 27.0);
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -5.2e+69: tmp = -9.0 * (t * (z * y)) elif y <= 2.8e-159: tmp = b * (a * 27.0) else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.2e+69) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (y <= 2.8e-159) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -5.2e+69)
tmp = -9.0 * (t * (z * y));
elseif (y <= 2.8e-159)
tmp = b * (a * 27.0);
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.2e+69], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-159], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -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}\;y \leq -5.2 \cdot 10^{+69}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-159}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -5.2000000000000004e69Initial program 88.8%
+-commutative88.8%
associate-+r-88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-*r*80.1%
distribute-lft-neg-in80.1%
*-commutative80.1%
cancel-sign-sub-inv80.1%
associate-+r-80.1%
associate-*l*80.1%
fma-define87.6%
cancel-sign-sub-inv87.6%
fma-define87.6%
distribute-lft-neg-in87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r*96.4%
associate-*l*96.2%
neg-mul-196.2%
associate-*r*96.2%
Simplified96.2%
Taylor expanded in t around inf 76.2%
if -5.2000000000000004e69 < y < 2.8000000000000002e-159Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*98.9%
distribute-lft-neg-in98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
associate-+r-98.9%
associate-*l*98.9%
fma-define98.9%
cancel-sign-sub-inv98.9%
fma-define98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
*-commutative98.9%
associate-*r*99.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 88.5%
Taylor expanded in b around inf 76.0%
Taylor expanded in x around 0 49.9%
*-commutative49.9%
Simplified49.9%
if 2.8000000000000002e-159 < y Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-*r*93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-+r-93.8%
associate-*l*93.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*95.9%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Taylor expanded in t around inf 43.1%
*-commutative43.1%
associate-*r*43.1%
associate-*l*43.1%
Simplified43.1%
Final simplification52.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 -9.2e-169) (not (<= b 2.2e-40))) (* 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 <= -9.2e-169) || !(b <= 2.2e-40)) {
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 <= (-9.2d-169)) .or. (.not. (b <= 2.2d-40))) 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 <= -9.2e-169) || !(b <= 2.2e-40)) {
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 <= -9.2e-169) or not (b <= 2.2e-40): 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 <= -9.2e-169) || !(b <= 2.2e-40)) 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 <= -9.2e-169) || ~((b <= 2.2e-40)))
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, -9.2e-169], N[Not[LessEqual[b, 2.2e-40]], $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 -9.2 \cdot 10^{-169} \lor \neg \left(b \leq 2.2 \cdot 10^{-40}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -9.2000000000000004e-169 or 2.20000000000000009e-40 < b Initial program 93.8%
+-commutative93.8%
associate-+r-93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-*r*90.3%
distribute-lft-neg-in90.3%
*-commutative90.3%
cancel-sign-sub-inv90.3%
associate-+r-90.3%
associate-*l*90.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*97.5%
associate-*l*96.8%
neg-mul-196.8%
associate-*r*96.8%
Simplified96.8%
Taylor expanded in a around inf 51.7%
if -9.2000000000000004e-169 < b < 2.20000000000000009e-40Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-+r-97.9%
associate-*l*97.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*97.8%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Taylor expanded in t around 0 58.4%
Taylor expanded in x around inf 43.1%
Final simplification48.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 -1.1e-168) (* a (* 27.0 b)) (if (<= b 1.25e-42) (* 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 (b <= -1.1e-168) {
tmp = a * (27.0 * b);
} else if (b <= 1.25e-42) {
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 (b <= (-1.1d-168)) then
tmp = a * (27.0d0 * b)
else if (b <= 1.25d-42) 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 (b <= -1.1e-168) {
tmp = a * (27.0 * b);
} else if (b <= 1.25e-42) {
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 b <= -1.1e-168: tmp = a * (27.0 * b) elif b <= 1.25e-42: 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 (b <= -1.1e-168) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 1.25e-42) 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 (b <= -1.1e-168)
tmp = a * (27.0 * b);
elseif (b <= 1.25e-42)
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[LessEqual[b, -1.1e-168], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e-42], 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}\;b \leq -1.1 \cdot 10^{-168}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{-42}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -1.0999999999999999e-168Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
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.0%
cancel-sign-sub-inv94.0%
fma-define94.0%
distribute-lft-neg-in94.0%
distribute-rgt-neg-in94.0%
*-commutative94.0%
associate-*r*95.8%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Taylor expanded in t around 0 60.0%
Taylor expanded in a around inf 60.1%
Taylor expanded in x around 0 42.7%
if -1.0999999999999999e-168 < b < 1.25000000000000001e-42Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-+r-97.9%
associate-*l*97.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*97.8%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Taylor expanded in t around 0 58.4%
Taylor expanded in x around inf 43.1%
if 1.25000000000000001e-42 < b Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-*r*88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-+r-88.1%
associate-*l*88.0%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*99.8%
associate-*l*98.2%
neg-mul-198.2%
associate-*r*98.2%
Simplified98.2%
Taylor expanded in t around 0 70.3%
Taylor expanded in b around inf 70.2%
Taylor expanded in x around 0 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification48.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 -2.35e-169) (* a (* 27.0 b)) (if (<= b 2.1e-42) (* 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 (b <= -2.35e-169) {
tmp = a * (27.0 * b);
} else if (b <= 2.1e-42) {
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 (b <= (-2.35d-169)) then
tmp = a * (27.0d0 * b)
else if (b <= 2.1d-42) 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 (b <= -2.35e-169) {
tmp = a * (27.0 * b);
} else if (b <= 2.1e-42) {
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 b <= -2.35e-169: tmp = a * (27.0 * b) elif b <= 2.1e-42: 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 (b <= -2.35e-169) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 2.1e-42) 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 (b <= -2.35e-169)
tmp = a * (27.0 * b);
elseif (b <= 2.1e-42)
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[LessEqual[b, -2.35e-169], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e-42], 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}\;b \leq -2.35 \cdot 10^{-169}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-42}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -2.34999999999999995e-169Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
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.0%
cancel-sign-sub-inv94.0%
fma-define94.0%
distribute-lft-neg-in94.0%
distribute-rgt-neg-in94.0%
*-commutative94.0%
associate-*r*95.8%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Taylor expanded in t around 0 60.0%
Taylor expanded in a around inf 60.1%
Taylor expanded in x around 0 42.7%
if -2.34999999999999995e-169 < b < 2.10000000000000006e-42Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-+r-97.9%
associate-*l*97.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*97.8%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Taylor expanded in t around 0 58.4%
Taylor expanded in x around inf 43.1%
if 2.10000000000000006e-42 < b Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-*r*88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-+r-88.1%
associate-*l*88.0%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*99.8%
associate-*l*98.2%
neg-mul-198.2%
associate-*r*98.2%
Simplified98.2%
Taylor expanded in a around inf 64.6%
Final simplification48.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 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*93.1%
distribute-lft-neg-in93.1%
*-commutative93.1%
cancel-sign-sub-inv93.1%
associate-+r-93.1%
associate-*l*93.0%
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*97.6%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in t around 0 62.1%
Taylor expanded in x around inf 25.2%
Final simplification25.2%
(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 2024180
(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)))