
(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.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (* b 27.0) a (* 2.0 x))))
(if (<= (* y 9.0) -5e+54)
(fma (* t z) (* -9.0 y) t_1)
(fma (* (* t y) 9.0) (- z) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((b * 27.0), a, (2.0 * x));
double tmp;
if ((y * 9.0) <= -5e+54) {
tmp = fma((t * z), (-9.0 * y), t_1);
} else {
tmp = fma(((t * y) * 9.0), -z, t_1);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = fma(Float64(b * 27.0), a, Float64(2.0 * x)) tmp = 0.0 if (Float64(y * 9.0) <= -5e+54) tmp = fma(Float64(t * z), Float64(-9.0 * y), t_1); else tmp = fma(Float64(Float64(t * y) * 9.0), Float64(-z), t_1); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * 27.0), $MachinePrecision] * a + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -5e+54], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(t * y), $MachinePrecision] * 9.0), $MachinePrecision] * (-z) + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot 27, a, 2 \cdot x\right)\\
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot y\right) \cdot 9, -z, t\_1\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -5.00000000000000005e54Initial program 85.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
if -5.00000000000000005e54 < (*.f64 y #s(literal 9 binary64)) Initial program 97.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
Applied rewrites94.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -4e+303)
(fma (* b a) 27.0 (* (* (* -9.0 y) t) z))
(if (<= t_1 -1e+90)
(fma (* y z) (* t -9.0) (* (* 27.0 a) b))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* t (* -9.0 y)) z x)))))))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) * t;
double tmp;
if (t_1 <= -4e+303) {
tmp = fma((b * a), 27.0, (((-9.0 * y) * t) * z));
} else if (t_1 <= -1e+90) {
tmp = fma((y * z), (t * -9.0), ((27.0 * a) * b));
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -4e+303) tmp = fma(Float64(b * a), 27.0, Float64(Float64(Float64(-9.0 * y) * t) * z)); elseif (t_1 <= -1e+90) tmp = fma(Float64(y * z), Float64(t * -9.0), Float64(Float64(27.0 * a) * b)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+303], N[(N[(b * a), $MachinePrecision] * 27.0 + N[(N[(N[(-9.0 * y), $MachinePrecision] * t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+90], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision] + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z, t \cdot -9, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4e303Initial program 70.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.1
Applied rewrites70.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f6470.1
Applied rewrites99.9%
if -4e303 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 99.4%
Taylor expanded in x around 0
fp-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-*.f6490.9
Applied rewrites90.9%
Applied rewrites90.8%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (or (<= t_1 -1e+90) (not (<= t_1 0.74)))
(+ x (fma y (* t (* -9.0 z)) x))
(fma 2.0 x (* (* b a) 27.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if ((t_1 <= -1e+90) || !(t_1 <= 0.74)) {
tmp = x + fma(y, (t * (-9.0 * z)), x);
} else {
tmp = fma(2.0, x, ((b * a) * 27.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if ((t_1 <= -1e+90) || !(t_1 <= 0.74)) tmp = Float64(x + fma(y, Float64(t * Float64(-9.0 * z)), x)); else tmp = fma(2.0, x, 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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+90], N[Not[LessEqual[t$95$1, 0.74]], $MachinePrecision]], N[(x + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(2.0 * x + 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])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90} \lor \neg \left(t\_1 \leq 0.74\right):\\
\;\;\;\;x + \mathsf{fma}\left(y, t \cdot \left(-9 \cdot z\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89 or 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 88.3%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval89.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6489.2
Applied rewrites89.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.2
Applied rewrites89.2%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.1
Applied rewrites81.1%
Applied rewrites80.3%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
Final simplification87.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -1e+90)
(+ (* (* t (* -9.0 z)) y) (* (* a 27.0) b))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* t (* -9.0 y)) z x))))))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) * t;
double tmp;
if (t_1 <= -1e+90) {
tmp = ((t * (-9.0 * z)) * y) + ((a * 27.0) * b);
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -1e+90) tmp = Float64(Float64(Float64(t * Float64(-9.0 * z)) * y) + Float64(Float64(a * 27.0) * b)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+90], N[(N[(N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;\left(t \cdot \left(-9 \cdot z\right)\right) \cdot y + \left(a \cdot 27\right) \cdot b\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.8
Applied rewrites80.8%
Applied rewrites85.0%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -1e+90)
(fma (* y z) (* t -9.0) (* (* 27.0 a) b))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* t (* -9.0 y)) z x))))))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) * t;
double tmp;
if (t_1 <= -1e+90) {
tmp = fma((y * z), (t * -9.0), ((27.0 * a) * b));
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -1e+90) tmp = fma(Float64(y * z), Float64(t * -9.0), Float64(Float64(27.0 * a) * b)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+90], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision] + N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z, t \cdot -9, \left(27 \cdot a\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
Taylor expanded in x around 0
fp-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-*.f6480.7
Applied rewrites80.7%
Applied rewrites80.6%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* b a) 27.0)) (t_2 (* (* (* y 9.0) z) t)))
(if (<= t_2 -1e+90)
(fma -9.0 (* (* z y) t) t_1)
(if (<= t_2 0.74) (fma 2.0 x t_1) (+ x (fma (* t (* -9.0 y)) z x))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * a) * 27.0;
double t_2 = ((y * 9.0) * z) * t;
double tmp;
if (t_2 <= -1e+90) {
tmp = fma(-9.0, ((z * y) * t), t_1);
} else if (t_2 <= 0.74) {
tmp = fma(2.0, x, t_1);
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * a) * 27.0) t_2 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_2 <= -1e+90) tmp = fma(-9.0, Float64(Float64(z * y) * t), t_1); elseif (t_2 <= 0.74) tmp = fma(2.0, x, t_1); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+90], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.74], N[(2.0 * x + t$95$1), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 27\\
t_2 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
Taylor expanded in x around 0
fp-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-*.f6480.7
Applied rewrites80.7%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -1e+90)
(+ x (fma (* (* z t) -9.0) y x))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* t (* -9.0 y)) z x))))))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) * t;
double tmp;
if (t_1 <= -1e+90) {
tmp = x + fma(((z * t) * -9.0), y, x);
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -1e+90) tmp = Float64(x + fma(Float64(Float64(z * t) * -9.0), y, x)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+90], N[(x + N[(N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] * y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;x + \mathsf{fma}\left(\left(z \cdot t\right) \cdot -9, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval85.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.7
Applied rewrites74.7%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -1e+90)
(+ x (fma y (* t (* -9.0 z)) x))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* t (* -9.0 y)) z x))))))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) * t;
double tmp;
if (t_1 <= -1e+90) {
tmp = x + fma(y, (t * (-9.0 * z)), x);
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((t * (-9.0 * y)), z, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -1e+90) tmp = Float64(x + fma(y, Float64(t * Float64(-9.0 * z)), x)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(t * Float64(-9.0 * y)), z, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+90], N[(x + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(-9.0 * y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;x + \mathsf{fma}\left(y, t \cdot \left(-9 \cdot z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(t \cdot \left(-9 \cdot y\right), z, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval85.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites74.6%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (<= t_1 -1e+90)
(+ x (fma y (* t (* -9.0 z)) x))
(if (<= t_1 0.74)
(fma 2.0 x (* (* b a) 27.0))
(+ x (fma (* -9.0 z) (* y t) x))))))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) * t;
double tmp;
if (t_1 <= -1e+90) {
tmp = x + fma(y, (t * (-9.0 * z)), x);
} else if (t_1 <= 0.74) {
tmp = fma(2.0, x, ((b * a) * 27.0));
} else {
tmp = x + fma((-9.0 * z), (y * t), x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if (t_1 <= -1e+90) tmp = Float64(x + fma(y, Float64(t * Float64(-9.0 * z)), x)); elseif (t_1 <= 0.74) tmp = fma(2.0, x, Float64(Float64(b * a) * 27.0)); else tmp = Float64(x + fma(Float64(-9.0 * z), Float64(y * t), x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+90], N[(x + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.74], N[(2.0 * x + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-9.0 * z), $MachinePrecision] * N[(y * t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90}:\\
\;\;\;\;x + \mathsf{fma}\left(y, t \cdot \left(-9 \cdot z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 0.74:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(-9 \cdot z, y \cdot t, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89Initial program 85.1%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval85.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.1
Applied rewrites85.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites74.6%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 0.73999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
Applied rewrites93.4%
if 0.73999999999999999 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 90.6%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval92.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in a around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied rewrites82.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (or (<= t_1 -1e+90) (not (<= t_1 1e+82)))
(* -9.0 (* (* y z) t))
(fma 2.0 x (* (* b a) 27.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * 9.0) * z) * t;
double tmp;
if ((t_1 <= -1e+90) || !(t_1 <= 1e+82)) {
tmp = -9.0 * ((y * z) * t);
} else {
tmp = fma(2.0, x, ((b * a) * 27.0));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if ((t_1 <= -1e+90) || !(t_1 <= 1e+82)) tmp = Float64(-9.0 * Float64(Float64(y * z) * t)); else tmp = fma(2.0, x, 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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+90], N[Not[LessEqual[t$95$1, 1e+82]], $MachinePrecision]], N[(-9.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * x + 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])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90} \lor \neg \left(t\_1 \leq 10^{+82}\right):\\
\;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89 or 9.9999999999999996e81 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.8%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval87.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
Applied rewrites87.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6476.6
Applied rewrites76.6%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e81Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.3
Applied rewrites90.3%
Final simplification85.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* (* y 9.0) z) t)))
(if (or (<= t_1 -1e+90) (not (<= t_1 1e+82)))
(* -9.0 (* (* y z) t))
(+ x (fma (* b a) 27.0 x)))))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) * t;
double tmp;
if ((t_1 <= -1e+90) || !(t_1 <= 1e+82)) {
tmp = -9.0 * ((y * z) * t);
} else {
tmp = x + fma((b * a), 27.0, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * 9.0) * z) * t) tmp = 0.0 if ((t_1 <= -1e+90) || !(t_1 <= 1e+82)) tmp = Float64(-9.0 * Float64(Float64(y * z) * t)); else tmp = Float64(x + fma(Float64(b * a), 27.0, x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+90], N[Not[LessEqual[t$95$1, 1e+82]], $MachinePrecision]], N[(-9.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(b * a), $MachinePrecision] * 27.0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+90} \lor \neg \left(t\_1 \leq 10^{+82}\right):\\
\;\;\;\;-9 \cdot \left(\left(y \cdot z\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(b \cdot a, 27, x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -9.99999999999999966e89 or 9.9999999999999996e81 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) Initial program 86.8%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval87.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
Applied rewrites87.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
Taylor expanded in y around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6476.6
Applied rewrites76.6%
if -9.99999999999999966e89 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.9999999999999996e81Initial program 99.8%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6490.3
Applied rewrites90.3%
Final simplification85.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* (* y 9.0) z) 5e+283) (+ x (- x (fma (* -27.0 a) b (* t (* z (* 9.0 y)))))) (fma (* b a) 27.0 (* (* (* -9.0 y) t) z))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 5e+283) {
tmp = x + (x - fma((-27.0 * a), b, (t * (z * (9.0 * y)))));
} else {
tmp = fma((b * a), 27.0, (((-9.0 * y) * t) * z));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 5e+283) tmp = Float64(x + Float64(x - fma(Float64(-27.0 * a), b, Float64(t * Float64(z * Float64(9.0 * y)))))); else tmp = fma(Float64(b * a), 27.0, 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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+283], N[(x + N[(x - N[(N[(-27.0 * a), $MachinePrecision] * b + N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * 27.0 + 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])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+283}:\\
\;\;\;\;x + \left(x - \mathsf{fma}\left(-27 \cdot a, b, t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot a, 27, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5.0000000000000004e283Initial program 97.4%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval97.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.8
Applied rewrites97.8%
if 5.0000000000000004e283 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 46.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.2
Applied rewrites38.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f6438.2
Applied rewrites92.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -5e+54) (fma (* t z) (* -9.0 y) (fma (* b 27.0) a (* 2.0 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);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+54) {
tmp = fma((t * z), (-9.0 * y), fma((b * 27.0), a, (2.0 * 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]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+54) tmp = fma(Float64(t * z), Float64(-9.0 * y), fma(Float64(b * 27.0), a, Float64(2.0 * 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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -5e+54], N[(N[(t * z), $MachinePrecision] * N[(-9.0 * y), $MachinePrecision] + N[(N[(b * 27.0), $MachinePrecision] * a + N[(2.0 * x), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot z, -9 \cdot y, \mathsf{fma}\left(b \cdot 27, a, 2 \cdot x\right)\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 (*.f64 y #s(literal 9 binary64)) < -5.00000000000000005e54Initial program 85.4%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
if -5.00000000000000005e54 < (*.f64 y #s(literal 9 binary64)) Initial program 97.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6498.4
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites95.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (* a 27.0) b))) (if (or (<= t_1 -1e+63) (not (<= t_1 1e+44))) (* (* b a) 27.0) (+ x x))))
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+63) || !(t_1 <= 1e+44)) {
tmp = (b * a) * 27.0;
} else {
tmp = x + x;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a * 27.0d0) * b
if ((t_1 <= (-1d+63)) .or. (.not. (t_1 <= 1d+44))) then
tmp = (b * a) * 27.0d0
else
tmp = x + x
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * 27.0) * b;
double tmp;
if ((t_1 <= -1e+63) || !(t_1 <= 1e+44)) {
tmp = (b * a) * 27.0;
} else {
tmp = x + x;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if (t_1 <= -1e+63) or not (t_1 <= 1e+44): tmp = (b * a) * 27.0 else: tmp = x + x return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * 27.0) * b) tmp = 0.0 if ((t_1 <= -1e+63) || !(t_1 <= 1e+44)) tmp = Float64(Float64(b * a) * 27.0); else tmp = Float64(x + x); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (a * 27.0) * b;
tmp = 0.0;
if ((t_1 <= -1e+63) || ~((t_1 <= 1e+44)))
tmp = (b * a) * 27.0;
else
tmp = 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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+63], N[Not[LessEqual[t$95$1, 1e+44]], $MachinePrecision]], N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision], N[(x + x), $MachinePrecision]]]
\begin{array}{l}
[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^{+63} \lor \neg \left(t\_1 \leq 10^{+44}\right):\\
\;\;\;\;\left(b \cdot a\right) \cdot 27\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\end{array}
if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.00000000000000006e63 or 1.0000000000000001e44 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) Initial program 95.4%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.7
Applied rewrites74.7%
Taylor expanded in x around 0
Applied rewrites69.3%
if -1.00000000000000006e63 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 1.0000000000000001e44Initial program 94.7%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval94.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.7
Applied rewrites94.7%
Taylor expanded in x around inf
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites46.5%
Final simplification54.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 4e-16) (fma y (* (* -9.0 z) t) (fma (* b 27.0) a (* 2.0 x))) (+ x (- x (fma (* -27.0 a) b (* t (* z (* 9.0 y))))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4e-16) {
tmp = fma(y, ((-9.0 * z) * t), fma((b * 27.0), a, (2.0 * x)));
} else {
tmp = x + (x - fma((-27.0 * a), b, (t * (z * (9.0 * y)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4e-16) tmp = fma(y, Float64(Float64(-9.0 * z) * t), fma(Float64(b * 27.0), a, Float64(2.0 * x))); else tmp = Float64(x + Float64(x - fma(Float64(-27.0 * a), b, Float64(t * Float64(z * Float64(9.0 * y)))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4e-16], N[(y * N[(N[(-9.0 * z), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * 27.0), $MachinePrecision] * a + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x - N[(N[(-27.0 * a), $MachinePrecision] * b + N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(y, \left(-9 \cdot z\right) \cdot t, \mathsf{fma}\left(b \cdot 27, a, 2 \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(x - \mathsf{fma}\left(-27 \cdot a, b, t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.9999999999999999e-16Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
associate-*l*N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.3%
if 3.9999999999999999e-16 < z Initial program 92.9%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval93.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.0
Applied rewrites93.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ x (fma (* b a) 27.0 x)))
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 + fma((b * a), 27.0, x);
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x + fma(Float64(b * a), 27.0, x)) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(b * a), $MachinePrecision] * 27.0 + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x + \mathsf{fma}\left(b \cdot a, 27, x\right)
\end{array}
Initial program 95.0%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
Applied rewrites95.4%
Taylor expanded in y around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (fma (* 27.0 a) b (+ x x)))
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((27.0 * a), b, (x + x));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return fma(Float64(27.0 * a), b, Float64(x + x)) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(27.0 * a), $MachinePrecision] * b + N[(x + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(27 \cdot a, b, x + x\right)
\end{array}
Initial program 95.0%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
Applied rewrites63.3%
Applied rewrites63.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (fma (* 27.0 b) a x) x))
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((27.0 * b), a, x) + x;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(fma(Float64(27.0 * b), a, x) + x) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(27.0 * b), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(27 \cdot b, a, x\right) + x
\end{array}
Initial program 95.0%
Taylor expanded in y around 0
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
Applied rewrites63.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ x x))
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.
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;
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]) def code(x, y, z, t, a, b): return x + x
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])){:}
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. 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 + x
\end{array}
Initial program 95.0%
lift-+.f64N/A
lift--.f64N/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
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval95.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.4
Applied rewrites95.4%
Taylor expanded in x around inf
lower-*.f6433.1
Applied rewrites33.1%
Applied rewrites33.1%
(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 2024326
(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)))