
(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. 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+244) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -4e+244) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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+244) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -4e+244], 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[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[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^{+244}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -4.0000000000000003e244Initial program 69.9%
+-commutative69.9%
associate-+r-69.9%
*-commutative69.9%
cancel-sign-sub-inv69.9%
associate-*r*75.9%
distribute-lft-neg-in75.9%
*-commutative75.9%
cancel-sign-sub-inv75.9%
associate-+r-75.9%
associate-*l*75.9%
fma-define82.2%
fma-neg82.2%
associate-*l*99.7%
distribute-rgt-neg-in99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
distribute-lft-neg-in99.7%
associate-*r*99.6%
Simplified99.6%
if -4.0000000000000003e244 < (*.f64 y 9) Initial program 93.8%
Final simplification94.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 5e-111) (+ (+ (* y (* z (* t -9.0))) (* x 2.0)) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
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 <= 5e-111) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= 5e-111) tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, 5e-111], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-111}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 5.0000000000000003e-111Initial program 90.0%
sub-neg90.0%
sub-neg90.0%
associate-*l*96.5%
associate-*l*97.0%
Simplified97.0%
sub-neg97.0%
*-commutative97.0%
distribute-rgt-neg-in97.0%
*-commutative97.0%
distribute-lft-neg-in97.0%
metadata-eval97.0%
associate-*l*97.0%
associate-*r*96.4%
*-commutative96.4%
Applied egg-rr96.4%
if 5.0000000000000003e-111 < t Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
associate-*r*90.4%
distribute-lft-neg-in90.4%
*-commutative90.4%
cancel-sign-sub-inv90.4%
associate-+r-90.4%
associate-*l*90.4%
fma-define91.7%
cancel-sign-sub-inv91.7%
fma-define91.7%
distribute-lft-neg-in91.7%
distribute-rgt-neg-in91.7%
*-commutative91.7%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Final simplification97.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= z -4e-131)
t_1
(if (<= z 1.65e-180)
(* 27.0 (* a b))
(if (<= z 0.00125) (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -4e-131) {
tmp = t_1;
} else if (z <= 1.65e-180) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00125) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (z <= (-4d-131)) then
tmp = t_1
else if (z <= 1.65d-180) then
tmp = 27.0d0 * (a * b)
else if (z <= 0.00125d0) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -4e-131) {
tmp = t_1;
} else if (z <= 1.65e-180) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00125) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if z <= -4e-131: tmp = t_1 elif z <= 1.65e-180: tmp = 27.0 * (a * b) elif z <= 0.00125: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -4e-131) tmp = t_1; elseif (z <= 1.65e-180) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 0.00125) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -4e-131)
tmp = t_1;
elseif (z <= 1.65e-180)
tmp = 27.0 * (a * b);
elseif (z <= 0.00125)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-131], t$95$1, If[LessEqual[z, 1.65e-180], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00125], N[(x * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-180}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 0.00125:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.9999999999999999e-131 or 0.00125000000000000003 < z Initial program 89.0%
sub-neg89.0%
sub-neg89.0%
associate-*l*93.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in y around inf 48.6%
if -3.9999999999999999e-131 < z < 1.64999999999999999e-180Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 53.9%
if 1.64999999999999999e-180 < z < 0.00125000000000000003Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.7%
Final simplification50.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.8e-131)
(* -9.0 (* z (* y t)))
(if (<= z 8.5e-177)
(* 27.0 (* a b))
(if (<= z 32.0) (* x 2.0) (* -9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-131) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 8.5e-177) {
tmp = 27.0 * (a * b);
} else if (z <= 32.0) {
tmp = x * 2.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.
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.8d-131)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 8.5d-177) then
tmp = 27.0d0 * (a * b)
else if (z <= 32.0d0) then
tmp = x * 2.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;
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.8e-131) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 8.5e-177) {
tmp = 27.0 * (a * b);
} else if (z <= 32.0) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.8e-131: tmp = -9.0 * (z * (y * t)) elif z <= 8.5e-177: tmp = 27.0 * (a * b) elif z <= 32.0: tmp = x * 2.0 else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.8e-131) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 8.5e-177) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 32.0) tmp = Float64(x * 2.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])){:}
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.8e-131)
tmp = -9.0 * (z * (y * t));
elseif (z <= 8.5e-177)
tmp = 27.0 * (a * b);
elseif (z <= 32.0)
tmp = x * 2.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. 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.8e-131], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-177], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 32.0], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-131}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-177}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 32:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -5.8000000000000004e-131Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 46.6%
pow146.6%
*-commutative46.6%
associate-*l*47.6%
Applied egg-rr47.6%
unpow147.6%
associate-*r*46.6%
*-commutative46.6%
associate-*r*49.6%
Simplified49.6%
if -5.8000000000000004e-131 < z < 8.4999999999999993e-177Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 54.6%
if 8.4999999999999993e-177 < z < 32Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 52.1%
if 32 < z Initial program 87.4%
sub-neg87.4%
sub-neg87.4%
associate-*l*95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in y around inf 53.2%
Final simplification52.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.8e-131)
(* -9.0 (* z (* y t)))
(if (<= z 3.1e-178)
(* 27.0 (* a b))
(if (<= z 0.00075) (* x 2.0) (* t (* z (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-131) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.1e-178) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00075) {
tmp = 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.
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.8d-131)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 3.1d-178) then
tmp = 27.0d0 * (a * b)
else if (z <= 0.00075d0) then
tmp = 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;
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.8e-131) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.1e-178) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00075) {
tmp = 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]) [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.8e-131: tmp = -9.0 * (z * (y * t)) elif z <= 3.1e-178: tmp = 27.0 * (a * b) elif z <= 0.00075: tmp = 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]) 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.8e-131) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 3.1e-178) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 0.00075) tmp = 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])){:}
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.8e-131)
tmp = -9.0 * (z * (y * t));
elseif (z <= 3.1e-178)
tmp = 27.0 * (a * b);
elseif (z <= 0.00075)
tmp = 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. 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.8e-131], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-178], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00075], N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-131}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-178}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 0.00075:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -5.8000000000000004e-131Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 46.6%
pow146.6%
*-commutative46.6%
associate-*l*47.6%
Applied egg-rr47.6%
unpow147.6%
associate-*r*46.6%
*-commutative46.6%
associate-*r*49.6%
Simplified49.6%
if -5.8000000000000004e-131 < z < 3.1e-178Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 54.6%
if 3.1e-178 < z < 7.5000000000000002e-4Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.7%
if 7.5000000000000002e-4 < z Initial program 87.6%
sub-neg87.6%
sub-neg87.6%
associate-*l*95.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around inf 52.4%
*-commutative52.4%
associate-*l*52.5%
*-commutative52.5%
associate-*l*52.5%
Simplified52.5%
Final simplification51.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.5e-131)
(* y (* z (* t -9.0)))
(if (<= z 1e-176)
(* 27.0 (* a b))
(if (<= z 0.00074) (* x 2.0) (* t (* z (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e-131) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1e-176) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00074) {
tmp = 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.
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-131)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 1d-176) then
tmp = 27.0d0 * (a * b)
else if (z <= 0.00074d0) then
tmp = 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;
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-131) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1e-176) {
tmp = 27.0 * (a * b);
} else if (z <= 0.00074) {
tmp = 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]) [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-131: tmp = y * (z * (t * -9.0)) elif z <= 1e-176: tmp = 27.0 * (a * b) elif z <= 0.00074: tmp = 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]) 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-131) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 1e-176) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 0.00074) tmp = 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])){:}
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-131)
tmp = y * (z * (t * -9.0));
elseif (z <= 1e-176)
tmp = 27.0 * (a * b);
elseif (z <= 0.00074)
tmp = 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. 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.5e-131], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-176], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00074], N[(x * 2.0), $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])\\\\
[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^{-131}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 10^{-176}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 0.00074:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -5.4999999999999997e-131Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 46.6%
pow146.6%
*-commutative46.6%
associate-*l*47.6%
Applied egg-rr47.6%
unpow147.6%
associate-*r*46.6%
*-commutative46.6%
associate-*r*49.6%
Simplified49.6%
Taylor expanded in t around 0 46.6%
associate-*r*46.5%
associate-*r*49.6%
*-commutative49.6%
associate-*l*47.6%
*-commutative47.6%
Simplified47.6%
if -5.4999999999999997e-131 < z < 1e-176Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*98.4%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 54.6%
if 1e-176 < z < 7.3999999999999999e-4Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.7%
if 7.3999999999999999e-4 < z Initial program 87.6%
sub-neg87.6%
sub-neg87.6%
associate-*l*95.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around inf 52.4%
*-commutative52.4%
associate-*l*52.5%
*-commutative52.5%
associate-*l*52.5%
Simplified52.5%
Final simplification50.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 3.05e+72) (+ (+ (* y (* z (* t -9.0))) (* x 2.0)) (* a (* 27.0 b))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.05e+72) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 3.05d+72) then
tmp = ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0)) + (a * (27.0d0 * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.05e+72) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 3.05e+72: tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.05e+72) tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 3.05e+72)
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.05e+72], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.05 \cdot 10^{+72}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 3.04999999999999996e72Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*95.2%
associate-*l*95.7%
Simplified95.7%
sub-neg95.7%
*-commutative95.7%
distribute-rgt-neg-in95.7%
*-commutative95.7%
distribute-lft-neg-in95.7%
metadata-eval95.7%
associate-*l*95.6%
associate-*r*95.1%
*-commutative95.1%
Applied egg-rr95.1%
if 3.04999999999999996e72 < z Initial program 85.8%
sub-neg85.8%
sub-neg85.8%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around 0 70.4%
Final simplification90.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1e-196) (+ (+ (* y (* z (* t -9.0))) (* x 2.0)) (* a (* 27.0 b))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* 9.0 (* y z)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e-196) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.
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 <= (-1d-196)) then
tmp = ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0)) + (a * (27.0d0 * b))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (9.0d0 * (y * z))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e-196) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z))));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1e-196: tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b)) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1e-196) tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(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])){:}
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 <= -1e-196)
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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. 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, -1e-196], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-196}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -1e-196Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
sub-neg93.0%
*-commutative93.0%
distribute-rgt-neg-in93.0%
*-commutative93.0%
distribute-lft-neg-in93.0%
metadata-eval93.0%
associate-*l*93.0%
associate-*r*93.0%
*-commutative93.0%
Applied egg-rr93.0%
if -1e-196 < z Initial program 93.2%
Taylor expanded in y around 0 93.2%
Final simplification93.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -5e-193) (+ (+ (* y (* z (* t -9.0))) (* x 2.0)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5e-193) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5d-193)) then
tmp = ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5e-193) {
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5e-193: tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5e-193) tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5e-193)
tmp = ((y * (z * (t * -9.0))) + (x * 2.0)) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5e-193], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-193}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -5.0000000000000005e-193Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
sub-neg93.0%
*-commutative93.0%
distribute-rgt-neg-in93.0%
*-commutative93.0%
distribute-lft-neg-in93.0%
metadata-eval93.0%
associate-*l*93.0%
associate-*r*93.0%
*-commutative93.0%
Applied egg-rr93.0%
if -5.0000000000000005e-193 < z Initial program 93.2%
Final simplification93.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e+135) (not (<= y 1.7e-189))) (- (* x 2.0) (* 9.0 (* t (* y z)))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+135) || !(y <= 1.7e-189)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-3.4d+135)) .or. (.not. (y <= 1.7d-189))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+135) || !(y <= 1.7e-189)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.4e+135) or not (y <= 1.7e-189): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e+135) || !(y <= 1.7e-189)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y <= -3.4e+135) || ~((y <= 1.7e-189)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e+135], N[Not[LessEqual[y, 1.7e-189]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+135} \lor \neg \left(y \leq 1.7 \cdot 10^{-189}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -3.4000000000000001e135 or 1.7000000000000001e-189 < y Initial program 87.5%
sub-neg87.5%
sub-neg87.5%
associate-*l*95.6%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in a around 0 67.5%
if -3.4000000000000001e135 < y < 1.7000000000000001e-189Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around 0 80.7%
Final simplification73.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.8e-131)
(+ (* a (* 27.0 b)) (* -9.0 (* z (* y t))))
(if (<= z 1.55e-80)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-131) {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
} else if (z <= 1.55e-80) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.8d-131)) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (z * (y * t)))
else if (z <= 1.55d-80) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e-131) {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
} else if (z <= 1.55e-80) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.8e-131: tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t))) elif z <= 1.55e-80: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.8e-131) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(z * Float64(y * t)))); elseif (z <= 1.55e-80) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5.8e-131)
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
elseif (z <= 1.55e-80)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.8e-131], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-80], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-131}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-80}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -5.8000000000000004e-131Initial program 89.7%
Taylor expanded in y around 0 89.7%
Taylor expanded in x around 0 73.1%
cancel-sign-sub-inv73.1%
metadata-eval73.1%
associate-*r*73.1%
*-commutative73.1%
associate-*r*73.1%
associate-*r*77.1%
Simplified77.1%
if -5.8000000000000004e-131 < z < 1.55000000000000008e-80Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 90.2%
if 1.55000000000000008e-80 < z Initial program 88.0%
sub-neg88.0%
sub-neg88.0%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around 0 67.2%
Final simplification78.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.5e+75) (not (<= a 6.2e-64))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.5e+75) || !(a <= 6.2e-64)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.5d+75)) .or. (.not. (a <= 6.2d-64))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.5e+75) || !(a <= 6.2e-64)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.5e+75) or not (a <= 6.2e-64): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.5e+75) || !(a <= 6.2e-64)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -2.5e+75) || ~((a <= 6.2e-64)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.5e+75], N[Not[LessEqual[a, 6.2e-64]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+75} \lor \neg \left(a \leq 6.2 \cdot 10^{-64}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -2.5000000000000001e75 or 6.20000000000000049e-64 < a Initial program 89.8%
sub-neg89.8%
sub-neg89.8%
associate-*l*92.1%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in a around inf 59.5%
if -2.5000000000000001e75 < a < 6.20000000000000049e-64Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around inf 38.6%
Final simplification48.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= a -1.75e+75) (* a (* 27.0 b)) (if (<= a 1.15e-62) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.75e+75) {
tmp = a * (27.0 * b);
} else if (a <= 1.15e-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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.75d+75)) then
tmp = a * (27.0d0 * b)
else if (a <= 1.15d-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;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.75e+75) {
tmp = a * (27.0 * b);
} else if (a <= 1.15e-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]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -1.75e+75: tmp = a * (27.0 * b) elif a <= 1.15e-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]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.75e+75) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 1.15e-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])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -1.75e+75)
tmp = a * (27.0 * b);
elseif (a <= 1.15e-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. 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, -1.75e+75], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e-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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{+75}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-62}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.7499999999999999e75Initial program 89.0%
sub-neg89.0%
sub-neg89.0%
associate-*l*93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 67.1%
associate-*r*67.3%
*-commutative67.3%
associate-*r*67.2%
Simplified67.2%
if -1.7499999999999999e75 < a < 1.15e-62Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around inf 38.6%
if 1.15e-62 < a Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*91.5%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around inf 55.2%
Final simplification48.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -2.4e+136) (* y (* z (* t -9.0))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+136) {
tmp = y * (z * (t * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.4d+136)) then
tmp = y * (z * (t * (-9.0d0)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+136) {
tmp = y * (z * (t * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -2.4e+136: tmp = y * (z * (t * -9.0)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.4e+136) tmp = Float64(y * Float64(z * Float64(t * -9.0))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -2.4e+136)
tmp = y * (z * (t * -9.0));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e+136], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+136}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -2.4e136Initial program 71.8%
sub-neg71.8%
sub-neg71.8%
associate-*l*91.1%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around inf 59.3%
pow159.3%
*-commutative59.3%
associate-*l*73.2%
Applied egg-rr73.2%
unpow173.2%
associate-*r*59.3%
*-commutative59.3%
associate-*r*64.9%
Simplified64.9%
Taylor expanded in t around 0 59.3%
associate-*r*59.3%
associate-*r*64.8%
*-commutative64.8%
associate-*l*72.9%
*-commutative72.9%
Simplified72.9%
if -2.4e136 < y Initial program 95.5%
sub-neg95.5%
sub-neg95.5%
associate-*l*95.9%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 70.2%
Final simplification70.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*95.3%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 28.7%
Final simplification28.7%
(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 2024039
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))