
(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 13 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
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 1e+253)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -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 t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+253) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -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) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 1e+253) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -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_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+253], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -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}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 10^{+253}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 9.9999999999999994e252Initial program 96.2%
if 9.9999999999999994e252 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 73.1%
+-commutative73.1%
associate-+r-73.1%
*-commutative73.1%
cancel-sign-sub-inv73.1%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.7%
fma-define99.7%
fma-neg99.7%
associate-*l*99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
associate-*r*99.9%
Simplified99.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -1e+82)
(* a (* 27.0 b))
(if (<= t_1 -2e-103)
(* -9.0 (* t (* y z)))
(if (<= t_1 4e+106) (* 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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+82) {
tmp = a * (27.0 * b);
} else if (t_1 <= -2e-103) {
tmp = -9.0 * (t * (y * z));
} else if (t_1 <= 4e+106) {
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 = (a * 27.0d0) * b
if (t_1 <= (-1d+82)) then
tmp = a * (27.0d0 * b)
else if (t_1 <= (-2d-103)) then
tmp = (-9.0d0) * (t * (y * z))
else if (t_1 <= 4d+106) 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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -1e+82) {
tmp = a * (27.0 * b);
} else if (t_1 <= -2e-103) {
tmp = -9.0 * (t * (y * z));
} else if (t_1 <= 4e+106) {
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 = (a * 27.0) * b tmp = 0 if t_1 <= -1e+82: tmp = a * (27.0 * b) elif t_1 <= -2e-103: tmp = -9.0 * (t * (y * z)) elif t_1 <= 4e+106: 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(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -1e+82) tmp = Float64(a * Float64(27.0 * b)); elseif (t_1 <= -2e-103) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (t_1 <= 4e+106) 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 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -1e+82)
tmp = a * (27.0 * b);
elseif (t_1 <= -2e-103)
tmp = -9.0 * (t * (y * z));
elseif (t_1 <= 4e+106)
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+82], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-103], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+106], 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 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+82}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-103}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -9.9999999999999996e81Initial program 95.5%
+-commutative95.5%
associate-+r-95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*95.5%
associate-*l*95.5%
neg-mul-195.5%
associate-*r*95.5%
Simplified95.5%
Taylor expanded in t around 0 90.5%
Taylor expanded in a around inf 90.6%
Taylor expanded in a around inf 80.1%
*-commutative80.1%
associate-*l*80.2%
*-commutative80.2%
Simplified80.2%
if -9.9999999999999996e81 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.99999999999999992e-103Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
*-commutative99.6%
cancel-sign-sub-inv99.6%
associate-*r*95.1%
distribute-lft-neg-in95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-+r-95.1%
associate-*l*95.0%
fma-define95.0%
cancel-sign-sub-inv95.0%
fma-define95.0%
distribute-lft-neg-in95.0%
distribute-rgt-neg-in95.0%
*-commutative95.0%
associate-*r*99.6%
associate-*l*97.4%
neg-mul-197.4%
associate-*r*97.4%
Simplified97.4%
Taylor expanded in t around inf 45.6%
if -1.99999999999999992e-103 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 4.00000000000000036e106Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.2%
fma-define94.2%
cancel-sign-sub-inv94.2%
fma-define94.2%
distribute-lft-neg-in94.2%
distribute-rgt-neg-in94.2%
*-commutative94.2%
associate-*r*93.4%
associate-*l*93.5%
neg-mul-193.5%
associate-*r*93.5%
Simplified93.5%
Taylor expanded in t around 0 56.9%
Taylor expanded in x around inf 48.0%
if 4.00000000000000036e106 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 91.9%
+-commutative91.9%
associate-+r-91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*94.6%
associate-*l*94.6%
neg-mul-194.6%
associate-*r*94.6%
Simplified94.6%
Taylor expanded in t around 0 92.1%
Taylor expanded in a around inf 92.1%
Taylor expanded in b around inf 92.1%
associate-/r*92.1%
Simplified92.1%
Taylor expanded in a around inf 84.4%
associate-*r*84.4%
*-commutative84.4%
Simplified84.4%
Final simplification58.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
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -5e+92)
(* a (* b (+ 27.0 (* 2.0 (/ (/ x a) b)))))
(if (<= t_1 4e+101)
(- (* x 2.0) (* t (* 9.0 (* 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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * (b * (27.0 + (2.0 * ((x / a) / b))));
} else if (t_1 <= 4e+101) {
tmp = (x * 2.0) - (t * (9.0 * (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) :: t_1
real(8) :: tmp
t_1 = (a * 27.0d0) * b
if (t_1 <= (-5d+92)) then
tmp = a * (b * (27.0d0 + (2.0d0 * ((x / a) / b))))
else if (t_1 <= 4d+101) then
tmp = (x * 2.0d0) - (t * (9.0d0 * (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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * (b * (27.0 + (2.0 * ((x / a) / b))));
} else if (t_1 <= 4e+101) {
tmp = (x * 2.0) - (t * (9.0 * (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): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -5e+92: tmp = a * (b * (27.0 + (2.0 * ((x / a) / b)))) elif t_1 <= 4e+101: tmp = (x * 2.0) - (t * (9.0 * (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) t_1 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -5e+92) tmp = Float64(a * Float64(b * Float64(27.0 + Float64(2.0 * Float64(Float64(x / a) / b))))); elseif (t_1 <= 4e+101) tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * 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)
t_1 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -5e+92)
tmp = a * (b * (27.0 + (2.0 * ((x / a) / b))));
elseif (t_1 <= 4e+101)
tmp = (x * 2.0) - (t * (9.0 * (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_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+92], N[(a * N[(b * N[(27.0 + N[(2.0 * N[(N[(x / a), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+101], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * 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}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+92}:\\
\;\;\;\;a \cdot \left(b \cdot \left(27 + 2 \cdot \frac{\frac{x}{a}}{b}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+101}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -5.00000000000000022e92Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*95.4%
associate-*l*95.4%
neg-mul-195.4%
associate-*r*95.4%
Simplified95.4%
Taylor expanded in t around 0 90.3%
Taylor expanded in a around inf 90.4%
Taylor expanded in b around inf 90.4%
associate-/r*90.4%
Simplified90.4%
if -5.00000000000000022e92 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 3.9999999999999999e101Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around 0 81.3%
pow181.3%
associate-*r*81.3%
*-commutative81.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*l*80.8%
associate-*r*80.8%
Simplified80.8%
pow180.8%
associate-*r*81.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
Simplified81.4%
if 3.9999999999999999e101 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.3%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*94.8%
associate-*l*94.8%
neg-mul-194.8%
associate-*r*94.8%
Simplified94.8%
Taylor expanded in t around 0 92.3%
Final simplification84.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -5e+92)
(* a (+ (* 27.0 b) (* 2.0 (/ x a))))
(if (<= t_1 4e+101)
(- (* x 2.0) (* t (* 9.0 (* 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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (t_1 <= 4e+101) {
tmp = (x * 2.0) - (t * (9.0 * (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) :: t_1
real(8) :: tmp
t_1 = (a * 27.0d0) * b
if (t_1 <= (-5d+92)) then
tmp = a * ((27.0d0 * b) + (2.0d0 * (x / a)))
else if (t_1 <= 4d+101) then
tmp = (x * 2.0d0) - (t * (9.0d0 * (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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (t_1 <= 4e+101) {
tmp = (x * 2.0) - (t * (9.0 * (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): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -5e+92: tmp = a * ((27.0 * b) + (2.0 * (x / a))) elif t_1 <= 4e+101: tmp = (x * 2.0) - (t * (9.0 * (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) t_1 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -5e+92) tmp = Float64(a * Float64(Float64(27.0 * b) + Float64(2.0 * Float64(x / a)))); elseif (t_1 <= 4e+101) tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * 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)
t_1 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -5e+92)
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
elseif (t_1 <= 4e+101)
tmp = (x * 2.0) - (t * (9.0 * (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_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+92], N[(a * N[(N[(27.0 * b), $MachinePrecision] + N[(2.0 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+101], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * 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}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+92}:\\
\;\;\;\;a \cdot \left(27 \cdot b + 2 \cdot \frac{x}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+101}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -5.00000000000000022e92Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*95.4%
associate-*l*95.4%
neg-mul-195.4%
associate-*r*95.4%
Simplified95.4%
Taylor expanded in t around 0 90.3%
Taylor expanded in a around inf 90.4%
if -5.00000000000000022e92 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 3.9999999999999999e101Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around 0 81.3%
pow181.3%
associate-*r*81.3%
*-commutative81.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*l*80.8%
associate-*r*80.8%
Simplified80.8%
pow180.8%
associate-*r*81.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
Simplified81.4%
if 3.9999999999999999e101 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.3%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*94.8%
associate-*l*94.8%
neg-mul-194.8%
associate-*r*94.8%
Simplified94.8%
Taylor expanded in t around 0 92.3%
Final simplification84.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -5e+92)
(* a (+ (* 27.0 b) (* 2.0 (/ x a))))
(if (<= t_1 4e+101)
(- (* 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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (t_1 <= 4e+101) {
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) :: t_1
real(8) :: tmp
t_1 = (a * 27.0d0) * b
if (t_1 <= (-5d+92)) then
tmp = a * ((27.0d0 * b) + (2.0d0 * (x / a)))
else if (t_1 <= 4d+101) 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 t_1 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5e+92) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (t_1 <= 4e+101) {
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): t_1 = (a * 27.0) * b tmp = 0 if t_1 <= -5e+92: tmp = a * ((27.0 * b) + (2.0 * (x / a))) elif t_1 <= 4e+101: 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) t_1 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -5e+92) tmp = Float64(a * Float64(Float64(27.0 * b) + Float64(2.0 * Float64(x / a)))); elseif (t_1 <= 4e+101) 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)
t_1 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -5e+92)
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
elseif (t_1 <= 4e+101)
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_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+92], N[(a * N[(N[(27.0 * b), $MachinePrecision] + N[(2.0 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+101], 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}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+92}:\\
\;\;\;\;a \cdot \left(27 \cdot b + 2 \cdot \frac{x}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+101}:\\
\;\;\;\;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 (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -5.00000000000000022e92Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*95.4%
associate-*l*95.4%
neg-mul-195.4%
associate-*r*95.4%
Simplified95.4%
Taylor expanded in t around 0 90.3%
Taylor expanded in a around inf 90.4%
if -5.00000000000000022e92 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 3.9999999999999999e101Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around 0 81.3%
if 3.9999999999999999e101 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.3%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*94.8%
associate-*l*94.8%
neg-mul-194.8%
associate-*r*94.8%
Simplified94.8%
Taylor expanded in t around 0 92.3%
Final simplification84.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 5e+287)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(- (* x 2.0) (* 9.0 (* z (* y t)))))))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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+287) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - (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.
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 = (y * 9.0d0) * z
if (t_1 <= 5d+287) then
tmp = ((x * 2.0d0) - (t_1 * t)) + ((a * 27.0d0) * b)
else
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+287) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
}
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 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+287: tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b) else: tmp = (x * 2.0) - (9.0 * (z * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+287) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = Float64(Float64(x * 2.0) - 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])){:}
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 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+287)
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
else
tmp = (x * 2.0) - (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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+287], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5e287Initial program 96.3%
if 5e287 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 56.3%
+-commutative56.3%
associate-+r-56.3%
*-commutative56.3%
cancel-sign-sub-inv56.3%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
fma-define99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
*-commutative99.7%
associate-*r*56.3%
associate-*l*56.3%
neg-mul-156.3%
associate-*r*56.3%
Simplified56.3%
fma-undefine56.3%
fma-undefine56.3%
associate-+r+56.3%
*-commutative56.3%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*99.9%
metadata-eval99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-+r+99.9%
sub-neg99.9%
Applied egg-rr100.0%
Taylor expanded in b around 0 56.3%
*-commutative56.3%
*-commutative56.3%
associate-*r*82.3%
*-commutative82.3%
Simplified82.3%
Final simplification95.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -8.8e-56)
(- (* x 2.0) (* z (* (* y 9.0) t)))
(if (<= z 1.65e-54) (+ (* x 2.0) t_1) (- t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -8.8e-56) {
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
} else if (z <= 1.65e-54) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-8.8d-56)) then
tmp = (x * 2.0d0) - (z * ((y * 9.0d0) * t))
else if (z <= 1.65d-54) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - (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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -8.8e-56) {
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
} else if (z <= 1.65e-54) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (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): t_1 = 27.0 * (a * b) tmp = 0 if z <= -8.8e-56: tmp = (x * 2.0) - (z * ((y * 9.0) * t)) elif z <= 1.65e-54: tmp = (x * 2.0) + t_1 else: tmp = t_1 - (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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -8.8e-56) tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(Float64(y * 9.0) * t))); elseif (z <= 1.65e-54) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - 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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -8.8e-56)
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
elseif (z <= 1.65e-54)
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - (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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e-56], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(N[(y * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-54], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - 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}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{-56}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-54}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -8.80000000000000017e-56Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around 0 76.0%
pow176.0%
associate-*r*76.0%
*-commutative76.0%
Applied egg-rr76.0%
unpow176.0%
*-commutative76.0%
associate-*l*78.7%
associate-*r*78.7%
Simplified78.7%
if -8.80000000000000017e-56 < z < 1.64999999999999996e-54Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-*r*91.6%
distribute-lft-neg-in91.6%
*-commutative91.6%
cancel-sign-sub-inv91.6%
associate-+r-91.6%
associate-*l*91.6%
fma-define91.6%
cancel-sign-sub-inv91.6%
fma-define91.6%
distribute-lft-neg-in91.6%
distribute-rgt-neg-in91.6%
*-commutative91.6%
associate-*r*97.9%
associate-*l*97.9%
neg-mul-197.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in t around 0 82.2%
if 1.64999999999999996e-54 < z Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in x around 0 71.1%
Final simplification77.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* a 27.0) b)))
(if (<= t_1 -5000000000.0)
(* a (* 27.0 b))
(if (<= t_1 4e+106) (* 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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5000000000.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 4e+106) {
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 = (a * 27.0d0) * b
if (t_1 <= (-5000000000.0d0)) then
tmp = a * (27.0d0 * b)
else if (t_1 <= 4d+106) 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 = (a * 27.0) * b;
double tmp;
if (t_1 <= -5000000000.0) {
tmp = a * (27.0 * b);
} else if (t_1 <= 4e+106) {
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 = (a * 27.0) * b tmp = 0 if t_1 <= -5000000000.0: tmp = a * (27.0 * b) elif t_1 <= 4e+106: 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(Float64(a * 27.0) * b) tmp = 0.0 if (t_1 <= -5000000000.0) tmp = Float64(a * Float64(27.0 * b)); elseif (t_1 <= 4e+106) 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 = (a * 27.0) * b;
tmp = 0.0;
if (t_1 <= -5000000000.0)
tmp = a * (27.0 * b);
elseif (t_1 <= 4e+106)
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5000000000.0], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+106], 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 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+106}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -5e9Initial program 96.6%
+-commutative96.6%
associate-+r-96.6%
*-commutative96.6%
cancel-sign-sub-inv96.6%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
fma-define99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
*-commutative99.7%
associate-*r*96.6%
associate-*l*96.6%
neg-mul-196.6%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in t around 0 80.2%
Taylor expanded in a around inf 80.2%
Taylor expanded in a around inf 66.6%
*-commutative66.6%
associate-*l*66.6%
*-commutative66.6%
Simplified66.6%
if -5e9 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 4.00000000000000036e106Initial program 94.4%
+-commutative94.4%
associate-+r-94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-*r*93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-+r-93.8%
associate-*l*93.8%
fma-define93.8%
cancel-sign-sub-inv93.8%
fma-define93.8%
distribute-lft-neg-in93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
associate-*r*94.4%
associate-*l*93.8%
neg-mul-193.8%
associate-*r*93.8%
Simplified93.8%
Taylor expanded in t around 0 57.4%
Taylor expanded in x around inf 45.7%
if 4.00000000000000036e106 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 91.9%
+-commutative91.9%
associate-+r-91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*94.6%
associate-*l*94.6%
neg-mul-194.6%
associate-*r*94.6%
Simplified94.6%
Taylor expanded in t around 0 92.1%
Taylor expanded in a around inf 92.1%
Taylor expanded in b around inf 92.1%
associate-/r*92.1%
Simplified92.1%
Taylor expanded in a around inf 84.4%
associate-*r*84.4%
*-commutative84.4%
Simplified84.4%
Final simplification56.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 1.08e+94) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (- (* 27.0 (* a b)) (* 9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.08e+94) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (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 <= 1.08d+94) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (a * b)) - (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 <= 1.08e+94) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (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 <= 1.08e+94: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = (27.0 * (a * b)) - (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 <= 1.08e+94) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - 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 <= 1.08e+94)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = (27.0 * (a * b)) - (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, 1.08e+94], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $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 1.08 \cdot 10^{+94}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 1.08e94Initial program 96.0%
sub-neg96.0%
sub-neg96.0%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
if 1.08e94 < z Initial program 88.7%
sub-neg88.7%
sub-neg88.7%
associate-*l*92.7%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around 0 78.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.7e+34) (* y (* -9.0 (* z t))) (if (<= z 3.3e+34) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.7e+34) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 3.3e+34) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.7d+34)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 3.3d+34) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.7e+34) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 3.3e+34) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.7e+34: tmp = y * (-9.0 * (z * t)) elif z <= 3.3e+34: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.7e+34) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 3.3e+34) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.7e+34)
tmp = y * (-9.0 * (z * t));
elseif (z <= 3.3e+34)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.7e+34], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+34], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+34}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.7e34Initial program 89.9%
sub-neg89.9%
sub-neg89.9%
associate-*l*96.0%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around 0 68.7%
Taylor expanded in y around inf 68.8%
Taylor expanded in a around 0 54.8%
if -1.7e34 < z < 3.29999999999999988e34Initial program 98.5%
+-commutative98.5%
associate-+r-98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
associate-*r*93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r-93.9%
associate-*l*93.9%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*98.5%
associate-*l*98.5%
neg-mul-198.5%
associate-*r*98.5%
Simplified98.5%
Taylor expanded in t around 0 80.8%
if 3.29999999999999988e34 < z Initial program 89.4%
+-commutative89.4%
associate-+r-89.4%
*-commutative89.4%
cancel-sign-sub-inv89.4%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*91.0%
associate-*l*89.5%
neg-mul-189.5%
associate-*r*89.5%
Simplified89.5%
Taylor expanded in t around inf 39.8%
Final simplification65.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -3e+155) (not (<= a 2.4e-129))) (* 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 <= -3e+155) || !(a <= 2.4e-129)) {
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 <= (-3d+155)) .or. (.not. (a <= 2.4d-129))) 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 <= -3e+155) || !(a <= 2.4e-129)) {
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 <= -3e+155) or not (a <= 2.4e-129): 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 <= -3e+155) || !(a <= 2.4e-129)) 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 <= -3e+155) || ~((a <= 2.4e-129)))
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, -3e+155], N[Not[LessEqual[a, 2.4e-129]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+155} \lor \neg \left(a \leq 2.4 \cdot 10^{-129}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.0000000000000001e155 or 2.39999999999999989e-129 < a Initial program 95.8%
+-commutative95.8%
associate-+r-95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-define99.0%
cancel-sign-sub-inv99.0%
fma-define99.0%
distribute-lft-neg-in99.0%
distribute-rgt-neg-in99.0%
*-commutative99.0%
associate-*r*96.6%
associate-*l*96.7%
neg-mul-196.7%
associate-*r*96.7%
Simplified96.7%
Taylor expanded in a around inf 57.5%
if -3.0000000000000001e155 < a < 2.39999999999999989e-129Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*93.5%
fma-define93.5%
cancel-sign-sub-inv93.5%
fma-define93.5%
distribute-lft-neg-in93.5%
distribute-rgt-neg-in93.5%
*-commutative93.5%
associate-*r*93.4%
associate-*l*92.8%
neg-mul-192.8%
associate-*r*92.8%
Simplified92.8%
Taylor expanded in t around 0 60.3%
Taylor expanded in x around inf 43.7%
Final simplification50.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= a -7.2e+155) (* a (* 27.0 b)) (if (<= a 2.3e-130) (* 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 <= -7.2e+155) {
tmp = a * (27.0 * b);
} else if (a <= 2.3e-130) {
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 <= (-7.2d+155)) then
tmp = a * (27.0d0 * b)
else if (a <= 2.3d-130) 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 <= -7.2e+155) {
tmp = a * (27.0 * b);
} else if (a <= 2.3e-130) {
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 <= -7.2e+155: tmp = a * (27.0 * b) elif a <= 2.3e-130: 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 <= -7.2e+155) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 2.3e-130) 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 <= -7.2e+155)
tmp = a * (27.0 * b);
elseif (a <= 2.3e-130)
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, -7.2e+155], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-130], 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 -7.2 \cdot 10^{+155}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-130}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -7.20000000000000015e155Initial program 96.2%
+-commutative96.2%
associate-+r-96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-*r*99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r-99.7%
associate-*l*99.7%
fma-define99.7%
cancel-sign-sub-inv99.7%
fma-define99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
*-commutative99.7%
associate-*r*96.2%
associate-*l*96.2%
neg-mul-196.2%
associate-*r*96.2%
Simplified96.2%
Taylor expanded in t around 0 89.1%
Taylor expanded in a around inf 89.2%
Taylor expanded in a around inf 67.8%
*-commutative67.8%
associate-*l*67.9%
*-commutative67.9%
Simplified67.9%
if -7.20000000000000015e155 < a < 2.3000000000000001e-130Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*93.5%
fma-define93.5%
cancel-sign-sub-inv93.5%
fma-define93.5%
distribute-lft-neg-in93.5%
distribute-rgt-neg-in93.5%
*-commutative93.5%
associate-*r*93.4%
associate-*l*92.8%
neg-mul-192.8%
associate-*r*92.8%
Simplified92.8%
Taylor expanded in t around 0 60.3%
Taylor expanded in x around inf 43.7%
if 2.3000000000000001e-130 < a Initial program 95.7%
+-commutative95.7%
associate-+r-95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-*r*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-+r-97.8%
associate-*l*97.8%
fma-define98.8%
cancel-sign-sub-inv98.8%
fma-define98.8%
distribute-lft-neg-in98.8%
distribute-rgt-neg-in98.8%
*-commutative98.8%
associate-*r*96.8%
associate-*l*96.8%
neg-mul-196.8%
associate-*r*96.8%
Simplified96.8%
Taylor expanded in a around inf 54.5%
Final simplification50.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* 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 94.6%
+-commutative94.6%
associate-+r-94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*95.0%
associate-*l*94.6%
neg-mul-194.6%
associate-*r*94.6%
Simplified94.6%
Taylor expanded in t around 0 68.0%
Taylor expanded in x around inf 32.9%
Final simplification32.9%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024139
(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)))