
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 1.3e+156) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.3e+156) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (y * z)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1.3e+156) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(t * Float64(Float64(Float64(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * Float64(y * z)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1.3e+156], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 1.30000000000000009e156Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-*r*96.4%
distribute-lft-neg-in96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
associate-+r-96.4%
associate-*l*96.5%
fma-define96.9%
fma-neg96.9%
associate-*l*96.9%
distribute-rgt-neg-in96.9%
*-commutative96.9%
associate-*l*96.8%
*-commutative96.8%
distribute-lft-neg-in96.8%
associate-*r*96.8%
Simplified96.8%
if 1.30000000000000009e156 < t Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*85.2%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in t around inf 99.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 1e-63) (- (+ (* x 2.0) (* b (* a 27.0))) (* y (* 9.0 (* t z)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1e-63) {
tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * (9.0 * (t * z)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1e-63) tmp = Float64(Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))) - Float64(y * Float64(9.0 * Float64(t * z)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1e-63], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-63}:\\
\;\;\;\;\left(x \cdot 2 + b \cdot \left(a \cdot 27\right)\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 1.00000000000000007e-63Initial program 95.8%
+-commutative95.8%
associate-+r-95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-*r*95.9%
distribute-lft-neg-in95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-+r-95.9%
associate-*l*95.9%
fma-define96.5%
cancel-sign-sub-inv96.5%
fma-define96.5%
distribute-lft-neg-in96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
associate-*r*96.4%
associate-*l*96.5%
neg-mul-196.5%
associate-*r*96.5%
Simplified96.5%
fma-undefine95.9%
fma-undefine95.9%
associate-+r+95.9%
*-commutative95.9%
associate-*l*97.0%
*-commutative97.0%
associate-*r*96.9%
*-commutative96.9%
*-commutative96.9%
associate-*r*96.9%
associate-*l*96.9%
metadata-eval96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
*-commutative96.9%
associate-+r+96.9%
sub-neg96.9%
Applied egg-rr96.9%
if 1.00000000000000007e-63 < t Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*96.6%
distribute-lft-neg-in96.6%
*-commutative96.6%
cancel-sign-sub-inv96.6%
associate-+r-96.6%
associate-*l*96.6%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Final simplification97.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -980.0) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* t z)))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -980.0) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-980.0d0)) then
tmp = y * (((2.0d0 * (x / y)) + (27.0d0 * ((a * b) / y))) - (9.0d0 * (t * z)))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -980.0) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -980.0: tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z))) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -980.0) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(t * z)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -980.0)
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -980.0], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $MachinePrecision]), $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[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -980:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\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}
\end{array}
if z < -980Initial program 95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
associate-+l-95.0%
associate-*l*95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in y around inf 81.4%
if -980 < z Initial program 97.8%
Final simplification93.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 1e+193) (- (+ (* x 2.0) (* b (* a 27.0))) (* y (* 9.0 (* t z)))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1e+193) {
tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * (9.0 * (t * z)));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= 1d+193) then
tmp = ((x * 2.0d0) + (b * (a * 27.0d0))) - (y * (9.0d0 * (t * z)))
else
tmp = t * (((2.0d0 * (x / t)) + (27.0d0 * ((a * b) / t))) - (9.0d0 * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1e+193) {
tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * (9.0 * (t * z)));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= 1e+193: tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * (9.0 * (t * z))) else: tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 1e+193) tmp = Float64(Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))) - Float64(y * Float64(9.0 * Float64(t * z)))); else tmp = Float64(t * Float64(Float64(Float64(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= 1e+193)
tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * (9.0 * (t * z)));
else
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 1e+193], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{+193}:\\
\;\;\;\;\left(x \cdot 2 + b \cdot \left(a \cdot 27\right)\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 1.00000000000000007e193Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.1%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*97.3%
associate-*l*97.3%
neg-mul-197.3%
associate-*r*97.3%
Simplified97.3%
fma-undefine96.9%
fma-undefine96.9%
associate-+r+96.9%
*-commutative96.9%
associate-*l*96.5%
*-commutative96.5%
associate-*r*96.4%
*-commutative96.4%
*-commutative96.4%
associate-*r*96.4%
associate-*l*96.4%
metadata-eval96.4%
distribute-lft-neg-in96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-+r+96.4%
sub-neg96.4%
Applied egg-rr96.4%
if 1.00000000000000007e193 < t Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
associate-+l-99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*83.2%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in t around inf 99.9%
Final simplification96.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= (* y 9.0) -2e+271)
(- (+ (* x 2.0) t_1) (* y (* 9.0 (* t z))))
(+ (- (* x 2.0) (* t (* z (* y 9.0)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if ((y * 9.0) <= -2e+271) {
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if ((y * 9.0d0) <= (-2d+271)) then
tmp = ((x * 2.0d0) + t_1) - (y * (9.0d0 * (t * z)))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if ((y * 9.0) <= -2e+271) {
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if (y * 9.0) <= -2e+271: tmp = ((x * 2.0) + t_1) - (y * (9.0 * (t * z))) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (Float64(y * 9.0) <= -2e+271) tmp = Float64(Float64(Float64(x * 2.0) + t_1) - Float64(y * Float64(9.0 * Float64(t * z)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if ((y * 9.0) <= -2e+271)
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (t * z)));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e+271], N[(N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;y \cdot 9 \leq -2 \cdot 10^{+271}:\\
\;\;\;\;\left(x \cdot 2 + t\_1\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -1.99999999999999991e271Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-*r*84.3%
distribute-lft-neg-in84.3%
*-commutative84.3%
cancel-sign-sub-inv84.3%
associate-+r-84.3%
associate-*l*84.6%
fma-define84.6%
cancel-sign-sub-inv84.6%
fma-define84.6%
distribute-lft-neg-in84.6%
distribute-rgt-neg-in84.6%
*-commutative84.6%
associate-*r*100.0%
associate-*l*99.7%
neg-mul-199.7%
associate-*r*99.7%
Simplified99.7%
fma-undefine99.7%
fma-undefine99.7%
associate-+r+99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*100.0%
associate-*l*100.0%
metadata-eval100.0%
distribute-lft-neg-in100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
*-commutative100.0%
associate-+r+100.0%
sub-neg100.0%
Applied egg-rr99.7%
if -1.99999999999999991e271 < (*.f64 y #s(literal 9 binary64)) Initial program 97.1%
Final simplification97.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -4e+257) (+ (- (* x 2.0) (* (* t z) (* y 9.0))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -4e+257) {
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y * 9.0d0) <= (-4d+257)) then
tmp = ((x * 2.0d0) - ((t * z) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -4e+257) {
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y * 9.0) <= -4e+257: tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -4e+257) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + 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(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y * 9.0) <= -4e+257)
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -4e+257], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $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[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -4 \cdot 10^{+257}:\\
\;\;\;\;\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\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(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -4.00000000000000012e257Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*87.6%
associate-+l-87.6%
associate-*l*87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*99.8%
associate-*l*100.0%
Simplified100.0%
if -4.00000000000000012e257 < (*.f64 y #s(literal 9 binary64)) Initial program 97.4%
Final simplification97.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* 9.0 (* t (* y z)))))
(if (<= x -1.3e+55)
(- (* x 2.0) t_2)
(if (<= x 9e+14) (- t_1 t_2) (+ (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (x <= -1.3e+55) {
tmp = (x * 2.0) - t_2;
} else if (x <= 9e+14) {
tmp = t_1 - t_2;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
if (x <= (-1.3d+55)) then
tmp = (x * 2.0d0) - t_2
else if (x <= 9d+14) then
tmp = t_1 - t_2
else
tmp = (x * 2.0d0) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if (x <= -1.3e+55) {
tmp = (x * 2.0) - t_2;
} else if (x <= 9e+14) {
tmp = t_1 - t_2;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) tmp = 0 if x <= -1.3e+55: tmp = (x * 2.0) - t_2 elif x <= 9e+14: tmp = t_1 - t_2 else: tmp = (x * 2.0) + t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (x <= -1.3e+55) tmp = Float64(Float64(x * 2.0) - t_2); elseif (x <= 9e+14) tmp = Float64(t_1 - t_2); else tmp = Float64(Float64(x * 2.0) + t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
tmp = 0.0;
if (x <= -1.3e+55)
tmp = (x * 2.0) - t_2;
elseif (x <= 9e+14)
tmp = t_1 - t_2;
else
tmp = (x * 2.0) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+55], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 9e+14], N[(t$95$1 - t$95$2), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+55}:\\
\;\;\;\;x \cdot 2 - t\_2\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+14}:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\end{array}
\end{array}
if x < -1.3e55Initial program 98.2%
associate-+l-98.2%
*-commutative98.2%
*-commutative98.2%
associate-*l*98.2%
associate-+l-98.2%
associate-*l*98.2%
*-commutative98.2%
*-commutative98.2%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around 0 85.7%
if -1.3e55 < x < 9e14Initial program 95.5%
associate-+l-95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.6%
associate-+l-95.6%
associate-*l*95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in x around 0 85.4%
if 9e14 < x Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.3%
fma-define98.3%
cancel-sign-sub-inv98.3%
fma-define98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in t around 0 85.4%
Final simplification85.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.85e-170)
(* -9.0 (* z (* t y)))
(if (<= t 1.2e-86)
(* x 2.0)
(if (<= t 1.25e+137) (* b (* a 27.0)) (* -9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.85e-170) {
tmp = -9.0 * (z * (t * y));
} else if (t <= 1.2e-86) {
tmp = x * 2.0;
} else if (t <= 1.25e+137) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.85d-170)) then
tmp = (-9.0d0) * (z * (t * y))
else if (t <= 1.2d-86) then
tmp = x * 2.0d0
else if (t <= 1.25d+137) then
tmp = b * (a * 27.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.85e-170) {
tmp = -9.0 * (z * (t * y));
} else if (t <= 1.2e-86) {
tmp = x * 2.0;
} else if (t <= 1.25e+137) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= -2.85e-170: tmp = -9.0 * (z * (t * y)) elif t <= 1.2e-86: tmp = x * 2.0 elif t <= 1.25e+137: tmp = b * (a * 27.0) else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.85e-170) tmp = Float64(-9.0 * Float64(z * Float64(t * y))); elseif (t <= 1.2e-86) tmp = Float64(x * 2.0); elseif (t <= 1.25e+137) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -2.85e-170)
tmp = -9.0 * (z * (t * y));
elseif (t <= 1.2e-86)
tmp = x * 2.0;
elseif (t <= 1.25e+137)
tmp = b * (a * 27.0);
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.85e-170], N[(-9.0 * N[(z * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-86], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.25e+137], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.85 \cdot 10^{-170}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+137}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -2.8500000000000002e-170Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around 0 67.3%
Taylor expanded in t around inf 66.5%
Taylor expanded in a around 0 44.5%
Taylor expanded in t around 0 44.5%
associate-*r*41.8%
*-commutative41.8%
Simplified41.8%
if -2.8500000000000002e-170 < t < 1.20000000000000007e-86Initial program 92.4%
+-commutative92.4%
associate-+r-92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*92.5%
associate-*l*92.6%
neg-mul-192.6%
associate-*r*92.6%
Simplified92.6%
Taylor expanded in t around 0 81.1%
Taylor expanded in x around inf 44.2%
if 1.20000000000000007e-86 < t < 1.25e137Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.3%
fma-define98.3%
cancel-sign-sub-inv98.3%
fma-define98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in a around inf 47.7%
*-commutative47.7%
*-commutative47.7%
associate-*r*47.8%
*-commutative47.8%
Simplified47.8%
if 1.25e137 < t Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*94.5%
fma-define94.5%
cancel-sign-sub-inv94.5%
fma-define94.5%
distribute-lft-neg-in94.5%
distribute-rgt-neg-in94.5%
*-commutative94.5%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around inf 67.3%
Final simplification47.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= t -8.8e-178)
(* -9.0 (* y (* t z)))
(if (<= t 2.1e-86)
(* x 2.0)
(if (<= t 1.3e+137) (* b (* a 27.0)) (* -9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.8e-178) {
tmp = -9.0 * (y * (t * z));
} else if (t <= 2.1e-86) {
tmp = x * 2.0;
} else if (t <= 1.3e+137) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-8.8d-178)) then
tmp = (-9.0d0) * (y * (t * z))
else if (t <= 2.1d-86) then
tmp = x * 2.0d0
else if (t <= 1.3d+137) then
tmp = b * (a * 27.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.8e-178) {
tmp = -9.0 * (y * (t * z));
} else if (t <= 2.1e-86) {
tmp = x * 2.0;
} else if (t <= 1.3e+137) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= -8.8e-178: tmp = -9.0 * (y * (t * z)) elif t <= 2.1e-86: tmp = x * 2.0 elif t <= 1.3e+137: tmp = b * (a * 27.0) else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.8e-178) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (t <= 2.1e-86) tmp = Float64(x * 2.0); elseif (t <= 1.3e+137) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -8.8e-178)
tmp = -9.0 * (y * (t * z));
elseif (t <= 2.1e-86)
tmp = x * 2.0;
elseif (t <= 1.3e+137)
tmp = b * (a * 27.0);
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.8e-178], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-86], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 1.3e+137], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{-178}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+137}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -8.8000000000000005e-178Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-*r*93.3%
distribute-lft-neg-in93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-+r-93.3%
associate-*l*93.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.4%
associate-*r*98.9%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
fma-undefine97.9%
fma-undefine97.9%
associate-+r+97.9%
*-commutative97.9%
associate-*l*95.0%
*-commutative95.0%
associate-*r*95.0%
*-commutative95.0%
*-commutative95.0%
associate-*r*95.0%
associate-*l*95.0%
metadata-eval95.0%
distribute-lft-neg-in95.0%
*-commutative95.0%
distribute-rgt-neg-in95.0%
*-commutative95.0%
associate-+r+95.0%
sub-neg95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 43.6%
*-commutative43.6%
associate-*r*42.8%
*-commutative42.8%
Simplified42.8%
if -8.8000000000000005e-178 < t < 2.1e-86Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*92.3%
associate-*l*92.3%
neg-mul-192.3%
associate-*r*92.3%
Simplified92.3%
Taylor expanded in t around 0 80.5%
Taylor expanded in x around inf 42.4%
if 2.1e-86 < t < 1.3e137Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.3%
fma-define98.3%
cancel-sign-sub-inv98.3%
fma-define98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in a around inf 47.7%
*-commutative47.7%
*-commutative47.7%
associate-*r*47.8%
*-commutative47.8%
Simplified47.8%
if 1.3e137 < t Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*94.5%
fma-define94.5%
cancel-sign-sub-inv94.5%
fma-define94.5%
distribute-lft-neg-in94.5%
distribute-rgt-neg-in94.5%
*-commutative94.5%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around inf 67.3%
Final simplification47.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 8.2e+92) (+ (- (* x 2.0) (* (* t z) (* y 9.0))) (* a (* 27.0 b))) (* t (- (* 27.0 (/ (* a b) t)) (* 9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8.2e+92) {
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 8.2d+92) then
tmp = ((x * 2.0d0) - ((t * z) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = t * ((27.0d0 * ((a * b) / t)) - (9.0d0 * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8.2e+92) {
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 8.2e+92: tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 8.2e+92) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(t * Float64(Float64(27.0 * Float64(Float64(a * b) / t)) - Float64(9.0 * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 8.2e+92)
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 8.2e+92], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.2 \cdot 10^{+92}:\\
\;\;\;\;\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(27 \cdot \frac{a \cdot b}{t} - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 8.20000000000000047e92Initial program 97.9%
associate-+l-97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.9%
associate-+l-97.9%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
if 8.20000000000000047e92 < z Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+l-94.2%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in x around 0 78.9%
Taylor expanded in t around inf 77.1%
Final simplification93.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= a -7.8e+86)
(+ (* x 2.0) t_1)
(if (<= a 490.0) (- (* x 2.0) (* 9.0 (* t (* y z)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (a <= -7.8e+86) {
tmp = (x * 2.0) + t_1;
} else if (a <= 490.0) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (a <= (-7.8d+86)) then
tmp = (x * 2.0d0) + t_1
else if (a <= 490.0d0) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (a <= -7.8e+86) {
tmp = (x * 2.0) + t_1;
} else if (a <= 490.0) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if a <= -7.8e+86: tmp = (x * 2.0) + t_1 elif a <= 490.0: tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (a <= -7.8e+86) tmp = Float64(Float64(x * 2.0) + t_1); elseif (a <= 490.0) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (a <= -7.8e+86)
tmp = (x * 2.0) + t_1;
elseif (a <= 490.0)
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e+86], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 490.0], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{elif}\;a \leq 490:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.8000000000000004e86Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.5%
fma-define95.5%
cancel-sign-sub-inv95.5%
fma-define95.5%
distribute-lft-neg-in95.5%
distribute-rgt-neg-in95.5%
*-commutative95.5%
associate-*r*93.3%
associate-*l*93.3%
neg-mul-193.3%
associate-*r*93.3%
Simplified93.3%
Taylor expanded in t around 0 85.0%
if -7.8000000000000004e86 < a < 490Initial program 98.5%
associate-+l-98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*98.6%
associate-+l-98.6%
associate-*l*98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 84.0%
if 490 < a Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*92.2%
distribute-lft-neg-in92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-+r-92.2%
associate-*l*92.3%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*98.4%
associate-*l*98.4%
neg-mul-198.4%
associate-*r*98.4%
Simplified98.4%
Taylor expanded in a around inf 52.9%
Final simplification76.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= a -2.1e+86)
(+ (* x 2.0) t_1)
(if (<= a 15000.0) (+ (* x 2.0) (* -9.0 (* y (* t z)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (a <= -2.1e+86) {
tmp = (x * 2.0) + t_1;
} else if (a <= 15000.0) {
tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (a <= (-2.1d+86)) then
tmp = (x * 2.0d0) + t_1
else if (a <= 15000.0d0) then
tmp = (x * 2.0d0) + ((-9.0d0) * (y * (t * z)))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (a <= -2.1e+86) {
tmp = (x * 2.0) + t_1;
} else if (a <= 15000.0) {
tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if a <= -2.1e+86: tmp = (x * 2.0) + t_1 elif a <= 15000.0: tmp = (x * 2.0) + (-9.0 * (y * (t * z))) else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (a <= -2.1e+86) tmp = Float64(Float64(x * 2.0) + t_1); elseif (a <= 15000.0) tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(y * Float64(t * z)))); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (a <= -2.1e+86)
tmp = (x * 2.0) + t_1;
elseif (a <= 15000.0)
tmp = (x * 2.0) + (-9.0 * (y * (t * z)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.1e+86], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 15000.0], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{+86}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{elif}\;a \leq 15000:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.0999999999999999e86Initial program 93.3%
+-commutative93.3%
associate-+r-93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.5%
fma-define95.5%
cancel-sign-sub-inv95.5%
fma-define95.5%
distribute-lft-neg-in95.5%
distribute-rgt-neg-in95.5%
*-commutative95.5%
associate-*r*93.3%
associate-*l*93.3%
neg-mul-193.3%
associate-*r*93.3%
Simplified93.3%
Taylor expanded in t around 0 85.0%
if -2.0999999999999999e86 < a < 15000Initial program 98.5%
+-commutative98.5%
associate-+r-98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define98.0%
cancel-sign-sub-inv98.0%
fma-define98.0%
distribute-lft-neg-in98.0%
distribute-rgt-neg-in98.0%
*-commutative98.0%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
fma-undefine98.6%
fma-undefine98.6%
associate-+r+98.6%
*-commutative98.6%
associate-*l*94.8%
*-commutative94.8%
associate-*r*94.8%
*-commutative94.8%
*-commutative94.8%
associate-*r*94.8%
associate-*l*94.8%
metadata-eval94.8%
distribute-lft-neg-in94.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
*-commutative94.8%
associate-+r+94.8%
sub-neg94.8%
Applied egg-rr94.7%
Taylor expanded in b around 0 84.1%
cancel-sign-sub-inv84.1%
metadata-eval84.1%
*-commutative84.1%
associate-*r*80.9%
*-commutative80.9%
Simplified80.9%
if 15000 < a Initial program 96.6%
+-commutative96.6%
associate-+r-96.6%
*-commutative96.6%
cancel-sign-sub-inv96.6%
associate-*r*92.0%
distribute-lft-neg-in92.0%
*-commutative92.0%
cancel-sign-sub-inv92.0%
associate-+r-92.0%
associate-*l*92.1%
fma-define93.8%
cancel-sign-sub-inv93.8%
fma-define93.8%
distribute-lft-neg-in93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
associate-*r*98.4%
associate-*l*98.3%
neg-mul-198.3%
associate-*r*98.3%
Simplified98.3%
Taylor expanded in a around inf 53.8%
Final simplification75.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.25e+103)
(* x 2.0)
(if (<= x 3.5e-5)
(* -9.0 (* t (* y z)))
(if (<= x 1.32e+177) (* 27.0 (* a b)) (* x 2.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e+103) {
tmp = x * 2.0;
} else if (x <= 3.5e-5) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.32e+177) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.25d+103)) then
tmp = x * 2.0d0
else if (x <= 3.5d-5) then
tmp = (-9.0d0) * (t * (y * z))
else if (x <= 1.32d+177) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e+103) {
tmp = x * 2.0;
} else if (x <= 3.5e-5) {
tmp = -9.0 * (t * (y * z));
} else if (x <= 1.32e+177) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -1.25e+103: tmp = x * 2.0 elif x <= 3.5e-5: tmp = -9.0 * (t * (y * z)) elif x <= 1.32e+177: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.25e+103) tmp = Float64(x * 2.0); elseif (x <= 3.5e-5) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (x <= 1.32e+177) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -1.25e+103)
tmp = x * 2.0;
elseif (x <= 3.5e-5)
tmp = -9.0 * (t * (y * z));
elseif (x <= 1.32e+177)
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.25e+103], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 3.5e-5], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.32e+177], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+103}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+177}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.25e103 or 1.3200000000000001e177 < x Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
*-commutative98.4%
cancel-sign-sub-inv98.4%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*96.9%
fma-define96.9%
cancel-sign-sub-inv96.9%
fma-define96.9%
distribute-lft-neg-in96.9%
distribute-rgt-neg-in96.9%
*-commutative96.9%
associate-*r*98.4%
associate-*l*98.4%
neg-mul-198.4%
associate-*r*98.4%
Simplified98.4%
Taylor expanded in t around 0 79.1%
Taylor expanded in x around inf 69.9%
if -1.25e103 < x < 3.4999999999999997e-5Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*95.5%
fma-define96.2%
cancel-sign-sub-inv96.2%
fma-define96.2%
distribute-lft-neg-in96.2%
distribute-rgt-neg-in96.2%
*-commutative96.2%
associate-*r*96.7%
associate-*l*96.7%
neg-mul-196.7%
associate-*r*96.7%
Simplified96.7%
Taylor expanded in t around inf 51.4%
if 3.4999999999999997e-5 < x < 1.3200000000000001e177Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*97.3%
distribute-lft-neg-in97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-+r-97.3%
associate-*l*97.4%
fma-define97.4%
cancel-sign-sub-inv97.4%
fma-define97.4%
distribute-lft-neg-in97.4%
distribute-rgt-neg-in97.4%
*-commutative97.4%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Taylor expanded in a around inf 53.7%
Final simplification56.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2e+15) (* -9.0 (* y (* t z))) (if (<= z 9.5e+77) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e+15) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 9.5e+77) {
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.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2d+15)) then
tmp = (-9.0d0) * (y * (t * z))
else if (z <= 9.5d+77) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e+15) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 9.5e+77) {
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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2e+15: tmp = -9.0 * (y * (t * z)) elif z <= 9.5e+77: 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]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e+15) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (z <= 9.5e+77) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2e+15)
tmp = -9.0 * (y * (t * z));
elseif (z <= 9.5e+77)
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e+15], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+77], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+15}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+77}:\\
\;\;\;\;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 < -2e15Initial program 94.4%
+-commutative94.4%
associate-+r-94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*96.2%
associate-*l*96.3%
neg-mul-196.3%
associate-*r*96.3%
Simplified96.3%
fma-undefine94.5%
fma-undefine94.5%
associate-+r+94.5%
*-commutative94.5%
associate-*l*91.4%
*-commutative91.4%
associate-*r*91.3%
*-commutative91.3%
*-commutative91.3%
associate-*r*91.3%
associate-*l*91.3%
metadata-eval91.3%
distribute-lft-neg-in91.3%
*-commutative91.3%
distribute-rgt-neg-in91.3%
*-commutative91.3%
associate-+r+91.3%
sub-neg91.3%
Applied egg-rr91.3%
Taylor expanded in y around inf 56.4%
*-commutative56.4%
associate-*r*53.1%
*-commutative53.1%
Simplified53.1%
if -2e15 < z < 9.4999999999999998e77Initial program 99.1%
+-commutative99.1%
associate-+r-99.1%
*-commutative99.1%
cancel-sign-sub-inv99.1%
associate-*r*94.7%
distribute-lft-neg-in94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-+r-94.7%
associate-*l*94.7%
fma-define94.7%
cancel-sign-sub-inv94.7%
fma-define94.7%
distribute-lft-neg-in94.7%
distribute-rgt-neg-in94.7%
*-commutative94.7%
associate-*r*99.2%
associate-*l*99.2%
neg-mul-199.2%
associate-*r*99.2%
Simplified99.2%
Taylor expanded in t around 0 77.7%
if 9.4999999999999998e77 < z Initial program 94.6%
+-commutative94.6%
associate-+r-94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define98.0%
cancel-sign-sub-inv98.0%
fma-define98.0%
distribute-lft-neg-in98.0%
distribute-rgt-neg-in98.0%
*-commutative98.0%
associate-*r*94.7%
associate-*l*94.7%
neg-mul-194.7%
associate-*r*94.7%
Simplified94.7%
Taylor expanded in t around inf 57.5%
Final simplification68.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.5e+78) (not (<= a 1.4e-62))) (* b (* a 27.0)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e+78) || !(a <= 1.4e-62)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6.5d+78)) .or. (.not. (a <= 1.4d-62))) then
tmp = b * (a * 27.0d0)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e+78) || !(a <= 1.4e-62)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.5e+78) or not (a <= 1.4e-62): tmp = b * (a * 27.0) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.5e+78) || !(a <= 1.4e-62)) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -6.5e+78) || ~((a <= 1.4e-62)))
tmp = b * (a * 27.0);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.5e+78], N[Not[LessEqual[a, 1.4e-62]], $MachinePrecision]], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+78} \lor \neg \left(a \leq 1.4 \cdot 10^{-62}\right):\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -6.50000000000000036e78 or 1.40000000000000001e-62 < a Initial program 95.7%
+-commutative95.7%
associate-+r-95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.3%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
distribute-lft-neg-in95.1%
distribute-rgt-neg-in95.1%
*-commutative95.1%
associate-*r*96.6%
associate-*l*96.6%
neg-mul-196.6%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in a around inf 53.7%
*-commutative53.7%
*-commutative53.7%
associate-*r*53.7%
*-commutative53.7%
Simplified53.7%
if -6.50000000000000036e78 < a < 1.40000000000000001e-62Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
*-commutative98.4%
cancel-sign-sub-inv98.4%
associate-*r*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-+r-97.8%
associate-*l*97.8%
fma-define97.8%
cancel-sign-sub-inv97.8%
fma-define97.8%
distribute-lft-neg-in97.8%
distribute-rgt-neg-in97.8%
*-commutative97.8%
associate-*r*98.4%
associate-*l*98.5%
neg-mul-198.5%
associate-*r*98.5%
Simplified98.5%
Taylor expanded in t around 0 55.4%
Taylor expanded in x around inf 41.7%
Final simplification47.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.5e+78) (not (<= a 1e-70))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+78) || !(a <= 1e-70)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8.5d+78)) .or. (.not. (a <= 1d-70))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+78) || !(a <= 1e-70)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.5e+78) or not (a <= 1e-70): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.5e+78) || !(a <= 1e-70)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -8.5e+78) || ~((a <= 1e-70)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.5e+78], N[Not[LessEqual[a, 1e-70]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+78} \lor \neg \left(a \leq 10^{-70}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -8.50000000000000079e78 or 9.99999999999999996e-71 < a Initial program 95.7%
+-commutative95.7%
associate-+r-95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-*r*94.3%
distribute-lft-neg-in94.3%
*-commutative94.3%
cancel-sign-sub-inv94.3%
associate-+r-94.3%
associate-*l*94.3%
fma-define95.2%
cancel-sign-sub-inv95.2%
fma-define95.2%
distribute-lft-neg-in95.2%
distribute-rgt-neg-in95.2%
*-commutative95.2%
associate-*r*96.6%
associate-*l*96.7%
neg-mul-196.7%
associate-*r*96.7%
Simplified96.7%
Taylor expanded in a around inf 53.3%
if -8.50000000000000079e78 < a < 9.99999999999999996e-71Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
*-commutative98.4%
cancel-sign-sub-inv98.4%
associate-*r*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-+r-97.8%
associate-*l*97.8%
fma-define97.8%
cancel-sign-sub-inv97.8%
fma-define97.8%
distribute-lft-neg-in97.8%
distribute-rgt-neg-in97.8%
*-commutative97.8%
associate-*r*98.4%
associate-*l*98.5%
neg-mul-198.5%
associate-*r*98.5%
Simplified98.5%
Taylor expanded in t around 0 55.0%
Taylor expanded in x around inf 41.3%
Final simplification47.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= a -9.2e+79) (* a (* 27.0 b)) (if (<= a 1.5e-62) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e+79) {
tmp = a * (27.0 * b);
} else if (a <= 1.5e-62) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-9.2d+79)) then
tmp = a * (27.0d0 * b)
else if (a <= 1.5d-62) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e+79) {
tmp = a * (27.0 * b);
} else if (a <= 1.5e-62) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -9.2e+79: tmp = a * (27.0 * b) elif a <= 1.5e-62: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.2e+79) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 1.5e-62) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -9.2e+79)
tmp = a * (27.0 * b);
elseif (a <= 1.5e-62)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.2e+79], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e-62], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+79}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-62}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -9.2000000000000002e79Initial program 93.8%
+-commutative93.8%
associate-+r-93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-*r*95.8%
distribute-lft-neg-in95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-+r-95.8%
associate-*l*95.8%
fma-define95.9%
cancel-sign-sub-inv95.9%
fma-define95.9%
distribute-lft-neg-in95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*r*93.9%
associate-*l*93.9%
neg-mul-193.9%
associate-*r*93.9%
Simplified93.9%
Taylor expanded in t around 0 80.2%
Taylor expanded in a around inf 80.3%
Taylor expanded in x around 0 62.1%
if -9.2000000000000002e79 < a < 1.5000000000000001e-62Initial program 98.4%
+-commutative98.4%
associate-+r-98.4%
*-commutative98.4%
cancel-sign-sub-inv98.4%
associate-*r*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-+r-97.8%
associate-*l*97.8%
fma-define97.8%
cancel-sign-sub-inv97.8%
fma-define97.8%
distribute-lft-neg-in97.8%
distribute-rgt-neg-in97.8%
*-commutative97.8%
associate-*r*98.4%
associate-*l*98.5%
neg-mul-198.5%
associate-*r*98.5%
Simplified98.5%
Taylor expanded in t around 0 55.4%
Taylor expanded in x around inf 41.7%
if 1.5000000000000001e-62 < a Initial program 97.0%
+-commutative97.0%
associate-+r-97.0%
*-commutative97.0%
cancel-sign-sub-inv97.0%
associate-*r*93.1%
distribute-lft-neg-in93.1%
*-commutative93.1%
cancel-sign-sub-inv93.1%
associate-+r-93.1%
associate-*l*93.2%
fma-define94.6%
cancel-sign-sub-inv94.6%
fma-define94.6%
distribute-lft-neg-in94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*r*98.5%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Taylor expanded in a around inf 47.9%
Final simplification47.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.1%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*97.6%
associate-*l*97.6%
neg-mul-197.6%
associate-*r*97.6%
Simplified97.6%
Taylor expanded in t around 0 63.4%
Taylor expanded in x around inf 31.4%
Final simplification31.4%
(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 2024130
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))