
(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 12 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. 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-13) (- (+ (* x 2.0) (* 27.0 (* b a))) (* y (* (* z 9.0) t))) (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);
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-13) {
tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
} 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]) 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-13) tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))) - Float64(y * Float64(Float64(z * 9.0) * t))); 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. 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-13], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $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])\\\\
[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^{-13}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\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 < 1.49999999999999992e-13Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*95.7%
associate-*l*96.3%
Simplified96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
associate-*l*96.2%
associate-*l*96.7%
associate-*r*96.7%
Applied egg-rr96.7%
if 1.49999999999999992e-13 < z Initial program 94.4%
+-commutative94.4%
associate-+r-94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-def99.6%
cancel-sign-sub-inv99.6%
fma-def99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
*-commutative99.6%
associate-*r*95.8%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Final simplification96.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* y (* z t))))
(t_2 (* -9.0 (* t (* z y))))
(t_3 (* 27.0 (* b a))))
(if (<= x -1.95e+51)
(* x 2.0)
(if (<= x -2.5e-168)
t_3
(if (<= x -1.5e-199)
t_2
(if (<= x -3.5e-228)
t_3
(if (<= x -1.25e-261)
t_1
(if (<= x 2.1e-238)
(* b (* 27.0 a))
(if (<= x 6.2e-123)
t_2
(if (<= x 7.5e-20)
t_3
(if (<= x 1.3e+14) t_1 (* x 2.0))))))))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = -9.0 * (y * (z * t));
double t_2 = -9.0 * (t * (z * y));
double t_3 = 27.0 * (b * a);
double tmp;
if (x <= -1.95e+51) {
tmp = x * 2.0;
} else if (x <= -2.5e-168) {
tmp = t_3;
} else if (x <= -1.5e-199) {
tmp = t_2;
} else if (x <= -3.5e-228) {
tmp = t_3;
} else if (x <= -1.25e-261) {
tmp = t_1;
} else if (x <= 2.1e-238) {
tmp = b * (27.0 * a);
} else if (x <= 6.2e-123) {
tmp = t_2;
} else if (x <= 7.5e-20) {
tmp = t_3;
} else if (x <= 1.3e+14) {
tmp = t_1;
} 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.
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 = (-9.0d0) * (y * (z * t))
t_2 = (-9.0d0) * (t * (z * y))
t_3 = 27.0d0 * (b * a)
if (x <= (-1.95d+51)) then
tmp = x * 2.0d0
else if (x <= (-2.5d-168)) then
tmp = t_3
else if (x <= (-1.5d-199)) then
tmp = t_2
else if (x <= (-3.5d-228)) then
tmp = t_3
else if (x <= (-1.25d-261)) then
tmp = t_1
else if (x <= 2.1d-238) then
tmp = b * (27.0d0 * a)
else if (x <= 6.2d-123) then
tmp = t_2
else if (x <= 7.5d-20) then
tmp = t_3
else if (x <= 1.3d+14) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 * (y * (z * t));
double t_2 = -9.0 * (t * (z * y));
double t_3 = 27.0 * (b * a);
double tmp;
if (x <= -1.95e+51) {
tmp = x * 2.0;
} else if (x <= -2.5e-168) {
tmp = t_3;
} else if (x <= -1.5e-199) {
tmp = t_2;
} else if (x <= -3.5e-228) {
tmp = t_3;
} else if (x <= -1.25e-261) {
tmp = t_1;
} else if (x <= 2.1e-238) {
tmp = b * (27.0 * a);
} else if (x <= 6.2e-123) {
tmp = t_2;
} else if (x <= 7.5e-20) {
tmp = t_3;
} else if (x <= 1.3e+14) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 * (y * (z * t)) t_2 = -9.0 * (t * (z * y)) t_3 = 27.0 * (b * a) tmp = 0 if x <= -1.95e+51: tmp = x * 2.0 elif x <= -2.5e-168: tmp = t_3 elif x <= -1.5e-199: tmp = t_2 elif x <= -3.5e-228: tmp = t_3 elif x <= -1.25e-261: tmp = t_1 elif x <= 2.1e-238: tmp = b * (27.0 * a) elif x <= 6.2e-123: tmp = t_2 elif x <= 7.5e-20: tmp = t_3 elif x <= 1.3e+14: tmp = t_1 else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(y * Float64(z * t))) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) t_3 = Float64(27.0 * Float64(b * a)) tmp = 0.0 if (x <= -1.95e+51) tmp = Float64(x * 2.0); elseif (x <= -2.5e-168) tmp = t_3; elseif (x <= -1.5e-199) tmp = t_2; elseif (x <= -3.5e-228) tmp = t_3; elseif (x <= -1.25e-261) tmp = t_1; elseif (x <= 2.1e-238) tmp = Float64(b * Float64(27.0 * a)); elseif (x <= 6.2e-123) tmp = t_2; elseif (x <= 7.5e-20) tmp = t_3; elseif (x <= 1.3e+14) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 * (y * (z * t));
t_2 = -9.0 * (t * (z * y));
t_3 = 27.0 * (b * a);
tmp = 0.0;
if (x <= -1.95e+51)
tmp = x * 2.0;
elseif (x <= -2.5e-168)
tmp = t_3;
elseif (x <= -1.5e-199)
tmp = t_2;
elseif (x <= -3.5e-228)
tmp = t_3;
elseif (x <= -1.25e-261)
tmp = t_1;
elseif (x <= 2.1e-238)
tmp = b * (27.0 * a);
elseif (x <= 6.2e-123)
tmp = t_2;
elseif (x <= 7.5e-20)
tmp = t_3;
elseif (x <= 1.3e+14)
tmp = t_1;
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.
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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+51], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.5e-168], t$95$3, If[LessEqual[x, -1.5e-199], t$95$2, If[LessEqual[x, -3.5e-228], t$95$3, If[LessEqual[x, -1.25e-261], t$95$1, If[LessEqual[x, 2.1e-238], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e-123], t$95$2, If[LessEqual[x, 7.5e-20], t$95$3, If[LessEqual[x, 1.3e+14], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_3 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+51}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-199}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-228}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-261}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-238}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-20}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.94999999999999992e51 or 1.3e14 < x Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*93.7%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 57.5%
if -1.94999999999999992e51 < x < -2.50000000000000001e-168 or -1.49999999999999992e-199 < x < -3.49999999999999975e-228 or 6.19999999999999996e-123 < x < 7.49999999999999981e-20Initial program 98.0%
sub-neg98.0%
sub-neg98.0%
associate-*l*93.7%
associate-*l*93.8%
Simplified93.8%
+-commutative93.8%
associate-+r-93.8%
*-commutative93.8%
associate-*l*93.8%
associate-*l*93.8%
associate-*r*93.9%
Applied egg-rr93.9%
Taylor expanded in b around inf 61.8%
if -2.50000000000000001e-168 < x < -1.49999999999999992e-199 or 2.1000000000000001e-238 < x < 6.19999999999999996e-123Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in y around inf 70.4%
if -3.49999999999999975e-228 < x < -1.24999999999999995e-261 or 7.49999999999999981e-20 < x < 1.3e14Initial program 91.6%
sub-neg91.6%
sub-neg91.6%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
+-commutative87.7%
associate-+r-87.7%
*-commutative87.7%
associate-*l*87.7%
associate-*l*87.8%
associate-*r*87.8%
Applied egg-rr87.8%
Taylor expanded in y around inf 61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*l*59.7%
*-commutative59.7%
associate-*r*59.7%
*-commutative59.7%
associate-*l*59.6%
associate-*r*61.9%
associate-*r*61.8%
distribute-lft-neg-in61.8%
*-commutative61.8%
associate-*r*61.9%
distribute-lft-neg-in61.9%
distribute-rgt-neg-in61.9%
metadata-eval61.9%
Simplified61.9%
Taylor expanded in t around 0 61.9%
*-commutative61.9%
associate-*l*59.6%
Simplified59.6%
if -1.24999999999999995e-261 < x < 2.1000000000000001e-238Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*99.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around 0 90.7%
sub-neg90.7%
*-commutative90.7%
associate-*r*91.0%
*-commutative91.0%
distribute-rgt-neg-in91.0%
metadata-eval91.0%
Applied egg-rr91.0%
Taylor expanded in b around inf 67.4%
associate-*r*67.4%
*-commutative67.4%
Simplified67.4%
Final simplification61.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))) (t_2 (* 27.0 (* b a))))
(if (<= x -1.25e+50)
(* x 2.0)
(if (<= x -1.56e-168)
t_2
(if (<= x -1.75e-199)
t_1
(if (<= x 7e-240)
(* b (* 27.0 a))
(if (<= x 4.8e-122)
t_1
(if (<= x 2.75e-27) t_2 (if (<= x 2.2e+14) t_1 (* x 2.0))))))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = -9.0 * (t * (z * y));
double t_2 = 27.0 * (b * a);
double tmp;
if (x <= -1.25e+50) {
tmp = x * 2.0;
} else if (x <= -1.56e-168) {
tmp = t_2;
} else if (x <= -1.75e-199) {
tmp = t_1;
} else if (x <= 7e-240) {
tmp = b * (27.0 * a);
} else if (x <= 4.8e-122) {
tmp = t_1;
} else if (x <= 2.75e-27) {
tmp = t_2;
} else if (x <= 2.2e+14) {
tmp = t_1;
} 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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
t_2 = 27.0d0 * (b * a)
if (x <= (-1.25d+50)) then
tmp = x * 2.0d0
else if (x <= (-1.56d-168)) then
tmp = t_2
else if (x <= (-1.75d-199)) then
tmp = t_1
else if (x <= 7d-240) then
tmp = b * (27.0d0 * a)
else if (x <= 4.8d-122) then
tmp = t_1
else if (x <= 2.75d-27) then
tmp = t_2
else if (x <= 2.2d+14) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double t_2 = 27.0 * (b * a);
double tmp;
if (x <= -1.25e+50) {
tmp = x * 2.0;
} else if (x <= -1.56e-168) {
tmp = t_2;
} else if (x <= -1.75e-199) {
tmp = t_1;
} else if (x <= 7e-240) {
tmp = b * (27.0 * a);
} else if (x <= 4.8e-122) {
tmp = t_1;
} else if (x <= 2.75e-27) {
tmp = t_2;
} else if (x <= 2.2e+14) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) t_2 = 27.0 * (b * a) tmp = 0 if x <= -1.25e+50: tmp = x * 2.0 elif x <= -1.56e-168: tmp = t_2 elif x <= -1.75e-199: tmp = t_1 elif x <= 7e-240: tmp = b * (27.0 * a) elif x <= 4.8e-122: tmp = t_1 elif x <= 2.75e-27: tmp = t_2 elif x <= 2.2e+14: tmp = t_1 else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) t_2 = Float64(27.0 * Float64(b * a)) tmp = 0.0 if (x <= -1.25e+50) tmp = Float64(x * 2.0); elseif (x <= -1.56e-168) tmp = t_2; elseif (x <= -1.75e-199) tmp = t_1; elseif (x <= 7e-240) tmp = Float64(b * Float64(27.0 * a)); elseif (x <= 4.8e-122) tmp = t_1; elseif (x <= 2.75e-27) tmp = t_2; elseif (x <= 2.2e+14) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
t_2 = 27.0 * (b * a);
tmp = 0.0;
if (x <= -1.25e+50)
tmp = x * 2.0;
elseif (x <= -1.56e-168)
tmp = t_2;
elseif (x <= -1.75e-199)
tmp = t_1;
elseif (x <= 7e-240)
tmp = b * (27.0 * a);
elseif (x <= 4.8e-122)
tmp = t_1;
elseif (x <= 2.75e-27)
tmp = t_2;
elseif (x <= 2.2e+14)
tmp = t_1;
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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+50], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.56e-168], t$95$2, If[LessEqual[x, -1.75e-199], t$95$1, If[LessEqual[x, 7e-240], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e-122], t$95$1, If[LessEqual[x, 2.75e-27], t$95$2, If[LessEqual[x, 2.2e+14], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+50}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.56 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-240}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.25e50 or 2.2e14 < x Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*93.7%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 57.5%
if -1.25e50 < x < -1.55999999999999991e-168 or 4.79999999999999975e-122 < x < 2.7500000000000001e-27Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*94.7%
associate-*l*94.8%
Simplified94.8%
+-commutative94.8%
associate-+r-94.8%
*-commutative94.8%
associate-*l*94.8%
associate-*l*94.8%
associate-*r*94.8%
Applied egg-rr94.8%
Taylor expanded in b around inf 59.8%
if -1.55999999999999991e-168 < x < -1.7499999999999999e-199 or 7.00000000000000032e-240 < x < 4.79999999999999975e-122 or 2.7500000000000001e-27 < x < 2.2e14Initial program 92.0%
sub-neg92.0%
sub-neg92.0%
associate-*l*90.2%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 69.1%
if -1.7499999999999999e-199 < x < 7.00000000000000032e-240Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*92.6%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in x around 0 90.6%
sub-neg90.6%
*-commutative90.6%
associate-*r*90.8%
*-commutative90.8%
distribute-rgt-neg-in90.8%
metadata-eval90.8%
Applied egg-rr90.8%
Taylor expanded in b around inf 56.6%
associate-*r*56.6%
*-commutative56.6%
Simplified56.6%
Final simplification60.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x 2.0) (* 27.0 (* b a)))) (t_2 (* t (* z y))))
(if (<= x -7e+29)
t_1
(if (<= x 1.5e-20)
(+ (* a (* 27.0 b)) (* -9.0 t_2))
(if (or (<= x 7.2e+220) (not (<= x 1.65e+279)))
(- (* x 2.0) (* 9.0 t_2))
t_1)))))assert(x < y && y < z && z < t && t < a && 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 t_1 = (x * 2.0) + (27.0 * (b * a));
double t_2 = t * (z * y);
double tmp;
if (x <= -7e+29) {
tmp = t_1;
} else if (x <= 1.5e-20) {
tmp = (a * (27.0 * b)) + (-9.0 * t_2);
} else if ((x <= 7.2e+220) || !(x <= 1.65e+279)) {
tmp = (x * 2.0) - (9.0 * t_2);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = (x * 2.0d0) + (27.0d0 * (b * a))
t_2 = t * (z * y)
if (x <= (-7d+29)) then
tmp = t_1
else if (x <= 1.5d-20) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * t_2)
else if ((x <= 7.2d+220) .or. (.not. (x <= 1.65d+279))) then
tmp = (x * 2.0d0) - (9.0d0 * t_2)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (b * a));
double t_2 = t * (z * y);
double tmp;
if (x <= -7e+29) {
tmp = t_1;
} else if (x <= 1.5e-20) {
tmp = (a * (27.0 * b)) + (-9.0 * t_2);
} else if ((x <= 7.2e+220) || !(x <= 1.65e+279)) {
tmp = (x * 2.0) - (9.0 * t_2);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) + (27.0 * (b * a)) t_2 = t * (z * y) tmp = 0 if x <= -7e+29: tmp = t_1 elif x <= 1.5e-20: tmp = (a * (27.0 * b)) + (-9.0 * t_2) elif (x <= 7.2e+220) or not (x <= 1.65e+279): tmp = (x * 2.0) - (9.0 * t_2) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))) t_2 = Float64(t * Float64(z * y)) tmp = 0.0 if (x <= -7e+29) tmp = t_1; elseif (x <= 1.5e-20) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * t_2)); elseif ((x <= 7.2e+220) || !(x <= 1.65e+279)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * t_2)); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) + (27.0 * (b * a));
t_2 = t * (z * y);
tmp = 0.0;
if (x <= -7e+29)
tmp = t_1;
elseif (x <= 1.5e-20)
tmp = (a * (27.0 * b)) + (-9.0 * t_2);
elseif ((x <= 7.2e+220) || ~((x <= 1.65e+279)))
tmp = (x * 2.0) - (9.0 * t_2);
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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+29], t$95$1, If[LessEqual[x, 1.5e-20], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * t$95$2), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 7.2e+220], N[Not[LessEqual[x, 1.65e+279]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\
t_2 := t \cdot \left(z \cdot y\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot t\_2\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+220} \lor \neg \left(x \leq 1.65 \cdot 10^{+279}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.99999999999999958e29 or 7.20000000000000038e220 < x < 1.64999999999999996e279Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*94.3%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around 0 86.5%
if -6.99999999999999958e29 < x < 1.50000000000000014e-20Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*92.6%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in x around 0 90.6%
sub-neg90.6%
*-commutative90.6%
associate-*r*90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
metadata-eval90.6%
Applied egg-rr90.6%
if 1.50000000000000014e-20 < x < 7.20000000000000038e220 or 1.64999999999999996e279 < x Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around 0 79.7%
Final simplification87.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 2e+74)
(+ (- (* x 2.0) (* (* y 9.0) (* z t))) t_1)
(+ t_1 (* -9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = a * (27.0 * b);
double tmp;
if (z <= 2e+74) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
} else {
tmp = t_1 + (-9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 2d+74) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + t_1
else
tmp = t_1 + ((-9.0d0) * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= 2e+74) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
} else {
tmp = t_1 + (-9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 <= 2e+74: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1 else: tmp = t_1 + (-9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= 2e+74) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + t_1); else tmp = Float64(t_1 + Float64(-9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= 2e+74)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
else
tmp = t_1 + (-9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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, 2e+74], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[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 2 \cdot 10^{+74}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.9999999999999999e74Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*96.0%
associate-*l*96.6%
Simplified96.6%
if 1.9999999999999999e74 < z Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*81.7%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in x around 0 81.7%
sub-neg81.7%
*-commutative81.7%
associate-*r*81.6%
*-commutative81.6%
distribute-rgt-neg-in81.6%
metadata-eval81.6%
Applied egg-rr81.6%
Final simplification93.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 20000.0) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && 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 <= 20000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 20000.0d0) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (27.0d0 * a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= 20000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 <= 20000.0: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= 20000.0) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(27.0 * a))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= 20000.0)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, 20000.0], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 20000:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if z < 2e4Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*95.7%
associate-*l*96.3%
Simplified96.3%
if 2e4 < z Initial program 94.2%
Final simplification95.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 5e-14) (- (+ (* x 2.0) (* 27.0 (* b a))) (* y (* (* z 9.0) t))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && 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 <= 5e-14) {
tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 5d-14) then
tmp = ((x * 2.0d0) + (27.0d0 * (b * a))) - (y * ((z * 9.0d0) * t))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (27.0d0 * a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= 5e-14) {
tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 <= 5e-14: tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= 5e-14) tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))) - Float64(y * Float64(Float64(z * 9.0) * t))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(27.0 * a))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= 5e-14)
tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (27.0 * a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, 5e-14], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if z < 5.0000000000000002e-14Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*95.7%
associate-*l*96.3%
Simplified96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
associate-*l*96.2%
associate-*l*96.7%
associate-*r*96.7%
Applied egg-rr96.7%
if 5.0000000000000002e-14 < z Initial program 94.4%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.3e-47) (not (<= b 6.4e+31))) (+ (* x 2.0) (* 27.0 (* b a))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.3e-47) || !(b <= 6.4e+31)) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4.3d-47)) .or. (.not. (b <= 6.4d+31))) then
tmp = (x * 2.0d0) + (27.0d0 * (b * a))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.3e-47) || !(b <= 6.4e+31)) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.3e-47) or not (b <= 6.4e+31): tmp = (x * 2.0) + (27.0 * (b * a)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.3e-47) || !(b <= 6.4e+31)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -4.3e-47) || ~((b <= 6.4e+31)))
tmp = (x * 2.0) + (27.0 * (b * a));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.3e-47], N[Not[LessEqual[b, 6.4e+31]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.3 \cdot 10^{-47} \lor \neg \left(b \leq 6.4 \cdot 10^{+31}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if b < -4.2999999999999998e-47 or 6.4000000000000001e31 < b Initial program 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around 0 76.2%
if -4.2999999999999998e-47 < b < 6.4000000000000001e31Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*91.7%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in a around 0 84.8%
Final simplification80.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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.65e-8)
(* (* z t) (* y -9.0))
(if (<= z 1.52e+100)
(+ (* x 2.0) (* 27.0 (* b a)))
(* -9.0 (* t (* z y))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e-8) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 1.52e+100) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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.65d-8)) then
tmp = (z * t) * (y * (-9.0d0))
else if (z <= 1.52d+100) then
tmp = (x * 2.0d0) + (27.0d0 * (b * a))
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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.65e-8) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 1.52e+100) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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.65e-8: tmp = (z * t) * (y * -9.0) elif z <= 1.52e+100: tmp = (x * 2.0) + (27.0 * (b * a)) else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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.65e-8) tmp = Float64(Float64(z * t) * Float64(y * -9.0)); elseif (z <= 1.52e+100) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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.65e-8)
tmp = (z * t) * (y * -9.0);
elseif (z <= 1.52e+100)
tmp = (x * 2.0) + (27.0 * (b * a));
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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.65e-8], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.52e+100], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-8}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{+100}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.64999999999999989e-8Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*90.5%
associate-*l*90.6%
Simplified90.6%
+-commutative90.6%
associate-+r-90.6%
*-commutative90.6%
associate-*l*90.5%
associate-*l*90.4%
associate-*r*90.4%
Applied egg-rr90.4%
Taylor expanded in y around inf 55.2%
metadata-eval55.2%
distribute-lft-neg-in55.2%
associate-*r*55.2%
*-commutative55.2%
associate-*l*50.6%
*-commutative50.6%
associate-*r*50.6%
*-commutative50.6%
associate-*l*50.7%
associate-*r*55.1%
associate-*r*55.2%
distribute-lft-neg-in55.2%
*-commutative55.2%
associate-*r*55.1%
distribute-lft-neg-in55.1%
distribute-rgt-neg-in55.1%
metadata-eval55.1%
Simplified55.1%
Taylor expanded in t around 0 55.2%
*-commutative55.2%
associate-*r*55.2%
*-commutative55.2%
associate-*r*55.1%
rem-log-exp23.3%
log-pow23.3%
*-commutative23.3%
associate-*r*22.9%
*-commutative22.9%
log-pow22.9%
rem-log-exp50.7%
Simplified50.7%
if -1.64999999999999989e-8 < z < 1.52e100Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*97.1%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in y around 0 79.6%
if 1.52e100 < z Initial program 91.7%
sub-neg91.7%
sub-neg91.7%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in y around inf 54.7%
Final simplification68.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -2.9e+51) (not (<= x 2300000000.0))) (* x 2.0) (* 27.0 (* b a))))
assert(x < y && y < z && z < t && t < a && 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 <= -2.9e+51) || !(x <= 2300000000.0)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (b * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-2.9d+51)) .or. (.not. (x <= 2300000000.0d0))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (b * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.9e+51) || !(x <= 2300000000.0)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (b * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.9e+51) or not (x <= 2300000000.0): tmp = x * 2.0 else: tmp = 27.0 * (b * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= -2.9e+51) || !(x <= 2300000000.0)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(b * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -2.9e+51) || ~((x <= 2300000000.0)))
tmp = x * 2.0;
else
tmp = 27.0 * (b * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -2.9e+51], N[Not[LessEqual[x, 2300000000.0]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+51} \lor \neg \left(x \leq 2300000000\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\
\end{array}
\end{array}
if x < -2.8999999999999998e51 or 2.3e9 < x Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*94.0%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around inf 55.9%
if -2.8999999999999998e51 < x < 2.3e9Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*92.3%
associate-*l*92.5%
Simplified92.5%
+-commutative92.5%
associate-+r-92.5%
*-commutative92.5%
associate-*l*92.4%
associate-*l*93.0%
associate-*r*93.1%
Applied egg-rr93.1%
Taylor expanded in b around inf 49.0%
Final simplification52.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -4.4e+53) (not (<= x 8000000000.0))) (* x 2.0) (* b (* 27.0 a))))
assert(x < y && y < z && z < t && t < a && 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 <= -4.4e+53) || !(x <= 8000000000.0)) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-4.4d+53)) .or. (.not. (x <= 8000000000.0d0))) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -4.4e+53) || !(x <= 8000000000.0)) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 <= -4.4e+53) or not (x <= 8000000000.0): tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= -4.4e+53) || !(x <= 8000000000.0)) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= -4.4e+53) || ~((x <= 8000000000.0)))
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -4.4e+53], N[Not[LessEqual[x, 8000000000.0]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+53} \lor \neg \left(x \leq 8000000000\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if x < -4.39999999999999997e53 or 8e9 < x Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*94.0%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around inf 55.9%
if -4.39999999999999997e53 < x < 8e9Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*92.3%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in x around 0 89.0%
sub-neg89.0%
*-commutative89.0%
associate-*r*89.1%
*-commutative89.1%
distribute-rgt-neg-in89.1%
metadata-eval89.1%
Applied egg-rr89.1%
Taylor expanded in b around inf 49.0%
associate-*r*49.0%
*-commutative49.0%
Simplified49.0%
Final simplification52.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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])){:}
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. 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, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*93.1%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in x around inf 29.9%
Final simplification29.9%
(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 2024027
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))