
(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 19 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 (* z (* 9.0 y))))
(if (<= t_1 1e+160)
(- (* (* 27.0 a) b) (- (* t t_1) (* 2.0 x)))
(fma (* -9.0 z) (* t y) (+ (fma a (* b 27.0) x) x)))))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 = z * (9.0 * y);
double tmp;
if (t_1 <= 1e+160) {
tmp = ((27.0 * a) * b) - ((t * t_1) - (2.0 * x));
} else {
tmp = fma((-9.0 * z), (t * y), (fma(a, (b * 27.0), x) + x));
}
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(z * Float64(9.0 * y)) tmp = 0.0 if (t_1 <= 1e+160) tmp = Float64(Float64(Float64(27.0 * a) * b) - Float64(Float64(t * t_1) - Float64(2.0 * x))); else tmp = fma(Float64(-9.0 * z), Float64(t * y), Float64(fma(a, Float64(b * 27.0), x) + x)); 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[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+160], N[(N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision] - N[(N[(t * t$95$1), $MachinePrecision] - N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(N[(a * N[(b * 27.0), $MachinePrecision] + x), $MachinePrecision] + x), $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 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t\_1 \leq 10^{+160}:\\
\;\;\;\;\left(27 \cdot a\right) \cdot b - \left(t \cdot t\_1 - 2 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(a, b \cdot 27, x\right) + x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.00000000000000001e160Initial program 95.9%
if 1.00000000000000001e160 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 97.0%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-*.f64N/A
Applied rewrites99.8%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6496.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.7
Applied rewrites96.7%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
associate-+r+N/A
count-2-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
Applied rewrites96.6%
Final simplification96.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.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (* b 27.0) a (* (* (* z y) t) -9.0)))
(t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
t_1
(if (<= t_2 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(if (<= t_2 1e+298) t_1 (fma (* b 27.0) a (* (* (* -9.0 y) t) 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 = fma((b * 27.0), a, (((z * y) * t) * -9.0));
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = t_1;
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else if (t_2 <= 1e+298) {
tmp = t_1;
} else {
tmp = fma((b * 27.0), a, (((-9.0 * y) * t) * 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 = fma(Float64(b * 27.0), a, Float64(Float64(Float64(z * y) * t) * -9.0)) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = t_1; elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); elseif (t_2 <= 1e+298) tmp = t_1; else tmp = fma(Float64(b * 27.0), a, Float64(Float64(Float64(-9.0 * y) * t) * z)); 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[(b * 27.0), $MachinePrecision] * a + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], t$95$1, If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$1, N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $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 := \mathsf{fma}\left(b \cdot 27, a, \left(\left(z \cdot y\right) \cdot t\right) \cdot -9\right)\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20 or 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e297Initial program 96.4%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.8
Applied rewrites84.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6484.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6484.7
Applied rewrites78.5%
Applied rewrites78.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.7
Applied rewrites84.7%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 9.9999999999999996e297 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 84.1%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6482.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites91.3%
Final simplification89.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 (fma (* b 27.0) a (* (* -9.0 t) (* z y))))
(t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
t_1
(if (<= t_2 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(if (<= t_2 1e+298) t_1 (fma (* b 27.0) a (* (* (* -9.0 y) t) 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 = fma((b * 27.0), a, ((-9.0 * t) * (z * y)));
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = t_1;
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else if (t_2 <= 1e+298) {
tmp = t_1;
} else {
tmp = fma((b * 27.0), a, (((-9.0 * y) * t) * 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 = fma(Float64(b * 27.0), a, Float64(Float64(-9.0 * t) * Float64(z * y))) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = t_1; elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); elseif (t_2 <= 1e+298) tmp = t_1; else tmp = fma(Float64(b * 27.0), a, Float64(Float64(Float64(-9.0 * y) * t) * z)); 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[(b * 27.0), $MachinePrecision] * a + N[(N[(-9.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], t$95$1, If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$1, N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $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 := \mathsf{fma}\left(b \cdot 27, a, \left(-9 \cdot t\right) \cdot \left(z \cdot y\right)\right)\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20 or 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e297Initial program 96.4%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.8
Applied rewrites84.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6484.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6484.7
Applied rewrites78.5%
Applied rewrites84.8%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 9.9999999999999996e297 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 84.1%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6482.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites91.3%
Final simplification89.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 (fma (* b 27.0) a (* (* -9.0 t) (* z y))))
(t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
t_1
(if (<= t_2 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(if (<= t_2 1e+298) t_1 (fma (* b 27.0) a (* (* t y) (* -9.0 z))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b * 27.0), a, ((-9.0 * t) * (z * y)));
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = t_1;
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else if (t_2 <= 1e+298) {
tmp = t_1;
} else {
tmp = fma((b * 27.0), a, ((t * y) * (-9.0 * 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 = fma(Float64(b * 27.0), a, Float64(Float64(-9.0 * t) * Float64(z * y))) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = t_1; elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); elseif (t_2 <= 1e+298) tmp = t_1; else tmp = fma(Float64(b * 27.0), a, Float64(Float64(t * y) * Float64(-9.0 * z))); 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[(b * 27.0), $MachinePrecision] * a + N[(N[(-9.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], t$95$1, If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], t$95$1, N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(t * y), $MachinePrecision] * N[(-9.0 * 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}
t_1 := \mathsf{fma}\left(b \cdot 27, a, \left(-9 \cdot t\right) \cdot \left(z \cdot y\right)\right)\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \left(t \cdot y\right) \cdot \left(-9 \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20 or 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e297Initial program 96.4%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.8
Applied rewrites84.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6484.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6484.7
Applied rewrites78.5%
Applied rewrites84.8%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 9.9999999999999996e297 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 84.1%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6482.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites91.3%
Applied rewrites91.2%
Final simplification89.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 (* (* z y) t)) (t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
(fma -9.0 t_1 (* (* b a) 27.0))
(if (<= t_2 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(if (<= t_2 1e+298)
(fma (* b a) 27.0 (* t_1 -9.0))
(fma (* b 27.0) a (* (* t y) (* -9.0 z))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * y) * t;
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = fma(-9.0, t_1, ((b * a) * 27.0));
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else if (t_2 <= 1e+298) {
tmp = fma((b * a), 27.0, (t_1 * -9.0));
} else {
tmp = fma((b * 27.0), a, ((t * y) * (-9.0 * 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(Float64(z * y) * t) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = fma(-9.0, t_1, Float64(Float64(b * a) * 27.0)); elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); elseif (t_2 <= 1e+298) tmp = fma(Float64(b * a), 27.0, Float64(t_1 * -9.0)); else tmp = fma(Float64(b * 27.0), a, Float64(Float64(t * y) * Float64(-9.0 * z))); 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[(z * y), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], N[(-9.0 * t$95$1 + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], N[(N[(b * a), $MachinePrecision] * 27.0 + N[(t$95$1 * -9.0), $MachinePrecision]), $MachinePrecision], N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(t * y), $MachinePrecision] * N[(-9.0 * 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}
t_1 := \left(z \cdot y\right) \cdot t\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(-9, t\_1, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, t\_1 \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \left(t \cdot y\right) \cdot \left(-9 \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20Initial program 94.1%
Taylor expanded in x around 0
cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.0
Applied rewrites83.0%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e297Initial program 99.6%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.1
Applied rewrites31.1%
Taylor expanded in x around 0
cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
if 9.9999999999999996e297 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 84.1%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6482.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites91.3%
Applied rewrites91.2%
Final simplification89.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 (fma (* t z) (* -9.0 y) (+ (* (* b 27.0) a) x)))
(t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
t_1
(if (<= t_2 5e+75) (fma 2.0 x (* (* 27.0 a) b)) 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 = fma((t * z), (-9.0 * y), (((b * 27.0) * a) + x));
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = t_1;
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} 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 = fma(Float64(t * z), Float64(-9.0 * y), Float64(Float64(Float64(b * 27.0) * a) + x)) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = t_1; elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); else tmp = t_1; 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[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(N[(b * 27.0), $MachinePrecision] * a), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], t$95$1, If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $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 := \mathsf{fma}\left(t \cdot z, -9 \cdot y, \left(b \cdot 27\right) \cdot a + x\right)\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20 or 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 93.3%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6488.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.4
lift-*.f64N/A
Applied rewrites88.4%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6487.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.6
Applied rewrites87.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
Taylor expanded in x around 0
Applied rewrites83.5%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
Final simplification88.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
(let* ((t_1 (* t (* z (* 9.0 y)))))
(if (<= t_1 -1e+20)
(fma (* b 27.0) a (* (* (* z y) t) -9.0))
(if (<= t_1 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(fma (* t z) (* -9.0 y) (* (* 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 t_1 = t * (z * (9.0 * y));
double tmp;
if (t_1 <= -1e+20) {
tmp = fma((b * 27.0), a, (((z * y) * t) * -9.0));
} else if (t_1 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else {
tmp = fma((t * z), (-9.0 * y), ((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) t_1 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_1 <= -1e+20) tmp = fma(Float64(b * 27.0), a, Float64(Float64(Float64(z * y) * t) * -9.0)); elseif (t_1 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); else tmp = fma(Float64(t * z), Float64(-9.0 * y), Float64(Float64(b * 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_] := Block[{t$95$1 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+20], N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $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 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \left(\left(z \cdot y\right) \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, \left(b \cdot a\right) \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20Initial program 94.1%
Taylor expanded in x around 0
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.0
Applied rewrites83.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f6483.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6483.0
Applied rewrites81.2%
Applied rewrites81.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.0
Applied rewrites83.0%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6487.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.2
lift-*.f64N/A
Applied rewrites87.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6482.8
Applied rewrites82.8%
Final simplification88.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.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z y) t)) (t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
(fma -9.0 t_1 (* (* b a) 27.0))
(if (<= t_2 5e+75)
(fma 2.0 x (* (* 27.0 a) b))
(fma (* b a) 27.0 (* t_1 -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 = (z * y) * t;
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = fma(-9.0, t_1, ((b * a) * 27.0));
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} else {
tmp = fma((b * a), 27.0, (t_1 * -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(z * y) * t) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = fma(-9.0, t_1, Float64(Float64(b * a) * 27.0)); elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); else tmp = fma(Float64(b * a), 27.0, Float64(t_1 * -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[(z * y), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], N[(-9.0 * t$95$1 + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * 27.0 + N[(t$95$1 * -9.0), $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(z \cdot y\right) \cdot t\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(-9, t\_1, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, t\_1 \cdot -9\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20Initial program 94.1%
Taylor expanded in x around 0
cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.0
Applied rewrites83.0%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
if 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 92.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.0
Applied rewrites24.0%
Taylor expanded in x around 0
cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6484.9
Applied rewrites84.9%
Final simplification88.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
(let* ((t_1 (fma -9.0 (* (* z y) t) (* (* b a) 27.0)))
(t_2 (* t (* z (* 9.0 y)))))
(if (<= t_2 -1e+20)
t_1
(if (<= t_2 5e+75) (fma 2.0 x (* (* 27.0 a) b)) 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 = fma(-9.0, ((z * y) * t), ((b * a) * 27.0));
double t_2 = t * (z * (9.0 * y));
double tmp;
if (t_2 <= -1e+20) {
tmp = t_1;
} else if (t_2 <= 5e+75) {
tmp = fma(2.0, x, ((27.0 * a) * b));
} 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 = fma(-9.0, Float64(Float64(z * y) * t), Float64(Float64(b * a) * 27.0)) t_2 = Float64(t * Float64(z * Float64(9.0 * y))) tmp = 0.0 if (t_2 <= -1e+20) tmp = t_1; elseif (t_2 <= 5e+75) tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); else tmp = t_1; 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[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+20], t$95$1, If[LessEqual[t$95$2, 5e+75], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $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 := \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\
t_2 := t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1e20 or 5.0000000000000002e75 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 93.3%
Taylor expanded in x around 0
cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
if -1e20 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.0000000000000002e75Initial program 98.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
Applied rewrites92.4%
Final simplification88.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 (<= (- (* (* 27.0 a) b) (- (* t (* z (* 9.0 y))) (* 2.0 x))) 2e+305) (+ x x) (* 4.0 (* x x))))
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 ((((27.0 * a) * b) - ((t * (z * (9.0 * y))) - (2.0 * x))) <= 2e+305) {
tmp = x + x;
} else {
tmp = 4.0 * (x * x);
}
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 ((((27.0d0 * a) * b) - ((t * (z * (9.0d0 * y))) - (2.0d0 * x))) <= 2d+305) then
tmp = x + x
else
tmp = 4.0d0 * (x * x)
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 ((((27.0 * a) * b) - ((t * (z * (9.0 * y))) - (2.0 * x))) <= 2e+305) {
tmp = x + x;
} else {
tmp = 4.0 * (x * x);
}
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 (((27.0 * a) * b) - ((t * (z * (9.0 * y))) - (2.0 * x))) <= 2e+305: tmp = x + x else: tmp = 4.0 * (x * x) 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(Float64(Float64(27.0 * a) * b) - Float64(Float64(t * Float64(z * Float64(9.0 * y))) - Float64(2.0 * x))) <= 2e+305) tmp = Float64(x + x); else tmp = Float64(4.0 * Float64(x * x)); 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 ((((27.0 * a) * b) - ((t * (z * (9.0 * y))) - (2.0 * x))) <= 2e+305)
tmp = x + x;
else
tmp = 4.0 * (x * x);
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[N[(N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision] - N[(N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+305], N[(x + x), $MachinePrecision], N[(4.0 * N[(x * x), $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}\;\left(27 \cdot a\right) \cdot b - \left(t \cdot \left(z \cdot \left(9 \cdot y\right)\right) - 2 \cdot x\right) \leq 2 \cdot 10^{+305}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) < 1.9999999999999999e305Initial program 97.6%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6494.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.3
lift-*.f64N/A
Applied rewrites94.3%
Taylor expanded in x around inf
lower-*.f6434.0
Applied rewrites34.0%
Applied rewrites34.0%
if 1.9999999999999999e305 < (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) Initial program 87.9%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6495.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1
lift-*.f64N/A
Applied rewrites95.1%
Taylor expanded in x around inf
lower-*.f642.2
Applied rewrites2.2%
Applied rewrites2.2%
Applied rewrites26.6%
Final simplification32.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 (<= (* 9.0 y) -2e-132) (fma (* t z) (* -9.0 y) (+ (fma (* b 27.0) a x) x)) (+ (+ (fma (* (* -9.0 y) t) z (* (* 27.0 a) b)) x) x)))
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 ((9.0 * y) <= -2e-132) {
tmp = fma((t * z), (-9.0 * y), (fma((b * 27.0), a, x) + x));
} else {
tmp = (fma(((-9.0 * y) * t), z, ((27.0 * a) * b)) + x) + x;
}
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(9.0 * y) <= -2e-132) tmp = fma(Float64(t * z), Float64(-9.0 * y), Float64(fma(Float64(b * 27.0), a, x) + x)); else tmp = Float64(Float64(fma(Float64(Float64(-9.0 * y) * t), z, Float64(Float64(27.0 * a) * b)) + x) + x); 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[(9.0 * y), $MachinePrecision], -2e-132], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(N[(b * 27.0), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + x), $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}\;9 \cdot y \leq -2 \cdot 10^{-132}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, \mathsf{fma}\left(b \cdot 27, a, x\right) + x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(-9 \cdot y\right) \cdot t, z, \left(27 \cdot a\right) \cdot b\right) + x\right) + x\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -2e-132Initial program 94.3%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6497.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.0
lift-*.f64N/A
Applied rewrites97.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6496.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.0
Applied rewrites96.0%
if -2e-132 < (*.f64 y #s(literal 9 binary64)) Initial program 97.2%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites98.0%
Final simplification97.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* 27.0 a) b)))
(if (<= (* t (* z (* 9.0 y))) -5e+219)
(fma (* x x) 4.0 t_1)
(fma 2.0 x 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 = (27.0 * a) * b;
double tmp;
if ((t * (z * (9.0 * y))) <= -5e+219) {
tmp = fma((x * x), 4.0, t_1);
} else {
tmp = fma(2.0, x, 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(27.0 * a) * b) tmp = 0.0 if (Float64(t * Float64(z * Float64(9.0 * y))) <= -5e+219) tmp = fma(Float64(x * x), 4.0, t_1); else tmp = fma(2.0, x, t_1); 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[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+219], N[(N[(x * x), $MachinePrecision] * 4.0 + t$95$1), $MachinePrecision], N[(2.0 * x + t$95$1), $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(27 \cdot a\right) \cdot b\\
\mathbf{if}\;t \cdot \left(z \cdot \left(9 \cdot y\right)\right) \leq -5 \cdot 10^{+219}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, 4, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, x, t\_1\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -5e219Initial program 91.3%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6419.4
Applied rewrites19.4%
Applied rewrites19.5%
Applied rewrites43.2%
if -5e219 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 96.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
Applied rewrites69.1%
Final simplification65.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 (<= (* 9.0 y) -5e+39) (fma (* t z) (* -9.0 y) (+ (fma (* b 27.0) a x) x)) (fma (* -9.0 z) (* t y) (+ (fma a (* b 27.0) x) x))))
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 ((9.0 * y) <= -5e+39) {
tmp = fma((t * z), (-9.0 * y), (fma((b * 27.0), a, x) + x));
} else {
tmp = fma((-9.0 * z), (t * y), (fma(a, (b * 27.0), x) + x));
}
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(9.0 * y) <= -5e+39) tmp = fma(Float64(t * z), Float64(-9.0 * y), Float64(fma(Float64(b * 27.0), a, x) + x)); else tmp = fma(Float64(-9.0 * z), Float64(t * y), Float64(fma(a, Float64(b * 27.0), x) + x)); 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[(9.0 * y), $MachinePrecision], -5e+39], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(N[(b * 27.0), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(N[(a * N[(b * 27.0), $MachinePrecision] + x), $MachinePrecision] + x), $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}\;9 \cdot y \leq -5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, \mathsf{fma}\left(b \cdot 27, a, x\right) + x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(a, b \cdot 27, x\right) + x\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -5.00000000000000015e39Initial program 91.4%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6498.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.3
lift-*.f64N/A
Applied rewrites98.3%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6496.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.8
Applied rewrites96.8%
if -5.00000000000000015e39 < (*.f64 y #s(literal 9 binary64)) Initial program 97.7%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6493.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.0
lift-*.f64N/A
Applied rewrites93.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6493.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.0
Applied rewrites93.0%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
associate-+r+N/A
count-2-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
Applied rewrites98.3%
Final simplification97.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 2.7e-31) (fma (* t z) (* -9.0 y) (+ (fma (* b 27.0) a x) x)) (fma (* b 27.0) a (fma (* (* -9.0 y) t) z (* 2.0 x)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.7e-31) {
tmp = fma((t * z), (-9.0 * y), (fma((b * 27.0), a, x) + x));
} else {
tmp = fma((b * 27.0), a, fma(((-9.0 * y) * t), z, (2.0 * x)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.7e-31) tmp = fma(Float64(t * z), Float64(-9.0 * y), Float64(fma(Float64(b * 27.0), a, x) + x)); else tmp = fma(Float64(b * 27.0), a, fma(Float64(Float64(-9.0 * y) * t), z, Float64(2.0 * x))); 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[z, 2.7e-31], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(N[(b * 27.0), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(b * 27.0), $MachinePrecision] * a + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, \mathsf{fma}\left(b \cdot 27, a, x\right) + x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot 27, a, \mathsf{fma}\left(\left(-9 \cdot y\right) \cdot t, z, 2 \cdot x\right)\right)\\
\end{array}
\end{array}
if z < 2.70000000000000014e-31Initial program 97.2%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6496.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.6
lift-*.f64N/A
Applied rewrites96.6%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6496.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.0
Applied rewrites96.0%
if 2.70000000000000014e-31 < z Initial program 93.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites98.4%
Final simplification96.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 (<= (* t (* z (* 9.0 y))) -1.56e+299) (* 4.0 (* x x)) (fma 2.0 x (* (* 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 ((t * (z * (9.0 * y))) <= -1.56e+299) {
tmp = 4.0 * (x * x);
} else {
tmp = fma(2.0, x, ((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 (Float64(t * Float64(z * Float64(9.0 * y))) <= -1.56e+299) tmp = Float64(4.0 * Float64(x * x)); else tmp = fma(2.0, x, Float64(Float64(27.0 * a) * b)); 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[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.56e+299], N[(4.0 * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(2.0 * x + N[(N[(27.0 * a), $MachinePrecision] * 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}\;t \cdot \left(z \cdot \left(9 \cdot y\right)\right) \leq -1.56 \cdot 10^{+299}:\\
\;\;\;\;4 \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.56e299Initial program 89.9%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6496.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.5
lift-*.f64N/A
Applied rewrites96.5%
Taylor expanded in x around inf
lower-*.f642.5
Applied rewrites2.5%
Applied rewrites2.5%
Applied rewrites30.1%
if -1.56e299 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 96.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
Applied rewrites68.9%
Final simplification64.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 (<= (* t (* z (* 9.0 y))) -1.56e+299) (* 4.0 (* x x)) (+ (fma (* b a) 27.0 x) x)))
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 * (z * (9.0 * y))) <= -1.56e+299) {
tmp = 4.0 * (x * x);
} else {
tmp = fma((b * a), 27.0, x) + x;
}
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(t * Float64(z * Float64(9.0 * y))) <= -1.56e+299) tmp = Float64(4.0 * Float64(x * x)); else tmp = Float64(fma(Float64(b * a), 27.0, x) + x); 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[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.56e+299], N[(4.0 * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * a), $MachinePrecision] * 27.0 + x), $MachinePrecision] + x), $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 \cdot \left(z \cdot \left(9 \cdot y\right)\right) \leq -1.56 \cdot 10^{+299}:\\
\;\;\;\;4 \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, x\right) + x\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.56e299Initial program 89.9%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6496.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.5
lift-*.f64N/A
Applied rewrites96.5%
Taylor expanded in x around inf
lower-*.f642.5
Applied rewrites2.5%
Applied rewrites2.5%
Applied rewrites30.1%
if -1.56e299 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 96.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
Applied rewrites68.9%
Applied rewrites68.9%
Final simplification64.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 (<= (* t (* z (* 9.0 y))) -1.56e+299) (* 4.0 (* x x)) (+ (fma a (* b 27.0) x) x)))
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 * (z * (9.0 * y))) <= -1.56e+299) {
tmp = 4.0 * (x * x);
} else {
tmp = fma(a, (b * 27.0), x) + x;
}
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(t * Float64(z * Float64(9.0 * y))) <= -1.56e+299) tmp = Float64(4.0 * Float64(x * x)); else tmp = Float64(fma(a, Float64(b * 27.0), x) + x); 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[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.56e+299], N[(4.0 * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(b * 27.0), $MachinePrecision] + x), $MachinePrecision] + x), $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 \cdot \left(z \cdot \left(9 \cdot y\right)\right) \leq -1.56 \cdot 10^{+299}:\\
\;\;\;\;4 \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot 27, x\right) + x\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.56e299Initial program 89.9%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6496.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.5
lift-*.f64N/A
Applied rewrites96.5%
Taylor expanded in x around inf
lower-*.f642.5
Applied rewrites2.5%
Applied rewrites2.5%
Applied rewrites30.1%
if -1.56e299 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 96.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
Applied rewrites68.9%
Applied rewrites68.9%
Final simplification64.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 (fma (* -9.0 z) (* t y) (+ (fma a (* b 27.0) x) x)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return fma((-9.0 * z), (t * y), (fma(a, (b * 27.0), x) + x));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return fma(Float64(-9.0 * z), Float64(t * y), Float64(fma(a, Float64(b * 27.0), x) + x)) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(N[(a * N[(b * 27.0), $MachinePrecision] + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(a, b \cdot 27, x\right) + x\right)
\end{array}
Initial program 96.1%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
Applied rewrites94.4%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
count-2-revN/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6494.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.0
Applied rewrites94.0%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
associate-+r+N/A
count-2-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
Applied rewrites95.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 x))
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 + x;
}
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 + x
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 + x;
}
[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 + x
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 + x) 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 + x;
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 + x), $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 + x
\end{array}
Initial program 96.1%
lift-+.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
Applied rewrites94.4%
Taylor expanded in x around inf
lower-*.f6428.9
Applied rewrites28.9%
Applied rewrites28.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 2024298
(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)))