
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 4.5e-108) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* z y))))))
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 <= 4.5e-108) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
}
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 <= 4.5d-108) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = t * (((2.0d0 * (x / t)) + (27.0d0 * ((a * b) / t))) - (9.0d0 * (z * y)))
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 <= 4.5e-108) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
}
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 <= 4.5e-108: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y))) 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 <= 4.5e-108) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.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(z * y)))); 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 <= 4.5e-108)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.5e-108], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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[(z * y), $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 4.5 \cdot 10^{-108}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 4.4999999999999997e-108Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
associate-*r*90.2%
distribute-lft-neg-in90.2%
*-commutative90.2%
cancel-sign-sub-inv90.2%
associate-+r-90.2%
associate-*l*91.3%
fma-define91.3%
cancel-sign-sub-inv91.3%
fma-define91.3%
distribute-lft-neg-in91.3%
distribute-rgt-neg-in91.3%
*-commutative91.3%
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*97.8%
*-commutative97.8%
associate-*r*97.3%
*-commutative97.3%
associate-*r*96.1%
*-commutative96.1%
associate-*l*97.3%
Applied egg-rr97.3%
if 4.4999999999999997e-108 < z Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in t around inf 85.8%
Final simplification93.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -4.3e+15)
(* -9.0 (* z (* y t)))
(if (<= z -7.5e-246)
t_1
(if (<= z 1.7e-135)
(* x 2.0)
(if (<= z 2.02e-72) t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4.3e+15) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -7.5e-246) {
tmp = t_1;
} else if (z <= 1.7e-135) {
tmp = x * 2.0;
} else if (z <= 2.02e-72) {
tmp = t_1;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-4.3d+15)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-7.5d-246)) then
tmp = t_1
else if (z <= 1.7d-135) then
tmp = x * 2.0d0
else if (z <= 2.02d-72) then
tmp = t_1
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4.3e+15) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -7.5e-246) {
tmp = t_1;
} else if (z <= 1.7e-135) {
tmp = x * 2.0;
} else if (z <= 2.02e-72) {
tmp = t_1;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -4.3e+15: tmp = -9.0 * (z * (y * t)) elif z <= -7.5e-246: tmp = t_1 elif z <= 1.7e-135: tmp = x * 2.0 elif z <= 2.02e-72: tmp = t_1 else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -4.3e+15) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -7.5e-246) tmp = t_1; elseif (z <= 1.7e-135) tmp = Float64(x * 2.0); elseif (z <= 2.02e-72) tmp = t_1; else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -4.3e+15)
tmp = -9.0 * (z * (y * t));
elseif (z <= -7.5e-246)
tmp = t_1;
elseif (z <= 1.7e-135)
tmp = x * 2.0;
elseif (z <= 2.02e-72)
tmp = t_1;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+15], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-246], t$95$1, If[LessEqual[z, 1.7e-135], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.02e-72], t$95$1, N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+15}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-246}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-135}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.02 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.3e15Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around inf 48.6%
*-commutative48.6%
associate-*r*48.7%
Simplified48.7%
if -4.3e15 < z < -7.50000000000000049e-246 or 1.69999999999999995e-135 < z < 2.02e-72Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*96.5%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in a around inf 51.4%
if -7.50000000000000049e-246 < z < 1.69999999999999995e-135Initial 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 49.8%
if 2.02e-72 < z Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in y around inf 48.8%
*-commutative48.8%
associate-*r*48.8%
associate-*r*48.8%
Simplified48.8%
Final simplification49.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3e-172)
(* 27.0 (* a b))
(if (<= b 1.06e-259)
(* x 2.0)
(if (<= b 6.2e-24)
(* t (* z (* y -9.0)))
(if (<= b 6.5e+108) (* x 2.0) (* b (* 27.0 a)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 1.06e-259) {
tmp = x * 2.0;
} else if (b <= 6.2e-24) {
tmp = t * (z * (y * -9.0));
} else if (b <= 6.5e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3d-172)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.06d-259) then
tmp = x * 2.0d0
else if (b <= 6.2d-24) then
tmp = t * (z * (y * (-9.0d0)))
else if (b <= 6.5d+108) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 1.06e-259) {
tmp = x * 2.0;
} else if (b <= 6.2e-24) {
tmp = t * (z * (y * -9.0));
} else if (b <= 6.5e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3e-172: tmp = 27.0 * (a * b) elif b <= 1.06e-259: tmp = x * 2.0 elif b <= 6.2e-24: tmp = t * (z * (y * -9.0)) elif b <= 6.5e+108: tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3e-172) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.06e-259) tmp = Float64(x * 2.0); elseif (b <= 6.2e-24) tmp = Float64(t * Float64(z * Float64(y * -9.0))); elseif (b <= 6.5e+108) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3e-172)
tmp = 27.0 * (a * b);
elseif (b <= 1.06e-259)
tmp = x * 2.0;
elseif (b <= 6.2e-24)
tmp = t * (z * (y * -9.0));
elseif (b <= 6.5e+108)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3e-172], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.06e-259], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.2e-24], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+108], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{-172}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.06 \cdot 10^{-259}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-24}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+108}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -2.99999999999999984e-172Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 49.5%
if -2.99999999999999984e-172 < b < 1.06e-259 or 6.2000000000000001e-24 < b < 6.4999999999999996e108Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*93.4%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 46.0%
if 1.06e-259 < b < 6.2000000000000001e-24Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 56.3%
*-commutative56.3%
associate-*r*56.2%
associate-*r*56.2%
Simplified56.2%
Taylor expanded in y around 0 56.2%
*-commutative56.2%
*-commutative56.2%
associate-*l*56.3%
Simplified56.3%
if 6.4999999999999996e108 < b Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 69.6%
associate-*r*69.7%
Simplified69.7%
Final simplification53.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 (<= b -3e-172)
(* 27.0 (* a b))
(if (<= b 1.45e-261)
(* x 2.0)
(if (<= b 4.1e-24)
(* t (* y (* z -9.0)))
(if (<= b 1.1e+109) (* x 2.0) (* b (* 27.0 a)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 1.45e-261) {
tmp = x * 2.0;
} else if (b <= 4.1e-24) {
tmp = t * (y * (z * -9.0));
} else if (b <= 1.1e+109) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3d-172)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.45d-261) then
tmp = x * 2.0d0
else if (b <= 4.1d-24) then
tmp = t * (y * (z * (-9.0d0)))
else if (b <= 1.1d+109) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 1.45e-261) {
tmp = x * 2.0;
} else if (b <= 4.1e-24) {
tmp = t * (y * (z * -9.0));
} else if (b <= 1.1e+109) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3e-172: tmp = 27.0 * (a * b) elif b <= 1.45e-261: tmp = x * 2.0 elif b <= 4.1e-24: tmp = t * (y * (z * -9.0)) elif b <= 1.1e+109: tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3e-172) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.45e-261) tmp = Float64(x * 2.0); elseif (b <= 4.1e-24) tmp = Float64(t * Float64(y * Float64(z * -9.0))); elseif (b <= 1.1e+109) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3e-172)
tmp = 27.0 * (a * b);
elseif (b <= 1.45e-261)
tmp = x * 2.0;
elseif (b <= 4.1e-24)
tmp = t * (y * (z * -9.0));
elseif (b <= 1.1e+109)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3e-172], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e-261], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.1e-24], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+109], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{-172}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-261}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{-24}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+109}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -2.99999999999999984e-172Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 49.5%
if -2.99999999999999984e-172 < b < 1.44999999999999993e-261 or 4.10000000000000015e-24 < b < 1.1e109Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*93.4%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 46.0%
if 1.44999999999999993e-261 < b < 4.10000000000000015e-24Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 56.3%
*-commutative56.3%
associate-*r*56.2%
associate-*r*56.2%
Simplified56.2%
if 1.1e109 < b Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 69.6%
associate-*r*69.7%
Simplified69.7%
Final simplification53.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 (<= b -3e-172)
(* 27.0 (* a b))
(if (<= b 7e-268)
(* x 2.0)
(if (<= b 2.65e-24)
(* -9.0 (* t (* z y)))
(if (<= b 6.5e+108) (* x 2.0) (* b (* 27.0 a)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 7e-268) {
tmp = x * 2.0;
} else if (b <= 2.65e-24) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 6.5e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3d-172)) then
tmp = 27.0d0 * (a * b)
else if (b <= 7d-268) then
tmp = x * 2.0d0
else if (b <= 2.65d-24) then
tmp = (-9.0d0) * (t * (z * y))
else if (b <= 6.5d+108) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 7e-268) {
tmp = x * 2.0;
} else if (b <= 2.65e-24) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 6.5e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3e-172: tmp = 27.0 * (a * b) elif b <= 7e-268: tmp = x * 2.0 elif b <= 2.65e-24: tmp = -9.0 * (t * (z * y)) elif b <= 6.5e+108: tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3e-172) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 7e-268) tmp = Float64(x * 2.0); elseif (b <= 2.65e-24) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (b <= 6.5e+108) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3e-172)
tmp = 27.0 * (a * b);
elseif (b <= 7e-268)
tmp = x * 2.0;
elseif (b <= 2.65e-24)
tmp = -9.0 * (t * (z * y));
elseif (b <= 6.5e+108)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3e-172], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-268], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.65e-24], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+108], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{-172}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-268}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.65 \cdot 10^{-24}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+108}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -2.99999999999999984e-172Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 49.5%
if -2.99999999999999984e-172 < b < 7.00000000000000011e-268 or 2.64999999999999984e-24 < b < 6.4999999999999996e108Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*93.4%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 46.0%
if 7.00000000000000011e-268 < b < 2.64999999999999984e-24Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 56.3%
if 6.4999999999999996e108 < b Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 69.6%
associate-*r*69.7%
Simplified69.7%
Final simplification53.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -7.5e-53)
(+ (* y (* z (* t -9.0))) t_1)
(if (<= z 4.3e-131)
(+ (* 27.0 (* a b)) (* x 2.0))
(* t (+ (/ t_1 t) (* z (* y -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -7.5e-53) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 4.3e-131) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * ((t_1 / t) + (z * (y * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-7.5d-53)) then
tmp = (y * (z * (t * (-9.0d0)))) + t_1
else if (z <= 4.3d-131) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t * ((t_1 / t) + (z * (y * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -7.5e-53) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 4.3e-131) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * ((t_1 / t) + (z * (y * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -7.5e-53: tmp = (y * (z * (t * -9.0))) + t_1 elif z <= 4.3e-131: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t * ((t_1 / t) + (z * (y * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -7.5e-53) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + t_1); elseif (z <= 4.3e-131) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t * Float64(Float64(t_1 / t) + Float64(z * Float64(y * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -7.5e-53)
tmp = (y * (z * (t * -9.0))) + t_1;
elseif (z <= 4.3e-131)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t * ((t_1 / t) + (z * (y * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e-53], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 4.3e-131], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(t$95$1 / t), $MachinePrecision] + N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-53}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + t\_1\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-131}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{t\_1}{t} + z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -7.5000000000000001e-53Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 79.9%
cancel-sign-sub-inv79.9%
metadata-eval79.9%
*-commutative79.9%
associate-*r*80.0%
+-commutative80.0%
associate-*r*79.9%
*-commutative79.9%
associate-*r*79.9%
associate-*r*77.4%
*-commutative77.4%
associate-*l*77.4%
Applied egg-rr77.4%
if -7.5000000000000001e-53 < z < 4.30000000000000019e-131Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*98.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 82.3%
if 4.30000000000000019e-131 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*91.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around inf 71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
associate-*r/71.3%
*-commutative71.3%
associate-*r*71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
Final simplification76.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 (or (<= z -5.5e+23) (not (<= z 4.2e-131))) (+ (* a (* 27.0 b)) (* -9.0 (* z (* y t)))) (+ (* 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 ((z <= -5.5e+23) || !(z <= 4.2e-131)) {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (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 ((z <= (-5.5d+23)) .or. (.not. (z <= 4.2d-131))) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (z * (y * t)))
else
tmp = (27.0d0 * (a * b)) + (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 ((z <= -5.5e+23) || !(z <= 4.2e-131)) {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (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 (z <= -5.5e+23) or not (z <= 4.2e-131): tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t))) else: tmp = (27.0 * (a * b)) + (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 ((z <= -5.5e+23) || !(z <= 4.2e-131)) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + 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 ((z <= -5.5e+23) || ~((z <= 4.2e-131)))
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
else
tmp = (27.0 * (a * b)) + (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[z, -5.5e+23], N[Not[LessEqual[z, 4.2e-131]], $MachinePrecision]], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+23} \lor \neg \left(z \leq 4.2 \cdot 10^{-131}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -5.50000000000000004e23 or 4.19999999999999994e-131 < z Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*92.7%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 78.2%
cancel-sign-sub-inv78.2%
metadata-eval78.2%
*-commutative78.2%
associate-*r*77.1%
+-commutative77.1%
associate-*r*78.2%
*-commutative78.2%
associate-*r*77.6%
associate-*r*74.8%
*-commutative74.8%
associate-*l*74.8%
Applied egg-rr74.8%
Taylor expanded in y around 0 78.2%
associate-*r*77.1%
Simplified77.1%
if -5.50000000000000004e23 < z < 4.19999999999999994e-131Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in y around 0 81.8%
Final simplification78.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -1.15e-52)
(+ (* y (* z (* t -9.0))) (* a (* 27.0 b)))
(if (<= z 3.6e-132) (+ t_1 (* x 2.0)) (- t_1 (* 9.0 (* t (* z y))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -1.15e-52) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 3.6e-132) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-1.15d-52)) then
tmp = (y * (z * (t * (-9.0d0)))) + (a * (27.0d0 * b))
else if (z <= 3.6d-132) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -1.15e-52) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else if (z <= 3.6e-132) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -1.15e-52: tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b)) elif z <= 3.6e-132: tmp = t_1 + (x * 2.0) else: tmp = t_1 - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -1.15e-52) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b))); elseif (z <= 3.6e-132) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -1.15e-52)
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
elseif (z <= 3.6e-132)
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-52], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-132], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-52}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-132}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.14999999999999997e-52Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 79.9%
cancel-sign-sub-inv79.9%
metadata-eval79.9%
*-commutative79.9%
associate-*r*80.0%
+-commutative80.0%
associate-*r*79.9%
*-commutative79.9%
associate-*r*79.9%
associate-*r*77.4%
*-commutative77.4%
associate-*l*77.4%
Applied egg-rr77.4%
if -1.14999999999999997e-52 < z < 3.60000000000000007e-132Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*98.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 82.3%
if 3.60000000000000007e-132 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*91.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 75.0%
Final simplification78.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -1.85e-49)
(+ (* y (* z (* t -9.0))) t_1)
(if (<= z 1.3e-132)
(+ (* 27.0 (* a b)) (* x 2.0))
(+ t_1 (* -9.0 (* z (* y t))))))))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 <= -1.85e-49) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 1.3e-132) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t_1 + (-9.0 * (z * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-1.85d-49)) then
tmp = (y * (z * (t * (-9.0d0)))) + t_1
else if (z <= 1.3d-132) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t_1 + ((-9.0d0) * (z * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.85e-49) {
tmp = (y * (z * (t * -9.0))) + t_1;
} else if (z <= 1.3e-132) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t_1 + (-9.0 * (z * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.85e-49: tmp = (y * (z * (t * -9.0))) + t_1 elif z <= 1.3e-132: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t_1 + (-9.0 * (z * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.85e-49) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + t_1); elseif (z <= 1.3e-132) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t_1 + Float64(-9.0 * Float64(z * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.85e-49)
tmp = (y * (z * (t * -9.0))) + t_1;
elseif (z <= 1.3e-132)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t_1 + (-9.0 * (z * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e-49], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1.3e-132], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{-49}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-132}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -1.85e-49Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 79.9%
cancel-sign-sub-inv79.9%
metadata-eval79.9%
*-commutative79.9%
associate-*r*80.0%
+-commutative80.0%
associate-*r*79.9%
*-commutative79.9%
associate-*r*79.9%
associate-*r*77.4%
*-commutative77.4%
associate-*l*77.4%
Applied egg-rr77.4%
if -1.85e-49 < z < 1.3e-132Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*98.1%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 82.3%
if 1.3e-132 < z Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*91.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 75.0%
cancel-sign-sub-inv75.0%
metadata-eval75.0%
*-commutative75.0%
associate-*r*73.1%
+-commutative73.1%
associate-*r*75.0%
*-commutative75.0%
associate-*r*74.0%
associate-*r*71.3%
*-commutative71.3%
associate-*l*71.2%
Applied egg-rr71.2%
Taylor expanded in y around 0 74.9%
associate-*r*73.1%
Simplified73.1%
Final simplification77.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 (<= z 4.6e+74) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (* t (+ (/ (* a (* 27.0 b)) t) (* z (* y -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.6e+74) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((a * (27.0 * b)) / t) + (z * (y * -9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 4.6d+74) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = t * (((a * (27.0d0 * b)) / t) + (z * (y * (-9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.6e+74) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((a * (27.0 * b)) / t) + (z * (y * -9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 4.6e+74: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = t * (((a * (27.0 * b)) / t) + (z * (y * -9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4.6e+74) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(t * Float64(Float64(Float64(a * Float64(27.0 * b)) / t) + Float64(z * Float64(y * -9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 4.6e+74)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = t * (((a * (27.0 * b)) / t) + (z * (y * -9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.6e+74], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(z * N[(y * -9.0), $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 4.6 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \left(27 \cdot b\right)}{t} + z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < 4.5999999999999997e74Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
associate-*r*91.2%
distribute-lft-neg-in91.2%
*-commutative91.2%
cancel-sign-sub-inv91.2%
associate-+r-91.2%
associate-*l*92.1%
fma-define92.1%
cancel-sign-sub-inv92.1%
fma-define92.1%
distribute-lft-neg-in92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
associate-*r*98.3%
associate-*l*98.3%
neg-mul-198.3%
associate-*r*98.3%
Simplified98.3%
fma-undefine98.3%
fma-undefine98.3%
associate-+r+98.3%
*-commutative98.3%
associate-*l*97.3%
*-commutative97.3%
associate-*r*96.8%
*-commutative96.8%
associate-*r*95.9%
*-commutative95.9%
associate-*l*96.9%
Applied egg-rr96.9%
if 4.5999999999999997e74 < z Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*88.0%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in x around 0 84.9%
Taylor expanded in t around inf 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
associate-*r/83.1%
*-commutative83.1%
associate-*r*83.1%
*-commutative83.1%
associate-*r*83.1%
Simplified83.1%
Final simplification94.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.15e+27)
(* -9.0 (* z (* y t)))
(if (<= z 1.75e-72)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.15e+27) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.75e-72) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.15d+27)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.75d-72) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.15e+27) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.75e-72) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.15e+27: tmp = -9.0 * (z * (y * t)) elif z <= 1.75e-72: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.15e+27) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.75e-72) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.15e+27)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.75e-72)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.15e+27], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-72], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+27}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-72}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.15e27Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.2%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in y around inf 48.6%
*-commutative48.6%
associate-*r*48.6%
Simplified48.6%
if -1.15e27 < z < 1.75e-72Initial program 98.1%
sub-neg98.1%
sub-neg98.1%
associate-*l*97.7%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in y around 0 80.2%
if 1.75e-72 < z Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in a around 0 69.5%
Final simplification69.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 (<= z -5.2e+32)
(* -9.0 (* z (* y t)))
(if (<= z 3.45e+100)
(+ (* 27.0 (* a b)) (* x 2.0))
(* t (* z (* y -9.0))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e+32) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.45e+100) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.2d+32)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 3.45d+100) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e+32) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.45e+100) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.2e+32: tmp = -9.0 * (z * (y * t)) elif z <= 3.45e+100: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.2e+32) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 3.45e+100) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5.2e+32)
tmp = -9.0 * (z * (y * t));
elseif (z <= 3.45e+100)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.2e+32], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.45e+100], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+32}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{+100}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -5.2000000000000004e32Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.2%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in y around inf 48.6%
*-commutative48.6%
associate-*r*48.6%
Simplified48.6%
if -5.2000000000000004e32 < z < 3.45e100Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*95.1%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in y around 0 76.3%
if 3.45e100 < z Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 60.6%
*-commutative60.6%
associate-*r*60.6%
associate-*r*60.6%
Simplified60.6%
Taylor expanded in y around 0 60.6%
*-commutative60.6%
*-commutative60.6%
associate-*l*60.6%
Simplified60.6%
Final simplification67.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -3e-172) (not (<= b 6.5e+108))) (* 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 ((b <= -3e-172) || !(b <= 6.5e+108)) {
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 ((b <= (-3d-172)) .or. (.not. (b <= 6.5d+108))) 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 ((b <= -3e-172) || !(b <= 6.5e+108)) {
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 (b <= -3e-172) or not (b <= 6.5e+108): 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 ((b <= -3e-172) || !(b <= 6.5e+108)) 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 ((b <= -3e-172) || ~((b <= 6.5e+108)))
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[b, -3e-172], N[Not[LessEqual[b, 6.5e+108]], $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}\;b \leq -3 \cdot 10^{-172} \lor \neg \left(b \leq 6.5 \cdot 10^{+108}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -2.99999999999999984e-172 or 6.4999999999999996e108 < b Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 55.6%
if -2.99999999999999984e-172 < b < 6.4999999999999996e108Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*93.5%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around inf 38.0%
Final simplification48.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 (<= b -3e-172) (* 27.0 (* a b)) (if (<= b 6.8e+108) (* x 2.0) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 6.8e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3d-172)) then
tmp = 27.0d0 * (a * b)
else if (b <= 6.8d+108) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3e-172) {
tmp = 27.0 * (a * b);
} else if (b <= 6.8e+108) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3e-172: tmp = 27.0 * (a * b) elif b <= 6.8e+108: tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3e-172) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 6.8e+108) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3e-172)
tmp = 27.0 * (a * b);
elseif (b <= 6.8e+108)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3e-172], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.8e+108], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{-172}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{+108}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -2.99999999999999984e-172Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 49.5%
if -2.99999999999999984e-172 < b < 6.79999999999999992e108Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*93.5%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around inf 38.0%
if 6.79999999999999992e108 < b Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 69.6%
associate-*r*69.7%
Simplified69.7%
Final simplification48.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 (* 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%
sub-neg97.1%
sub-neg97.1%
associate-*l*94.8%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 28.4%
Final simplification28.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 2024137
(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)))