
(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 (<= (* y 9.0) -1e-105) (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 ((y * 9.0) <= -1e-105) {
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 (Float64(y * 9.0) <= -1e-105) 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[N[(y * 9.0), $MachinePrecision], -1e-105], 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}\;y \cdot 9 \leq -1 \cdot 10^{-105}:\\
\;\;\;\;\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 (*.f64 y #s(literal 9 binary64)) < -9.99999999999999965e-106Initial program 90.1%
Simplified96.6%
if -9.99999999999999965e-106 < (*.f64 y #s(literal 9 binary64)) Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*97.1%
distribute-lft-neg-in97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-+r-97.1%
associate-*l*97.1%
fma-define97.1%
cancel-sign-sub-inv97.1%
fma-define97.1%
distribute-lft-neg-in97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*r*96.7%
associate-*l*96.8%
neg-mul-196.8%
associate-*r*96.8%
Simplified96.8%
Final simplification96.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-286) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-286) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-286) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-286], 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[(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 2 \cdot 10^{-286}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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 < 2.0000000000000001e-286Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
if 2.0000000000000001e-286 < z Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-*r*97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-+r-97.9%
associate-*l*97.8%
fma-define97.8%
cancel-sign-sub-inv97.8%
fma-define97.8%
distribute-lft-neg-in97.8%
distribute-rgt-neg-in97.8%
*-commutative97.8%
associate-*r*96.8%
associate-*l*96.8%
neg-mul-196.8%
associate-*r*96.8%
Simplified96.8%
Final simplification96.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* 9.0 (* t (* y z)))))
(if (<= z -4.7e-55)
(+ (* y (* t (* z -9.0))) t_1)
(if (<= z -2.4e-123)
(- (* x 2.0) t_2)
(if (<= z 2.5e-138) (+ (* x 2.0) t_1) (- t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (z <= -4.7e-55) {
tmp = (y * (t * (z * -9.0))) + t_1;
} else if (z <= -2.4e-123) {
tmp = (x * 2.0) - t_2;
} else if (z <= 2.5e-138) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
if (z <= (-4.7d-55)) then
tmp = (y * (t * (z * (-9.0d0)))) + t_1
else if (z <= (-2.4d-123)) then
tmp = (x * 2.0d0) - t_2
else if (z <= 2.5d-138) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (z <= -4.7e-55) {
tmp = (y * (t * (z * -9.0))) + t_1;
} else if (z <= -2.4e-123) {
tmp = (x * 2.0) - t_2;
} else if (z <= 2.5e-138) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) tmp = 0 if z <= -4.7e-55: tmp = (y * (t * (z * -9.0))) + t_1 elif z <= -2.4e-123: tmp = (x * 2.0) - t_2 elif z <= 2.5e-138: tmp = (x * 2.0) + t_1 else: tmp = t_1 - t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -4.7e-55) tmp = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + t_1); elseif (z <= -2.4e-123) tmp = Float64(Float64(x * 2.0) - t_2); elseif (z <= 2.5e-138) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - t_2); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -4.7e-55)
tmp = (y * (t * (z * -9.0))) + t_1;
elseif (z <= -2.4e-123)
tmp = (x * 2.0) - t_2;
elseif (z <= 2.5e-138)
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.7e-55], N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, -2.4e-123], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[z, 2.5e-138], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + t\_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-123}:\\
\;\;\;\;x \cdot 2 - t\_2\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-138}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\_2\\
\end{array}
\end{array}
if z < -4.7e-55Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around 0 70.1%
sub-neg70.1%
+-commutative70.1%
*-commutative70.1%
distribute-rgt-neg-in70.1%
*-commutative70.1%
metadata-eval70.1%
associate-*r*70.1%
associate-*r*74.1%
*-commutative74.1%
associate-*r*74.1%
*-commutative74.1%
Applied egg-rr74.1%
if -4.7e-55 < z < -2.4e-123Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 69.9%
if -2.4e-123 < z < 2.49999999999999994e-138Initial program 98.5%
sub-neg98.5%
sub-neg98.5%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.6%
if 2.49999999999999994e-138 < z Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around 0 71.2%
Final simplification76.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -6.6e-55)
(+ (* y (* t (* z -9.0))) t_1)
(if (or (<= z -8.2e-124) (not (<= z 3.3e-49)))
(- (* x 2.0) (* 9.0 (* t (* y z))))
(+ (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.6e-55) {
tmp = (y * (t * (z * -9.0))) + t_1;
} else if ((z <= -8.2e-124) || !(z <= 3.3e-49)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-6.6d-55)) then
tmp = (y * (t * (z * (-9.0d0)))) + t_1
else if ((z <= (-8.2d-124)) .or. (.not. (z <= 3.3d-49))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = (x * 2.0d0) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.6e-55) {
tmp = (y * (t * (z * -9.0))) + t_1;
} else if ((z <= -8.2e-124) || !(z <= 3.3e-49)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -6.6e-55: tmp = (y * (t * (z * -9.0))) + t_1 elif (z <= -8.2e-124) or not (z <= 3.3e-49): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = (x * 2.0) + t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -6.6e-55) tmp = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + t_1); elseif ((z <= -8.2e-124) || !(z <= 3.3e-49)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(x * 2.0) + t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -6.6e-55)
tmp = (y * (t * (z * -9.0))) + t_1;
elseif ((z <= -8.2e-124) || ~((z <= 3.3e-49)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = (x * 2.0) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-55], N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[Or[LessEqual[z, -8.2e-124], N[Not[LessEqual[z, 3.3e-49]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + t\_1\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-124} \lor \neg \left(z \leq 3.3 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\end{array}
\end{array}
if z < -6.5999999999999999e-55Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around 0 70.1%
sub-neg70.1%
+-commutative70.1%
*-commutative70.1%
distribute-rgt-neg-in70.1%
*-commutative70.1%
metadata-eval70.1%
associate-*r*70.1%
associate-*r*74.1%
*-commutative74.1%
associate-*r*74.1%
*-commutative74.1%
Applied egg-rr74.1%
if -6.5999999999999999e-55 < z < -8.2000000000000008e-124 or 3.3e-49 < z Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in a around 0 77.6%
if -8.2000000000000008e-124 < z < 3.3e-49Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 84.6%
Final simplification79.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.5e+66)
(* y (* z (* t -9.0)))
(if (or (<= z -9.2e-122) (not (<= z 1e-49)))
(- (* x 2.0) (* 9.0 (* t (* y z))))
(+ (* x 2.0) (* 27.0 (* a b))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e+66) {
tmp = y * (z * (t * -9.0));
} else if ((z <= -9.2e-122) || !(z <= 1e-49)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.5d+66)) then
tmp = y * (z * (t * (-9.0d0)))
else if ((z <= (-9.2d-122)) .or. (.not. (z <= 1d-49))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e+66) {
tmp = y * (z * (t * -9.0));
} else if ((z <= -9.2e-122) || !(z <= 1e-49)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.5e+66: tmp = y * (z * (t * -9.0)) elif (z <= -9.2e-122) or not (z <= 1e-49): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.5e+66) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif ((z <= -9.2e-122) || !(z <= 1e-49)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.5e+66)
tmp = y * (z * (t * -9.0));
elseif ((z <= -9.2e-122) || ~((z <= 1e-49)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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[LessEqual[z, -2.5e+66], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -9.2e-122], N[Not[LessEqual[z, 1e-49]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+66}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-122} \lor \neg \left(z \leq 10^{-49}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -2.49999999999999996e66Initial program 82.5%
sub-neg82.5%
sub-neg82.5%
associate-*l*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in y around inf 61.1%
*-commutative61.1%
*-commutative61.1%
associate-*l*61.2%
associate-*r*62.3%
Simplified62.3%
if -2.49999999999999996e66 < z < -9.20000000000000028e-122 or 9.99999999999999936e-50 < z Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*95.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in a around 0 74.8%
if -9.20000000000000028e-122 < z < 9.99999999999999936e-50Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 84.6%
Final simplification75.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.95e-97)
(* y (* -9.0 (* z t)))
(if (<= z -3.6e-295)
(* x 2.0)
(if (<= z 5.4e-50) (* a (* 27.0 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 (z <= -1.95e-97) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -3.6e-295) {
tmp = x * 2.0;
} else if (z <= 5.4e-50) {
tmp = a * (27.0 * 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 (z <= (-1.95d-97)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-3.6d-295)) then
tmp = x * 2.0d0
else if (z <= 5.4d-50) then
tmp = a * (27.0d0 * 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 (z <= -1.95e-97) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -3.6e-295) {
tmp = x * 2.0;
} else if (z <= 5.4e-50) {
tmp = a * (27.0 * 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 z <= -1.95e-97: tmp = y * (-9.0 * (z * t)) elif z <= -3.6e-295: tmp = x * 2.0 elif z <= 5.4e-50: tmp = a * (27.0 * 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 (z <= -1.95e-97) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -3.6e-295) tmp = Float64(x * 2.0); elseif (z <= 5.4e-50) tmp = Float64(a * Float64(27.0 * 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 (z <= -1.95e-97)
tmp = y * (-9.0 * (z * t));
elseif (z <= -3.6e-295)
tmp = x * 2.0;
elseif (z <= 5.4e-50)
tmp = a * (27.0 * 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[z, -1.95e-97], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-295], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5.4e-50], N[(a * N[(27.0 * b), $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}\;z \leq -1.95 \cdot 10^{-97}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-295}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-50}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e-97Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around inf 52.8%
*-commutative52.8%
*-commutative52.8%
associate-*l*52.8%
associate-*r*53.6%
Simplified53.6%
Taylor expanded in z around 0 53.6%
if -1.9499999999999999e-97 < z < -3.6000000000000001e-295Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 47.0%
if -3.6000000000000001e-295 < z < 5.3999999999999999e-50Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 83.1%
Taylor expanded in b around inf 67.6%
Taylor expanded in b around inf 41.2%
associate-*r*41.2%
*-commutative41.2%
associate-*l*41.2%
*-commutative41.2%
Simplified41.2%
if 5.3999999999999999e-50 < z Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
associate-*l*93.6%
associate-*l*93.6%
associate-*r*93.7%
Applied egg-rr93.7%
*-commutative93.7%
add-cbrt-cube78.3%
pow378.3%
*-commutative78.3%
cube-prod78.3%
*-commutative78.3%
metadata-eval78.3%
Applied egg-rr78.3%
Taylor expanded in y around inf 52.3%
*-commutative52.3%
associate-*r*52.2%
*-commutative52.2%
*-commutative52.2%
associate-*r*52.3%
Simplified52.3%
Final simplification49.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* y (* z -9.0)))))
(if (<= z -6.6e-99)
t_1
(if (<= z -1.55e-295)
(* x 2.0)
(if (<= z 1.65e-48) (* a (* 27.0 b)) 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 = t * (y * (z * -9.0));
double tmp;
if (z <= -6.6e-99) {
tmp = t_1;
} else if (z <= -1.55e-295) {
tmp = x * 2.0;
} else if (z <= 1.65e-48) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y * (z * (-9.0d0)))
if (z <= (-6.6d-99)) then
tmp = t_1
else if (z <= (-1.55d-295)) then
tmp = x * 2.0d0
else if (z <= 1.65d-48) then
tmp = a * (27.0d0 * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (z <= -6.6e-99) {
tmp = t_1;
} else if (z <= -1.55e-295) {
tmp = x * 2.0;
} else if (z <= 1.65e-48) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (y * (z * -9.0)) tmp = 0 if z <= -6.6e-99: tmp = t_1 elif z <= -1.55e-295: tmp = x * 2.0 elif z <= 1.65e-48: tmp = a * (27.0 * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(y * Float64(z * -9.0))) tmp = 0.0 if (z <= -6.6e-99) tmp = t_1; elseif (z <= -1.55e-295) tmp = Float64(x * 2.0); elseif (z <= 1.65e-48) tmp = Float64(a * Float64(27.0 * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (y * (z * -9.0));
tmp = 0.0;
if (z <= -6.6e-99)
tmp = t_1;
elseif (z <= -1.55e-295)
tmp = x * 2.0;
elseif (z <= 1.65e-48)
tmp = a * (27.0 * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-99], t$95$1, If[LessEqual[z, -1.55e-295], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.65e-48], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-295}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-48}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.59999999999999973e-99 or 1.65e-48 < z Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
+-commutative94.0%
associate-+r-94.0%
*-commutative94.0%
associate-*l*93.9%
associate-*l*93.4%
associate-*r*93.4%
Applied egg-rr93.4%
*-commutative93.4%
add-cbrt-cube77.9%
pow377.9%
*-commutative77.9%
cube-prod77.9%
*-commutative77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in y around inf 52.5%
*-commutative52.5%
associate-*r*52.5%
*-commutative52.5%
*-commutative52.5%
associate-*r*52.5%
Simplified52.5%
if -6.59999999999999973e-99 < z < -1.5500000000000001e-295Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 47.0%
if -1.5500000000000001e-295 < z < 1.65e-48Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 83.1%
Taylor expanded in b around inf 67.6%
Taylor expanded in b around inf 41.2%
associate-*r*41.2%
*-commutative41.2%
associate-*l*41.2%
*-commutative41.2%
Simplified41.2%
Final simplification49.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= z -1.25e-99)
t_1
(if (<= z -3.8e-295)
(* x 2.0)
(if (<= z 5.1e-50) (* a (* 27.0 b)) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -1.25e-99) {
tmp = t_1;
} else if (z <= -3.8e-295) {
tmp = x * 2.0;
} else if (z <= 5.1e-50) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (z <= (-1.25d-99)) then
tmp = t_1
else if (z <= (-3.8d-295)) then
tmp = x * 2.0d0
else if (z <= 5.1d-50) then
tmp = a * (27.0d0 * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -1.25e-99) {
tmp = t_1;
} else if (z <= -3.8e-295) {
tmp = x * 2.0;
} else if (z <= 5.1e-50) {
tmp = a * (27.0 * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if z <= -1.25e-99: tmp = t_1 elif z <= -3.8e-295: tmp = x * 2.0 elif z <= 5.1e-50: tmp = a * (27.0 * b) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -1.25e-99) tmp = t_1; elseif (z <= -3.8e-295) tmp = Float64(x * 2.0); elseif (z <= 5.1e-50) tmp = Float64(a * Float64(27.0 * b)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -1.25e-99)
tmp = t_1;
elseif (z <= -3.8e-295)
tmp = x * 2.0;
elseif (z <= 5.1e-50)
tmp = a * (27.0 * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e-99], t$95$1, If[LessEqual[z, -3.8e-295], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5.1e-50], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-295}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-50}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.24999999999999992e-99 or 5.10000000000000045e-50 < z Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in y around inf 52.5%
if -1.24999999999999992e-99 < z < -3.80000000000000018e-295Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 47.0%
if -3.80000000000000018e-295 < z < 5.10000000000000045e-50Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 83.1%
Taylor expanded in b around inf 67.6%
Taylor expanded in b around inf 41.2%
associate-*r*41.2%
*-commutative41.2%
associate-*l*41.2%
*-commutative41.2%
Simplified41.2%
Final simplification49.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-286) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-286) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 2d-286) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-286) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2e-286: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-286) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2e-286)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-286], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-286}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-286Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
if 2.0000000000000001e-286 < z Initial program 96.8%
Final simplification96.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.2e-104)
(* z (- (* x (/ 2.0 z)) (* 9.0 (* y t))))
(if (<= z 1.18e-48)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-104) {
tmp = z * ((x * (2.0 / z)) - (9.0 * (y * t)));
} else if (z <= 1.18e-48) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.2d-104)) then
tmp = z * ((x * (2.0d0 / z)) - (9.0d0 * (y * t)))
else if (z <= 1.18d-48) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.2e-104) {
tmp = z * ((x * (2.0 / z)) - (9.0 * (y * t)));
} else if (z <= 1.18e-48) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.2e-104: tmp = z * ((x * (2.0 / z)) - (9.0 * (y * t))) elif z <= 1.18e-48: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.2e-104) tmp = Float64(z * Float64(Float64(x * Float64(2.0 / z)) - Float64(9.0 * Float64(y * t)))); elseif (z <= 1.18e-48) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.2e-104)
tmp = z * ((x * (2.0 / z)) - (9.0 * (y * t)));
elseif (z <= 1.18e-48)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.2e-104], N[(z * N[(N[(x * N[(2.0 / z), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e-48], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-104}:\\
\;\;\;\;z \cdot \left(x \cdot \frac{2}{z} - 9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-48}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.20000000000000012e-104Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in z around inf 94.4%
Taylor expanded in x around inf 75.4%
associate-*r/75.4%
*-commutative75.4%
associate-*r/75.4%
Simplified75.4%
if -2.20000000000000012e-104 < z < 1.18000000000000007e-48Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.6%
if 1.18000000000000007e-48 < z Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around 0 78.7%
Final simplification80.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.7) (* y (* z (* t -9.0))) (if (<= z 2.1e-13) (+ (* 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 (z <= -1.7) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.1e-13) {
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 (z <= (-1.7d0)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 2.1d-13) 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 (z <= -1.7) {
tmp = y * (z * (t * -9.0));
} else if (z <= 2.1e-13) {
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 z <= -1.7: tmp = y * (z * (t * -9.0)) elif z <= 2.1e-13: 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 (z <= -1.7) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 2.1e-13) 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 (z <= -1.7)
tmp = y * (z * (t * -9.0));
elseif (z <= 2.1e-13)
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[z, -1.7], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-13], 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}\;z \leq -1.7:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;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 z < -1.69999999999999996Initial program 85.1%
sub-neg85.1%
sub-neg85.1%
associate-*l*93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 57.1%
*-commutative57.1%
*-commutative57.1%
associate-*l*57.2%
associate-*r*58.2%
Simplified58.2%
if -1.69999999999999996 < z < 2.09999999999999989e-13Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.9%
if 2.09999999999999989e-13 < z Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
+-commutative93.0%
associate-+r-93.0%
*-commutative93.0%
associate-*l*93.0%
associate-*l*93.0%
associate-*r*93.1%
Applied egg-rr93.1%
*-commutative93.1%
add-cbrt-cube78.4%
pow378.4%
*-commutative78.4%
cube-prod78.4%
*-commutative78.4%
metadata-eval78.4%
Applied egg-rr78.4%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
associate-*r*55.8%
*-commutative55.8%
*-commutative55.8%
associate-*r*55.9%
Simplified55.9%
Final simplification68.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 (<= (* a 27.0) -5e+128) (* a (* 27.0 b)) (if (<= (* a 27.0) 2e-11) (* 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 ((a * 27.0) <= -5e+128) {
tmp = a * (27.0 * b);
} else if ((a * 27.0) <= 2e-11) {
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 ((a * 27.0d0) <= (-5d+128)) then
tmp = a * (27.0d0 * b)
else if ((a * 27.0d0) <= 2d-11) 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 ((a * 27.0) <= -5e+128) {
tmp = a * (27.0 * b);
} else if ((a * 27.0) <= 2e-11) {
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 (a * 27.0) <= -5e+128: tmp = a * (27.0 * b) elif (a * 27.0) <= 2e-11: 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 (Float64(a * 27.0) <= -5e+128) tmp = Float64(a * Float64(27.0 * b)); elseif (Float64(a * 27.0) <= 2e-11) 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 ((a * 27.0) <= -5e+128)
tmp = a * (27.0 * b);
elseif ((a * 27.0) <= 2e-11)
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[N[(a * 27.0), $MachinePrecision], -5e+128], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], 2e-11], 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}\;a \cdot 27 \leq -5 \cdot 10^{+128}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \cdot 27 \leq 2 \cdot 10^{-11}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 27 binary64)) < -5e128Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*97.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in y around 0 69.3%
Taylor expanded in b around inf 63.7%
Taylor expanded in b around inf 60.8%
associate-*r*60.9%
*-commutative60.9%
associate-*l*61.0%
*-commutative61.0%
Simplified61.0%
if -5e128 < (*.f64 a #s(literal 27 binary64)) < 1.99999999999999988e-11Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.9%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in x around inf 39.3%
if 1.99999999999999988e-11 < (*.f64 a #s(literal 27 binary64)) Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*93.5%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around 0 68.3%
Taylor expanded in b around inf 55.8%
Taylor expanded in b around inf 45.9%
Final simplification43.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 (+ (- (* x 2.0) (* (* y 9.0) (* z 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) - ((y * 9.0) * (z * 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) - ((y * 9.0d0) * (z * 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) - ((y * 9.0) * (z * 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) - ((y * 9.0) * (z * 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(Float64(y * 9.0) * Float64(z * 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) - ((y * 9.0) * (z * 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[(N[(y * 9.0), $MachinePrecision] * N[(z * 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 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.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 (<= a -1.24e+126) (not (<= a 9.4e-7))) (* 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 ((a <= -1.24e+126) || !(a <= 9.4e-7)) {
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 ((a <= (-1.24d+126)) .or. (.not. (a <= 9.4d-7))) 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 ((a <= -1.24e+126) || !(a <= 9.4e-7)) {
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 (a <= -1.24e+126) or not (a <= 9.4e-7): 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 ((a <= -1.24e+126) || !(a <= 9.4e-7)) 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 ((a <= -1.24e+126) || ~((a <= 9.4e-7)))
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[a, -1.24e+126], N[Not[LessEqual[a, 9.4e-7]], $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}\;a \leq -1.24 \cdot 10^{+126} \lor \neg \left(a \leq 9.4 \cdot 10^{-7}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.24e126 or 9.4e-7 < a Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in y around 0 69.3%
Taylor expanded in b around inf 59.2%
Taylor expanded in b around inf 51.6%
if -1.24e126 < a < 9.4e-7Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around inf 39.1%
Final simplification43.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.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around inf 32.2%
Final simplification32.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 2024131
(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)))