
(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 16 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 7.5e-39)
(+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b)))
(*
z
(- (+ (* 2.0 (/ x z)) (* 27.0 (* b (* a (/ 1.0 z))))) (* 9.0 (* t 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 <= 7.5e-39) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * (b * (a * (1.0 / z))))) - (9.0 * (t * 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 <= 7.5d-39) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
else
tmp = z * (((2.0d0 * (x / z)) + (27.0d0 * (b * (a * (1.0d0 / z))))) - (9.0d0 * (t * 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 <= 7.5e-39) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * (b * (a * (1.0 / z))))) - (9.0 * (t * 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 <= 7.5e-39: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) else: tmp = z * (((2.0 * (x / z)) + (27.0 * (b * (a * (1.0 / z))))) - (9.0 * (t * 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 <= 7.5e-39) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(b * Float64(a * Float64(1.0 / z))))) - Float64(9.0 * Float64(t * 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 <= 7.5e-39)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
else
tmp = z * (((2.0 * (x / z)) + (27.0 * (b * (a * (1.0 / z))))) - (9.0 * (t * 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, 7.5e-39], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(b * N[(a * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * 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}\;z \leq 7.5 \cdot 10^{-39}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \left(b \cdot \left(a \cdot \frac{1}{z}\right)\right)\right) - 9 \cdot \left(t \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 7.49999999999999971e-39Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*97.8%
associate-*l*97.8%
Simplified97.8%
if 7.49999999999999971e-39 < z Initial program 86.1%
sub-neg86.1%
sub-neg86.1%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in z around inf 96.9%
div-inv96.8%
*-commutative96.8%
associate-*l*97.8%
Applied egg-rr97.8%
Final simplification97.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 (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* -9.0 z))))))
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 fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (-9.0 * z)))));
}
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 fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(-9.0 * z))))) 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(-9.0 * z), $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])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(-9 \cdot z\right)\right)\right)\right)
\end{array}
Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*94.9%
associate-*l*94.9%
neg-mul-194.9%
associate-*r*94.9%
Simplified94.9%
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 (* b (* a 27.0))) (t_2 (* z (* y (* t -9.0)))))
(if (<= z -3.7e-20)
t_2
(if (<= z -1.35e-74)
t_1
(if (<= z -1.05e-99)
(* -9.0 (* t (* y z)))
(if (<= z -1.85e-249)
(* x 2.0)
(if (<= z 1.85e-159) t_1 (if (<= z 4.9e-66) (* x 2.0) t_2))))))))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 = b * (a * 27.0);
double t_2 = z * (y * (t * -9.0));
double tmp;
if (z <= -3.7e-20) {
tmp = t_2;
} else if (z <= -1.35e-74) {
tmp = t_1;
} else if (z <= -1.05e-99) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -1.85e-249) {
tmp = x * 2.0;
} else if (z <= 1.85e-159) {
tmp = t_1;
} else if (z <= 4.9e-66) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = b * (a * 27.0d0)
t_2 = z * (y * (t * (-9.0d0)))
if (z <= (-3.7d-20)) then
tmp = t_2
else if (z <= (-1.35d-74)) then
tmp = t_1
else if (z <= (-1.05d-99)) then
tmp = (-9.0d0) * (t * (y * z))
else if (z <= (-1.85d-249)) then
tmp = x * 2.0d0
else if (z <= 1.85d-159) then
tmp = t_1
else if (z <= 4.9d-66) then
tmp = x * 2.0d0
else
tmp = t_2
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 = b * (a * 27.0);
double t_2 = z * (y * (t * -9.0));
double tmp;
if (z <= -3.7e-20) {
tmp = t_2;
} else if (z <= -1.35e-74) {
tmp = t_1;
} else if (z <= -1.05e-99) {
tmp = -9.0 * (t * (y * z));
} else if (z <= -1.85e-249) {
tmp = x * 2.0;
} else if (z <= 1.85e-159) {
tmp = t_1;
} else if (z <= 4.9e-66) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
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 = b * (a * 27.0) t_2 = z * (y * (t * -9.0)) tmp = 0 if z <= -3.7e-20: tmp = t_2 elif z <= -1.35e-74: tmp = t_1 elif z <= -1.05e-99: tmp = -9.0 * (t * (y * z)) elif z <= -1.85e-249: tmp = x * 2.0 elif z <= 1.85e-159: tmp = t_1 elif z <= 4.9e-66: tmp = x * 2.0 else: tmp = t_2 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(b * Float64(a * 27.0)) t_2 = Float64(z * Float64(y * Float64(t * -9.0))) tmp = 0.0 if (z <= -3.7e-20) tmp = t_2; elseif (z <= -1.35e-74) tmp = t_1; elseif (z <= -1.05e-99) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (z <= -1.85e-249) tmp = Float64(x * 2.0); elseif (z <= 1.85e-159) tmp = t_1; elseif (z <= 4.9e-66) tmp = Float64(x * 2.0); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
t_2 = z * (y * (t * -9.0));
tmp = 0.0;
if (z <= -3.7e-20)
tmp = t_2;
elseif (z <= -1.35e-74)
tmp = t_1;
elseif (z <= -1.05e-99)
tmp = -9.0 * (t * (y * z));
elseif (z <= -1.85e-249)
tmp = x * 2.0;
elseif (z <= 1.85e-159)
tmp = t_1;
elseif (z <= 4.9e-66)
tmp = x * 2.0;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-20], t$95$2, If[LessEqual[z, -1.35e-74], t$95$1, If[LessEqual[z, -1.05e-99], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.85e-249], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.85e-159], t$95$1, If[LessEqual[z, 4.9e-66], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]
\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 := b \cdot \left(a \cdot 27\right)\\
t_2 := z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-99}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-249}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-66}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.7000000000000001e-20 or 4.9000000000000001e-66 < z Initial program 89.5%
sub-neg89.5%
sub-neg89.5%
associate-*l*90.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in z around inf 96.3%
Taylor expanded in z around inf 60.2%
associate-*r*60.1%
*-commutative60.1%
Simplified60.1%
if -3.7000000000000001e-20 < z < -1.35000000000000009e-74 or -1.84999999999999988e-249 < z < 1.8499999999999999e-159Initial program 99.2%
sub-neg99.2%
sub-neg99.2%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 52.9%
associate-*r*53.0%
Simplified53.0%
if -1.35000000000000009e-74 < z < -1.04999999999999992e-99Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around inf 26.5%
if -1.04999999999999992e-99 < z < -1.84999999999999988e-249 or 1.8499999999999999e-159 < z < 4.9000000000000001e-66Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 53.6%
Final simplification56.2%
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 (* b (* a 27.0))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= z -2.8e-20)
t_2
(if (<= z -1.9e-70)
t_1
(if (<= z -3.3e-99)
t_2
(if (<= z -3e-249)
(* x 2.0)
(if (<= z 4.6e-159) t_1 (if (<= z 2.85e-66) (* x 2.0) t_2))))))))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 = b * (a * 27.0);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -2.8e-20) {
tmp = t_2;
} else if (z <= -1.9e-70) {
tmp = t_1;
} else if (z <= -3.3e-99) {
tmp = t_2;
} else if (z <= -3e-249) {
tmp = x * 2.0;
} else if (z <= 4.6e-159) {
tmp = t_1;
} else if (z <= 2.85e-66) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = b * (a * 27.0d0)
t_2 = (-9.0d0) * (t * (y * z))
if (z <= (-2.8d-20)) then
tmp = t_2
else if (z <= (-1.9d-70)) then
tmp = t_1
else if (z <= (-3.3d-99)) then
tmp = t_2
else if (z <= (-3d-249)) then
tmp = x * 2.0d0
else if (z <= 4.6d-159) then
tmp = t_1
else if (z <= 2.85d-66) then
tmp = x * 2.0d0
else
tmp = t_2
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 = b * (a * 27.0);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -2.8e-20) {
tmp = t_2;
} else if (z <= -1.9e-70) {
tmp = t_1;
} else if (z <= -3.3e-99) {
tmp = t_2;
} else if (z <= -3e-249) {
tmp = x * 2.0;
} else if (z <= 4.6e-159) {
tmp = t_1;
} else if (z <= 2.85e-66) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
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 = b * (a * 27.0) t_2 = -9.0 * (t * (y * z)) tmp = 0 if z <= -2.8e-20: tmp = t_2 elif z <= -1.9e-70: tmp = t_1 elif z <= -3.3e-99: tmp = t_2 elif z <= -3e-249: tmp = x * 2.0 elif z <= 4.6e-159: tmp = t_1 elif z <= 2.85e-66: tmp = x * 2.0 else: tmp = t_2 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(b * Float64(a * 27.0)) t_2 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -2.8e-20) tmp = t_2; elseif (z <= -1.9e-70) tmp = t_1; elseif (z <= -3.3e-99) tmp = t_2; elseif (z <= -3e-249) tmp = Float64(x * 2.0); elseif (z <= 4.6e-159) tmp = t_1; elseif (z <= 2.85e-66) tmp = Float64(x * 2.0); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
t_2 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -2.8e-20)
tmp = t_2;
elseif (z <= -1.9e-70)
tmp = t_1;
elseif (z <= -3.3e-99)
tmp = t_2;
elseif (z <= -3e-249)
tmp = x * 2.0;
elseif (z <= 4.6e-159)
tmp = t_1;
elseif (z <= 2.85e-66)
tmp = x * 2.0;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-20], t$95$2, If[LessEqual[z, -1.9e-70], t$95$1, If[LessEqual[z, -3.3e-99], t$95$2, If[LessEqual[z, -3e-249], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.6e-159], t$95$1, If[LessEqual[z, 2.85e-66], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]
\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 := b \cdot \left(a \cdot 27\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-249}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-66}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.8000000000000003e-20 or -1.8999999999999999e-70 < z < -3.29999999999999986e-99 or 2.84999999999999981e-66 < z Initial program 89.5%
sub-neg89.5%
sub-neg89.5%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 53.7%
if -2.8000000000000003e-20 < z < -1.8999999999999999e-70 or -3.00000000000000004e-249 < z < 4.59999999999999957e-159Initial program 99.2%
sub-neg99.2%
sub-neg99.2%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 53.9%
associate-*r*54.0%
Simplified54.0%
if -3.29999999999999986e-99 < z < -3.00000000000000004e-249 or 4.59999999999999957e-159 < z < 2.84999999999999981e-66Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 53.6%
Final simplification53.7%
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 -2.2e-22)
(- (* x 2.0) (* 9.0 (* y (* t z))))
(if (<= z -7e-74)
(* b (+ (* 2.0 (/ x b)) (* a 27.0)))
(if (or (<= z -4.9e-118) (not (<= z 64.0)))
(- (* 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);
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-22) {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
} else if (z <= -7e-74) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if ((z <= -4.9e-118) || !(z <= 64.0)) {
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.
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-22)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (t * z)))
else if (z <= (-7d-74)) then
tmp = b * ((2.0d0 * (x / b)) + (a * 27.0d0))
else if ((z <= (-4.9d-118)) .or. (.not. (z <= 64.0d0))) 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;
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-22) {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
} else if (z <= -7e-74) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if ((z <= -4.9e-118) || !(z <= 64.0)) {
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]) [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-22: tmp = (x * 2.0) - (9.0 * (y * (t * z))) elif z <= -7e-74: tmp = b * ((2.0 * (x / b)) + (a * 27.0)) elif (z <= -4.9e-118) or not (z <= 64.0): 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]) 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-22) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))); elseif (z <= -7e-74) tmp = Float64(b * Float64(Float64(2.0 * Float64(x / b)) + Float64(a * 27.0))); elseif ((z <= -4.9e-118) || !(z <= 64.0)) 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])){:}
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-22)
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
elseif (z <= -7e-74)
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
elseif ((z <= -4.9e-118) || ~((z <= 64.0)))
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. 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-22], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-74], N[(b * N[(N[(2.0 * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.9e-118], N[Not[LessEqual[z, 64.0]], $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])\\\\
[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^{-22}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-74}:\\
\;\;\;\;b \cdot \left(2 \cdot \frac{x}{b} + a \cdot 27\right)\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-118} \lor \neg \left(z \leq 64\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.2000000000000001e-22Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around 0 67.3%
sub-neg67.3%
*-commutative67.3%
associate-*r*67.3%
Applied egg-rr67.3%
unsub-neg67.3%
*-commutative67.3%
associate-*l*67.3%
*-commutative67.3%
associate-*r*67.3%
Applied egg-rr67.3%
if -2.2000000000000001e-22 < z < -7.00000000000000029e-74Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 90.5%
Taylor expanded in t around 0 71.6%
associate-*r/61.9%
Simplified61.9%
Taylor expanded in b around inf 71.4%
if -7.00000000000000029e-74 < z < -4.8999999999999998e-118 or 64 < z Initial program 86.1%
sub-neg86.1%
sub-neg86.1%
associate-*l*87.4%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in a around 0 73.2%
if -4.8999999999999998e-118 < z < 64Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 87.7%
Final simplification77.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 (- (* x 2.0) (* 9.0 (* t (* y z))))))
(if (<= z -2.6e-20)
t_1
(if (<= z -9.2e-72)
(* b (+ (* 2.0 (/ x b)) (* a 27.0)))
(if (or (<= z -1.02e-117) (not (<= z 0.082)))
t_1
(+ (* x 2.0) (* 27.0 (* a b))))))))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) - (9.0 * (t * (y * z)));
double tmp;
if (z <= -2.6e-20) {
tmp = t_1;
} else if (z <= -9.2e-72) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if ((z <= -1.02e-117) || !(z <= 0.082)) {
tmp = t_1;
} 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.
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 = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
if (z <= (-2.6d-20)) then
tmp = t_1
else if (z <= (-9.2d-72)) then
tmp = b * ((2.0d0 * (x / b)) + (a * 27.0d0))
else if ((z <= (-1.02d-117)) .or. (.not. (z <= 0.082d0))) then
tmp = t_1
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;
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) - (9.0 * (t * (y * z)));
double tmp;
if (z <= -2.6e-20) {
tmp = t_1;
} else if (z <= -9.2e-72) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if ((z <= -1.02e-117) || !(z <= 0.082)) {
tmp = t_1;
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
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) - (9.0 * (t * (y * z))) tmp = 0 if z <= -2.6e-20: tmp = t_1 elif z <= -9.2e-72: tmp = b * ((2.0 * (x / b)) + (a * 27.0)) elif (z <= -1.02e-117) or not (z <= 0.082): tmp = t_1 else: tmp = (x * 2.0) + (27.0 * (a * b)) 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(9.0 * Float64(t * Float64(y * z)))) tmp = 0.0 if (z <= -2.6e-20) tmp = t_1; elseif (z <= -9.2e-72) tmp = Float64(b * Float64(Float64(2.0 * Float64(x / b)) + Float64(a * 27.0))); elseif ((z <= -1.02e-117) || !(z <= 0.082)) tmp = t_1; 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])){:}
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) - (9.0 * (t * (y * z)));
tmp = 0.0;
if (z <= -2.6e-20)
tmp = t_1;
elseif (z <= -9.2e-72)
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
elseif ((z <= -1.02e-117) || ~((z <= 0.082)))
tmp = t_1;
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.
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[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-20], t$95$1, If[LessEqual[z, -9.2e-72], N[(b * N[(N[(2.0 * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.02e-117], N[Not[LessEqual[z, 0.082]], $MachinePrecision]], t$95$1, 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-72}:\\
\;\;\;\;b \cdot \left(2 \cdot \frac{x}{b} + a \cdot 27\right)\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-117} \lor \neg \left(z \leq 0.082\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -2.59999999999999995e-20 or -9.19999999999999978e-72 < z < -1.01999999999999993e-117 or 0.0820000000000000034 < z Initial program 89.1%
sub-neg89.1%
sub-neg89.1%
associate-*l*90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 70.9%
if -2.59999999999999995e-20 < z < -9.19999999999999978e-72Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 89.5%
Taylor expanded in t around 0 68.4%
associate-*r/57.6%
Simplified57.6%
Taylor expanded in b around inf 78.8%
if -1.01999999999999993e-117 < z < 0.0820000000000000034Initial program 99.5%
sub-neg99.5%
sub-neg99.5%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 88.5%
Final simplification78.4%
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 (* 27.0 (* a b))) (t_2 (* 9.0 (* t (* y z)))))
(if (<= z -2.3e+58)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* t z))))
(if (<= z -6e-98)
(- t_1 t_2)
(if (<= z 110.0) (+ (* x 2.0) t_1) (- (* x 2.0) t_2))))))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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (z <= -2.3e+58) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (t * z)));
} else if (z <= -6e-98) {
tmp = t_1 - t_2;
} else if (z <= 110.0) {
tmp = (x * 2.0) + t_1;
} else {
tmp = (x * 2.0) - t_2;
}
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 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
if (z <= (-2.3d+58)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (t * z)))
else if (z <= (-6d-98)) then
tmp = t_1 - t_2
else if (z <= 110.0d0) then
tmp = (x * 2.0d0) + t_1
else
tmp = (x * 2.0d0) - t_2
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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (z <= -2.3e+58) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (t * z)));
} else if (z <= -6e-98) {
tmp = t_1 - t_2;
} else if (z <= 110.0) {
tmp = (x * 2.0) + t_1;
} else {
tmp = (x * 2.0) - t_2;
}
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 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) tmp = 0 if z <= -2.3e+58: tmp = y * ((2.0 * (x / y)) - (9.0 * (t * z))) elif z <= -6e-98: tmp = t_1 - t_2 elif z <= 110.0: tmp = (x * 2.0) + t_1 else: tmp = (x * 2.0) - t_2 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(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -2.3e+58) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(t * z)))); elseif (z <= -6e-98) tmp = Float64(t_1 - t_2); elseif (z <= 110.0) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(Float64(x * 2.0) - t_2); 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 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -2.3e+58)
tmp = y * ((2.0 * (x / y)) - (9.0 * (t * z)));
elseif (z <= -6e-98)
tmp = t_1 - t_2;
elseif (z <= 110.0)
tmp = (x * 2.0) + t_1;
else
tmp = (x * 2.0) - 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.
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, -2.3e+58], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e-98], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[z, 110.0], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+58}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-98}:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{elif}\;z \leq 110:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_2\\
\end{array}
\end{array}
if z < -2.30000000000000002e58Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*93.1%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around 0 73.0%
Taylor expanded in y around inf 71.4%
if -2.30000000000000002e58 < z < -6e-98Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.7%
if -6e-98 < z < 110Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 86.9%
if 110 < z Initial program 84.6%
sub-neg84.6%
sub-neg84.6%
associate-*l*84.5%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in a around 0 74.8%
Final simplification80.2%
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 (<= a -3.8e+124)
(not (or (<= a -7.5e+78) (and (not (<= a -1.1e-34)) (<= a 2.7e-74)))))
(* a (* 27.0 b))
(* 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 tmp;
if ((a <= -3.8e+124) || !((a <= -7.5e+78) || (!(a <= -1.1e-34) && (a <= 2.7e-74)))) {
tmp = a * (27.0 * 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.
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 <= (-3.8d+124)) .or. (.not. (a <= (-7.5d+78)) .or. (.not. (a <= (-1.1d-34))) .and. (a <= 2.7d-74))) then
tmp = a * (27.0d0 * b)
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 tmp;
if ((a <= -3.8e+124) || !((a <= -7.5e+78) || (!(a <= -1.1e-34) && (a <= 2.7e-74)))) {
tmp = a * (27.0 * b);
} 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): tmp = 0 if (a <= -3.8e+124) or not ((a <= -7.5e+78) or (not (a <= -1.1e-34) and (a <= 2.7e-74))): tmp = a * (27.0 * b) 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) tmp = 0.0 if ((a <= -3.8e+124) || !((a <= -7.5e+78) || (!(a <= -1.1e-34) && (a <= 2.7e-74)))) tmp = Float64(a * Float64(27.0 * 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])){:}
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 <= -3.8e+124) || ~(((a <= -7.5e+78) || (~((a <= -1.1e-34)) && (a <= 2.7e-74)))))
tmp = a * (27.0 * 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. 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, -3.8e+124], N[Not[Or[LessEqual[a, -7.5e+78], And[N[Not[LessEqual[a, -1.1e-34]], $MachinePrecision], LessEqual[a, 2.7e-74]]]], $MachinePrecision]], N[(a * N[(27.0 * 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+124} \lor \neg \left(a \leq -7.5 \cdot 10^{+78} \lor \neg \left(a \leq -1.1 \cdot 10^{-34}\right) \land a \leq 2.7 \cdot 10^{-74}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.7999999999999998e124 or -7.49999999999999934e78 < a < -1.0999999999999999e-34 or 2.70000000000000018e-74 < a Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around inf 50.2%
associate-*r*50.2%
*-commutative50.2%
associate-*r*50.3%
Simplified50.3%
if -3.7999999999999998e124 < a < -7.49999999999999934e78 or -1.0999999999999999e-34 < a < 2.70000000000000018e-74Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in x around inf 40.5%
Final simplification46.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 (<= a -3.8e+124)
(not
(or (<= a -2.05e+77) (and (not (<= a -1.6e-34)) (<= a 2.7e-74)))))
(* 27.0 (* a b))
(* 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 tmp;
if ((a <= -3.8e+124) || !((a <= -2.05e+77) || (!(a <= -1.6e-34) && (a <= 2.7e-74)))) {
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.
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 <= (-3.8d+124)) .or. (.not. (a <= (-2.05d+77)) .or. (.not. (a <= (-1.6d-34))) .and. (a <= 2.7d-74))) 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;
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 <= -3.8e+124) || !((a <= -2.05e+77) || (!(a <= -1.6e-34) && (a <= 2.7e-74)))) {
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]) [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 <= -3.8e+124) or not ((a <= -2.05e+77) or (not (a <= -1.6e-34) and (a <= 2.7e-74))): 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]) 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 <= -3.8e+124) || !((a <= -2.05e+77) || (!(a <= -1.6e-34) && (a <= 2.7e-74)))) 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])){:}
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 <= -3.8e+124) || ~(((a <= -2.05e+77) || (~((a <= -1.6e-34)) && (a <= 2.7e-74)))))
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. 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, -3.8e+124], N[Not[Or[LessEqual[a, -2.05e+77], And[N[Not[LessEqual[a, -1.6e-34]], $MachinePrecision], LessEqual[a, 2.7e-74]]]], $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+124} \lor \neg \left(a \leq -2.05 \cdot 10^{+77} \lor \neg \left(a \leq -1.6 \cdot 10^{-34}\right) \land a \leq 2.7 \cdot 10^{-74}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.7999999999999998e124 or -2.05e77 < a < -1.60000000000000001e-34 or 2.70000000000000018e-74 < a Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around inf 50.2%
if -3.7999999999999998e124 < a < -2.05e77 or -1.60000000000000001e-34 < a < 2.70000000000000018e-74Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in x around inf 40.5%
Final simplification46.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 (* b (* a 27.0))))
(if (<= a -3.8e+124)
t_1
(if (<= a -2.05e+79)
(* x 2.0)
(if (<= a -1.3e-34)
t_1
(if (<= a 3e-74) (* x 2.0) (* a (* 27.0 b))))))))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 = b * (a * 27.0);
double tmp;
if (a <= -3.8e+124) {
tmp = t_1;
} else if (a <= -2.05e+79) {
tmp = x * 2.0;
} else if (a <= -1.3e-34) {
tmp = t_1;
} else if (a <= 3e-74) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
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 = b * (a * 27.0d0)
if (a <= (-3.8d+124)) then
tmp = t_1
else if (a <= (-2.05d+79)) then
tmp = x * 2.0d0
else if (a <= (-1.3d-34)) then
tmp = t_1
else if (a <= 3d-74) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
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 = b * (a * 27.0);
double tmp;
if (a <= -3.8e+124) {
tmp = t_1;
} else if (a <= -2.05e+79) {
tmp = x * 2.0;
} else if (a <= -1.3e-34) {
tmp = t_1;
} else if (a <= 3e-74) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
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 = b * (a * 27.0) tmp = 0 if a <= -3.8e+124: tmp = t_1 elif a <= -2.05e+79: tmp = x * 2.0 elif a <= -1.3e-34: tmp = t_1 elif a <= 3e-74: tmp = x * 2.0 else: tmp = a * (27.0 * b) 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(b * Float64(a * 27.0)) tmp = 0.0 if (a <= -3.8e+124) tmp = t_1; elseif (a <= -2.05e+79) tmp = Float64(x * 2.0); elseif (a <= -1.3e-34) tmp = t_1; elseif (a <= 3e-74) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); 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 = b * (a * 27.0);
tmp = 0.0;
if (a <= -3.8e+124)
tmp = t_1;
elseif (a <= -2.05e+79)
tmp = x * 2.0;
elseif (a <= -1.3e-34)
tmp = t_1;
elseif (a <= 3e-74)
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e+124], t$95$1, If[LessEqual[a, -2.05e+79], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -1.3e-34], t$95$1, If[LessEqual[a, 3e-74], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{+79}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-74}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -3.7999999999999998e124 or -2.05e79 < a < -1.3e-34Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in a around inf 58.7%
associate-*r*58.8%
Simplified58.8%
if -3.7999999999999998e124 < a < -2.05e79 or -1.3e-34 < a < 3.00000000000000007e-74Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in x around inf 40.5%
if 3.00000000000000007e-74 < a Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 45.3%
associate-*r*45.3%
*-commutative45.3%
associate-*r*45.4%
Simplified45.4%
Final simplification46.2%
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 3.5e-98)
(+ (- (* x 2.0) (* (* y 9.0) (* t z))) t_1)
(+ t_1 (- (* x 2.0) (* 9.0 (* z (* t 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 <= 3.5e-98) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + t_1;
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (t * 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 <= 3.5d-98) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + t_1
else
tmp = t_1 + ((x * 2.0d0) - (9.0d0 * (z * (t * 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 <= 3.5e-98) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + t_1;
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (t * 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 <= 3.5e-98: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + t_1 else: tmp = t_1 + ((x * 2.0) - (9.0 * (z * (t * 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 <= 3.5e-98) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + t_1); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(t * 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 <= 3.5e-98)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + t_1;
else
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (t * 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, 3.5e-98], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(t * y), $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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 3.5 \cdot 10^{-98}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.5000000000000002e-98Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*97.6%
associate-*l*97.7%
Simplified97.7%
if 3.5000000000000002e-98 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in y around 0 88.1%
associate-*r*96.2%
Simplified96.2%
Final simplification97.2%
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 (<= t 4.6e+213) (+ (* a (* 27.0 b)) (- (* x 2.0) (* 9.0 (* z (* t y))))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
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 (t <= 4.6e+213) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (t * y))));
} 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.
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 (t <= 4.6d+213) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - (9.0d0 * (z * (t * y))))
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;
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 (t <= 4.6e+213) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (t * y))));
} 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]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= 4.6e+213: tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (t * y)))) 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]) 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 (t <= 4.6e+213) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(t * y))))); 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])){:}
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 (t <= 4.6e+213)
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (t * y))));
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. 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[t, 4.6e+213], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.6 \cdot 10^{+213}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 4.59999999999999996e213Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in y around 0 94.0%
associate-*r*96.9%
Simplified96.9%
if 4.59999999999999996e213 < t Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in a around 0 90.3%
Final simplification96.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
(if (<= z -2.2e-98)
(* z (- (* 27.0 (/ (* a b) z)) (* 9.0 (* t y))))
(if (<= z 28.0)
(+ (* 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);
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-98) {
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (t * y)));
} else if (z <= 28.0) {
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.
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-98)) then
tmp = z * ((27.0d0 * ((a * b) / z)) - (9.0d0 * (t * y)))
else if (z <= 28.0d0) 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;
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-98) {
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (t * y)));
} else if (z <= 28.0) {
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]) [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-98: tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (t * y))) elif z <= 28.0: 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]) 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-98) tmp = Float64(z * Float64(Float64(27.0 * Float64(Float64(a * b) / z)) - Float64(9.0 * Float64(t * y)))); elseif (z <= 28.0) 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])){:}
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-98)
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (t * y)));
elseif (z <= 28.0)
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. 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-98], N[(z * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 28.0], 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])\\\\
[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^{-98}:\\
\;\;\;\;z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 28:\\
\;\;\;\;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.19999999999999996e-98Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in z around inf 95.1%
Taylor expanded in x around 0 85.8%
if -2.19999999999999996e-98 < z < 28Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 86.8%
if 28 < z Initial program 84.6%
sub-neg84.6%
sub-neg84.6%
associate-*l*84.5%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in a around 0 74.8%
Final simplification83.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 -7.5e-5)
(* z (* y (* t -9.0)))
(if (<= z 54000000.0)
(+ (* x 2.0) (* 27.0 (* a b)))
(* -9.0 (* t (* y z))))))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 <= -7.5e-5) {
tmp = z * (y * (t * -9.0));
} else if (z <= 54000000.0) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-7.5d-5)) then
tmp = z * (y * (t * (-9.0d0)))
else if (z <= 54000000.0d0) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-9.0d0) * (t * (y * z))
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 <= -7.5e-5) {
tmp = z * (y * (t * -9.0));
} else if (z <= 54000000.0) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
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 <= -7.5e-5: tmp = z * (y * (t * -9.0)) elif z <= 54000000.0: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -9.0 * (t * (y * z)) 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 <= -7.5e-5) tmp = Float64(z * Float64(y * Float64(t * -9.0))); elseif (z <= 54000000.0) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -7.5e-5)
tmp = z * (y * (t * -9.0));
elseif (z <= 54000000.0)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e-5], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 54000000.0], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-5}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 54000000:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -7.49999999999999934e-5Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*93.7%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in z around inf 96.7%
Taylor expanded in z around inf 64.7%
associate-*r*64.6%
*-commutative64.6%
Simplified64.6%
if -7.49999999999999934e-5 < z < 5.4e7Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 85.1%
if 5.4e7 < z Initial program 84.1%
sub-neg84.1%
sub-neg84.1%
associate-*l*84.0%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in y around inf 56.4%
Final simplification73.2%
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) (* t (* z (* y 9.0)))) (* b (* a 27.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) - (t * (z * (y * 9.0)))) + (b * (a * 27.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) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.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) - (t * (z * (y * 9.0)))) + (b * (a * 27.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) - (t * (z * (y * 9.0)))) + (b * (a * 27.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(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.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) - (t * (z * (y * 9.0)))) + (b * (a * 27.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[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)
\end{array}
Initial program 93.7%
Final simplification93.7%
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 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 30.0%
Final simplification30.0%
(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 2024089
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))