
(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 (<= (* y 9.0) -1e-27) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* z (* (* y 9.0) t))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -1e-27) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - (z * ((y * 9.0) * t))) + (a * (27.0 * b));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -1e-27) 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(z * Float64(Float64(y * 9.0) * t))) + Float64(a * Float64(27.0 * b))); 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[(y * 9.0), $MachinePrecision], -1e-27], 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[(z * N[(N[(y * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * 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 \cdot 9 \leq -1 \cdot 10^{-27}:\\
\;\;\;\;\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 - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -1e-27Initial program 93.9%
+-commutative93.9%
associate-+r-93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-*r*87.8%
distribute-lft-neg-in87.8%
*-commutative87.8%
cancel-sign-sub-inv87.8%
associate-+r-87.8%
associate-*l*87.7%
fma-define87.7%
fma-neg87.7%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
*-commutative99.7%
associate-*l*99.6%
*-commutative99.6%
distribute-lft-neg-in99.6%
associate-*r*99.8%
Simplified99.8%
if -1e-27 < (*.f64 y #s(literal 9 binary64)) Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in y around 0 94.5%
associate-*r*96.1%
associate-*r*96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
*-commutative96.1%
Simplified96.1%
Final simplification97.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b)))
(t_2 (- (* x 2.0) (* 9.0 (* t (* y z)))))
(t_3 (+ (* y (* z (* t -9.0))) t_1)))
(if (<= z -5.2e+45)
t_3
(if (<= z -5.5e-74)
t_2
(if (<= z -3.8e-87) t_3 (if (<= z 1.22e-74) (+ t_1 (* x 2.0)) t_2))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = (x * 2.0) - (9.0 * (t * (y * z)));
double t_3 = (y * (z * (t * -9.0))) + t_1;
double tmp;
if (z <= -5.2e+45) {
tmp = t_3;
} else if (z <= -5.5e-74) {
tmp = t_2;
} else if (z <= -3.8e-87) {
tmp = t_3;
} else if (z <= 1.22e-74) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
t_3 = (y * (z * (t * (-9.0d0)))) + t_1
if (z <= (-5.2d+45)) then
tmp = t_3
else if (z <= (-5.5d-74)) then
tmp = t_2
else if (z <= (-3.8d-87)) then
tmp = t_3
else if (z <= 1.22d-74) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = (x * 2.0) - (9.0 * (t * (y * z)));
double t_3 = (y * (z * (t * -9.0))) + t_1;
double tmp;
if (z <= -5.2e+45) {
tmp = t_3;
} else if (z <= -5.5e-74) {
tmp = t_2;
} else if (z <= -3.8e-87) {
tmp = t_3;
} else if (z <= 1.22e-74) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = (x * 2.0) - (9.0 * (t * (y * z))) t_3 = (y * (z * (t * -9.0))) + t_1 tmp = 0 if z <= -5.2e+45: tmp = t_3 elif z <= -5.5e-74: tmp = t_2 elif z <= -3.8e-87: tmp = t_3 elif z <= 1.22e-74: tmp = t_1 + (x * 2.0) else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))) t_3 = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + t_1) tmp = 0.0 if (z <= -5.2e+45) tmp = t_3; elseif (z <= -5.5e-74) tmp = t_2; elseif (z <= -3.8e-87) tmp = t_3; elseif (z <= 1.22e-74) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = (x * 2.0) - (9.0 * (t * (y * z)));
t_3 = (y * (z * (t * -9.0))) + t_1;
tmp = 0.0;
if (z <= -5.2e+45)
tmp = t_3;
elseif (z <= -5.5e-74)
tmp = t_2;
elseif (z <= -3.8e-87)
tmp = t_3;
elseif (z <= 1.22e-74)
tmp = t_1 + (x * 2.0);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[z, -5.2e+45], t$95$3, If[LessEqual[z, -5.5e-74], t$95$2, If[LessEqual[z, -3.8e-87], t$95$3, If[LessEqual[z, 1.22e-74], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_3 := y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + t\_1\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+45}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-74}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-87}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-74}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.20000000000000014e45 or -5.5000000000000001e-74 < z < -3.8e-87Initial program 86.9%
sub-neg86.9%
sub-neg86.9%
associate-*l*91.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in y around 0 86.9%
associate-*r*96.6%
associate-*r*96.5%
*-commutative96.5%
*-commutative96.5%
associate-*l*96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 69.8%
associate-*r*69.7%
*-commutative69.7%
associate-*r*69.7%
Simplified69.7%
sub-neg69.7%
+-commutative69.7%
distribute-lft-neg-in69.7%
metadata-eval69.7%
associate-*r*69.7%
*-commutative69.7%
*-commutative69.7%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
*-commutative74.3%
Applied egg-rr74.3%
if -5.20000000000000014e45 < z < -5.5000000000000001e-74 or 1.22000000000000009e-74 < z Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in a around 0 67.9%
if -3.8e-87 < z < 1.22000000000000009e-74Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.9%
Final simplification76.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.5e-17) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* y 9.0) (* z t)))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.5e-17) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.5d-17) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.5e-17) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.5e-17: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.5e-17) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.5e-17)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.5e-17], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{-17}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.50000000000000003e-17Initial program 95.1%
sub-neg95.1%
sub-neg95.1%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
if 1.50000000000000003e-17 < z Initial program 92.3%
Final simplification95.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 (* a (* 27.0 b))))
(if (<= z 5e+50)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (- (* x 2.0) (* z (* (* y 9.0) t))) 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 = a * (27.0 * b);
double tmp;
if (z <= 5e+50) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (z * ((y * 9.0) * t))) + 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 = a * (27.0d0 * b)
if (z <= 5d+50) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (z * ((y * 9.0d0) * t))) + 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 = a * (27.0 * b);
double tmp;
if (z <= 5e+50) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (z * ((y * 9.0) * t))) + 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 = a * (27.0 * b) tmp = 0 if z <= 5e+50: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (z * ((y * 9.0) * t))) + 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(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 5e+50) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(z * Float64(Float64(y * 9.0) * t))) + 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 = a * (27.0 * b);
tmp = 0.0;
if (z <= 5e+50)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (z * ((y * 9.0) * t))) + 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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e+50], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(N[(y * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{+50}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)\right) + t\_1\\
\end{array}
\end{array}
if z < 5e50Initial program 95.5%
sub-neg95.5%
sub-neg95.5%
associate-*l*97.3%
associate-*l*97.3%
Simplified97.3%
if 5e50 < z Initial program 90.6%
sub-neg90.6%
sub-neg90.6%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in y around 0 90.5%
associate-*r*95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.5%
*-commutative95.5%
Simplified95.5%
Final simplification96.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.58e-13)
(* z (* t (* y -9.0)))
(if (<= z 1.9e-74)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.58e-13) {
tmp = z * (t * (y * -9.0));
} else if (z <= 1.9e-74) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.58d-13)) then
tmp = z * (t * (y * (-9.0d0)))
else if (z <= 1.9d-74) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.58e-13) {
tmp = z * (t * (y * -9.0));
} else if (z <= 1.9e-74) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.58e-13: tmp = z * (t * (y * -9.0)) elif z <= 1.9e-74: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.58e-13) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (z <= 1.9e-74) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.58e-13)
tmp = z * (t * (y * -9.0));
elseif (z <= 1.9e-74)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.58e-13], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-74], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.58 \cdot 10^{-13}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-74}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.58000000000000008e-13Initial program 87.9%
sub-neg87.9%
sub-neg87.9%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in y around inf 70.7%
Taylor expanded in y around inf 46.2%
associate-*r*46.2%
*-commutative46.2%
*-commutative46.2%
associate-*r*52.0%
associate-*l*52.0%
*-commutative52.0%
*-commutative52.0%
Simplified52.0%
if -1.58000000000000008e-13 < z < 1.8999999999999998e-74Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.1%
if 1.8999999999999998e-74 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*94.2%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in a around 0 66.8%
Final simplification71.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -7.6e-14) (* z (* t (* y -9.0))) (if (<= z 0.01) (+ (* 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 (z <= -7.6e-14) {
tmp = z * (t * (y * -9.0));
} else if (z <= 0.01) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-7.6d-14)) then
tmp = z * (t * (y * (-9.0d0)))
else if (z <= 0.01d0) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.6e-14) {
tmp = z * (t * (y * -9.0));
} else if (z <= 0.01) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -7.6e-14: tmp = z * (t * (y * -9.0)) elif z <= 0.01: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.6e-14) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (z <= 0.01) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -7.6e-14)
tmp = z * (t * (y * -9.0));
elseif (z <= 0.01)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.6e-14], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.01], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-14}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 0.01:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -7.6000000000000004e-14Initial program 87.9%
sub-neg87.9%
sub-neg87.9%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in y around inf 70.7%
Taylor expanded in y around inf 46.2%
associate-*r*46.2%
*-commutative46.2%
*-commutative46.2%
associate-*r*52.0%
associate-*l*52.0%
*-commutative52.0%
*-commutative52.0%
Simplified52.0%
if -7.6000000000000004e-14 < z < 0.0100000000000000002Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.4%
if 0.0100000000000000002 < z Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in y around 0 92.0%
associate-*r*96.2%
associate-*r*96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 45.8%
*-commutative45.8%
associate-*l*45.8%
*-commutative45.8%
associate-*l*45.8%
Simplified45.8%
Final simplification65.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 -2.3e-82) (not (<= z 2.3e-74))) (* -9.0 (* t (* y z))) (* b (* a 27.0))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.3e-82) || !(z <= 2.3e-74)) {
tmp = -9.0 * (t * (y * z));
} 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 ((z <= (-2.3d-82)) .or. (.not. (z <= 2.3d-74))) then
tmp = (-9.0d0) * (t * (y * z))
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 ((z <= -2.3e-82) || !(z <= 2.3e-74)) {
tmp = -9.0 * (t * (y * z));
} 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 (z <= -2.3e-82) or not (z <= 2.3e-74): tmp = -9.0 * (t * (y * z)) 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 ((z <= -2.3e-82) || !(z <= 2.3e-74)) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 ((z <= -2.3e-82) || ~((z <= 2.3e-74)))
tmp = -9.0 * (t * (y * z));
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[z, -2.3e-82], N[Not[LessEqual[z, 2.3e-74]], $MachinePrecision]], N[(-9.0 * N[(t * N[(y * z), $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}\;z \leq -2.3 \cdot 10^{-82} \lor \neg \left(z \leq 2.3 \cdot 10^{-74}\right):\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -2.29999999999999997e-82 or 2.2999999999999998e-74 < z Initial program 91.8%
sub-neg91.8%
sub-neg91.8%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around inf 42.7%
if -2.29999999999999997e-82 < z < 2.2999999999999998e-74Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 52.2%
associate-*r*52.2%
*-commutative52.2%
Simplified52.2%
Final simplification46.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2.35e-83) (* -9.0 (* y (* z t))) (if (<= z 2.55e-75) (* b (* a 27.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 (z <= -2.35e-83) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.55e-75) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.35d-83)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 2.55d-75) then
tmp = b * (a * 27.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.35e-83) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.55e-75) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.35e-83: tmp = -9.0 * (y * (z * t)) elif z <= 2.55e-75: tmp = b * (a * 27.0) else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.35e-83) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 2.55e-75) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.35e-83)
tmp = -9.0 * (y * (z * t));
elseif (z <= 2.55e-75)
tmp = b * (a * 27.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.35e-83], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-75], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-83}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-75}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.3500000000000002e-83Initial program 90.3%
sub-neg90.3%
sub-neg90.3%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 73.1%
Taylor expanded in y around inf 42.4%
associate-*r*45.8%
*-commutative45.8%
associate-*r*44.5%
Simplified44.5%
if -2.3500000000000002e-83 < z < 2.5500000000000002e-75Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 52.2%
associate-*r*52.2%
*-commutative52.2%
Simplified52.2%
if 2.5500000000000002e-75 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*94.2%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 93.1%
associate-*r*95.6%
associate-*r*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in z around inf 43.0%
*-commutative43.0%
associate-*l*43.0%
*-commutative43.0%
associate-*l*43.0%
Simplified43.0%
Final simplification46.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 -3e-82) (* -9.0 (* y (* z t))) (if (<= z 7.2e-75) (* b (* a 27.0)) (* -9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-82) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 7.2e-75) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3d-82)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 7.2d-75) then
tmp = b * (a * 27.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-82) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 7.2e-75) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3e-82: tmp = -9.0 * (y * (z * t)) elif z <= 7.2e-75: tmp = b * (a * 27.0) else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e-82) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 7.2e-75) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3e-82)
tmp = -9.0 * (y * (z * t));
elseif (z <= 7.2e-75)
tmp = b * (a * 27.0);
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3e-82], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-75], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $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 \cdot 10^{-82}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-75}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.9999999999999999e-82Initial program 90.3%
sub-neg90.3%
sub-neg90.3%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 73.1%
Taylor expanded in y around inf 42.4%
associate-*r*45.8%
*-commutative45.8%
associate-*r*44.5%
Simplified44.5%
if -2.9999999999999999e-82 < z < 7.2000000000000001e-75Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 52.2%
associate-*r*52.2%
*-commutative52.2%
Simplified52.2%
if 7.2000000000000001e-75 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*94.2%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around inf 43.0%
Final simplification46.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* z (* (* y 9.0) t))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (z * ((y * 9.0) * t))) + (a * (27.0 * b));
}
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) - (z * ((y * 9.0d0) * t))) + (a * (27.0d0 * b))
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) - (z * ((y * 9.0) * t))) + (a * (27.0 * b));
}
[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) - (z * ((y * 9.0) * t))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(z * Float64(Float64(y * 9.0) * t))) + Float64(a * Float64(27.0 * b))) 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) - (z * ((y * 9.0) * t))) + (a * (27.0 * b));
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[(N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(N[(y * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 94.3%
associate-*r*94.1%
associate-*r*94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
*-commutative94.1%
Simplified94.1%
Final simplification94.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -5.2e+104) (not (<= x 2.45e+56))) (* 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 <= -5.2e+104) || !(x <= 2.45e+56)) {
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 <= (-5.2d+104)) .or. (.not. (x <= 2.45d+56))) 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 <= -5.2e+104) || !(x <= 2.45e+56)) {
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 <= -5.2e+104) or not (x <= 2.45e+56): 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 <= -5.2e+104) || !(x <= 2.45e+56)) 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 <= -5.2e+104) || ~((x <= 2.45e+56)))
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, -5.2e+104], N[Not[LessEqual[x, 2.45e+56]], $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 -5.2 \cdot 10^{+104} \lor \neg \left(x \leq 2.45 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if x < -5.20000000000000001e104 or 2.4500000000000001e56 < x Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 60.9%
if -5.20000000000000001e104 < x < 2.4500000000000001e56Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around inf 50.7%
associate-*r*50.7%
*-commutative50.7%
Simplified50.7%
Final simplification54.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 (or (<= x -6.5e+104) (not (<= x 6.1e+55))) (* 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 <= -6.5e+104) || !(x <= 6.1e+55)) {
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 <= (-6.5d+104)) .or. (.not. (x <= 6.1d+55))) 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 <= -6.5e+104) || !(x <= 6.1e+55)) {
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 <= -6.5e+104) or not (x <= 6.1e+55): 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 <= -6.5e+104) || !(x <= 6.1e+55)) 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 <= -6.5e+104) || ~((x <= 6.1e+55)))
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, -6.5e+104], N[Not[LessEqual[x, 6.1e+55]], $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 -6.5 \cdot 10^{+104} \lor \neg \left(x \leq 6.1 \cdot 10^{+55}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -6.5000000000000005e104 or 6.1000000000000001e55 < x Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 60.9%
if -6.5000000000000005e104 < x < 6.1000000000000001e55Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around inf 50.7%
Final simplification54.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 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 30.2%
Final simplification30.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 2024087
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(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)))