Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E

Percentage Accurate: 85.0% → 92.8%
Time: 31.9s
Alternatives: 18
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 85.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

Alternative 1: 92.8% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\ \mathbf{if}\;t\_2 \leq 5 \cdot 10^{+301}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k))
        (t_2
         (-
          (-
           (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
           (* (* x 4.0) i))
          t_1)))
   (if (<= t_2 5e+301)
     t_2
     (if (<= t_2 INFINITY)
       (-
        (fma
         y
         (* (* x 18.0) (* z t))
         (fma t (* a -4.0) (fma b c (* x (* i -4.0)))))
        t_1)
       (fma (fma y (* 18.0 (* z t)) (* i -4.0)) x (* b c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double t_2 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1;
	double tmp;
	if (t_2 <= 5e+301) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = fma(y, ((x * 18.0) * (z * t)), fma(t, (a * -4.0), fma(b, c, (x * (i * -4.0))))) - t_1;
	} else {
		tmp = fma(fma(y, (18.0 * (z * t)), (i * -4.0)), x, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1)
	tmp = 0.0
	if (t_2 <= 5e+301)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = Float64(fma(y, Float64(Float64(x * 18.0) * Float64(z * t)), fma(t, Float64(a * -4.0), fma(b, c, Float64(x * Float64(i * -4.0))))) - t_1);
	else
		tmp = fma(fma(y, Float64(18.0 * Float64(z * t)), Float64(i * -4.0)), x, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+301], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(y * N[(N[(x * 18.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y * N[(18.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < 5.0000000000000004e301

    1. Initial program 99.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing

    if 5.0000000000000004e301 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 89.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites96.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]

    if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k))

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites76.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6476.0

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6488.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites88.0%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{+301}:\\ \;\;\;\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 74.4% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ t_2 := \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+239}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma (fma y (* 18.0 (* z t)) (* i -4.0)) x (* b c)))
        (t_2
         (-
          (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
          (* (* x 4.0) i))))
   (if (<= t_2 -2e+239)
     t_1
     (if (<= t_2 2e+294) (fma b c (fma -4.0 (* t a) (* j (* k -27.0)))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(fma(y, (18.0 * (z * t)), (i * -4.0)), x, (b * c));
	double t_2 = ((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i);
	double tmp;
	if (t_2 <= -2e+239) {
		tmp = t_1;
	} else if (t_2 <= 2e+294) {
		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(fma(y, Float64(18.0 * Float64(z * t)), Float64(i * -4.0)), x, Float64(b * c))
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i))
	tmp = 0.0
	if (t_2 <= -2e+239)
		tmp = t_1;
	elseif (t_2 <= 2e+294)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(y * N[(18.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+239], t$95$1, If[LessEqual[t$95$2, 2e+294], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\
t_2 := \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1.99999999999999998e239 or 2.00000000000000013e294 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 75.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites83.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6483.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites89.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6487.6

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites87.6%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]

    if -1.99999999999999998e239 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 2.00000000000000013e294

    1. Initial program 99.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6473.1

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites73.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq -2 \cdot 10^{+239}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \mathbf{elif}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq 2 \cdot 10^{+294}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<=
        (-
         (-
          (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
          (* (* x 4.0) i))
         t_1)
        INFINITY)
     (-
      (fma
       y
       (* (* x 18.0) (* z t))
       (fma t (* a -4.0) (fma b c (* x (* i -4.0)))))
      t_1)
     (fma (fma y (* 18.0 (* z t)) (* i -4.0)) x (* b c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
		tmp = fma(y, ((x * 18.0) * (z * t)), fma(t, (a * -4.0), fma(b, c, (x * (i * -4.0))))) - t_1;
	} else {
		tmp = fma(fma(y, (18.0 * (z * t)), (i * -4.0)), x, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1) <= Inf)
		tmp = Float64(fma(y, Float64(Float64(x * 18.0) * Float64(z * t)), fma(t, Float64(a * -4.0), fma(b, c, Float64(x * Float64(i * -4.0))))) - t_1);
	else
		tmp = fma(fma(y, Float64(18.0 * Float64(z * t)), Float64(i * -4.0)), x, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], Infinity], N[(N[(y * N[(N[(x * 18.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y * N[(18.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 96.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Applied rewrites94.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]

    if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k))

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites76.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6476.0

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6488.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites88.0%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(y, \left(x \cdot 18\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.0% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1
         (fma
          (fma y (* 18.0 (* z t)) (* i -4.0))
          x
          (fma j (* k -27.0) (* b c)))))
   (if (<= x -1.15e-185)
     t_1
     (if (<= x 1.25e-146)
       (fma b c (fma -4.0 (* t a) (* j (* k -27.0))))
       t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(fma(y, (18.0 * (z * t)), (i * -4.0)), x, fma(j, (k * -27.0), (b * c)));
	double tmp;
	if (x <= -1.15e-185) {
		tmp = t_1;
	} else if (x <= 1.25e-146) {
		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(fma(y, Float64(18.0 * Float64(z * t)), Float64(i * -4.0)), x, fma(j, Float64(k * -27.0), Float64(b * c)))
	tmp = 0.0
	if (x <= -1.15e-185)
		tmp = t_1;
	elseif (x <= 1.25e-146)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(y * N[(18.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x + N[(j * N[(k * -27.0), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e-185], t$95$1, If[LessEqual[x, 1.25e-146], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-185 or 1.24999999999999989e-146 < x

    1. Initial program 83.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites82.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6482.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites86.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]

    if -1.15e-185 < x < 1.24999999999999989e-146

    1. Initial program 96.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6487.0

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites87.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(z \cdot t\right), i \cdot -4\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 82.3% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := j \cdot \left(k \cdot -27\right)\\ t_2 := \mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, t\_1\right)\right)\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* j (* k -27.0)))
        (t_2 (fma x (fma -4.0 i (* t (* 18.0 (* y z)))) (fma b c t_1))))
   (if (<= x -1.15e-185)
     t_2
     (if (<= x 1.25e-146) (fma b c (fma -4.0 (* t a) t_1)) t_2))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = j * (k * -27.0);
	double t_2 = fma(x, fma(-4.0, i, (t * (18.0 * (y * z)))), fma(b, c, t_1));
	double tmp;
	if (x <= -1.15e-185) {
		tmp = t_2;
	} else if (x <= 1.25e-146) {
		tmp = fma(b, c, fma(-4.0, (t * a), t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(j * Float64(k * -27.0))
	t_2 = fma(x, fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))), fma(b, c, t_1))
	tmp = 0.0
	if (x <= -1.15e-185)
		tmp = t_2;
	elseif (x <= 1.25e-146)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), t_1));
	else
		tmp = t_2;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e-185], t$95$2, If[LessEqual[x, 1.25e-146], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := \mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, t\_1\right)\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, t\_1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-185 or 1.24999999999999989e-146 < x

    1. Initial program 83.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites82.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]

    if -1.15e-185 < x < 1.24999999999999989e-146

    1. Initial program 96.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6487.0

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites87.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-185}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-146}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 55.2% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -500:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -500.0)
     (fma (* j -27.0) k (* b c))
     (if (<= t_1 2e+131)
       (fma (* i -4.0) x (* b c))
       (fma (* j k) -27.0 (* b c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -500.0) {
		tmp = fma((j * -27.0), k, (b * c));
	} else if (t_1 <= 2e+131) {
		tmp = fma((i * -4.0), x, (b * c));
	} else {
		tmp = fma((j * k), -27.0, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_1 <= -500.0)
		tmp = fma(Float64(j * -27.0), k, Float64(b * c));
	elseif (t_1 <= 2e+131)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	else
		tmp = fma(Float64(j * k), -27.0, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+131], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -500

    1. Initial program 81.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6450.6

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites50.6%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6453.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites53.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]

    if -500 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999998e131

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites74.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6474.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites78.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6477.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites77.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6453.5

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites53.5%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]

    if 1.9999999999999998e131 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 96.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6480.5

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites80.5%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + b \cdot c \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
      16. lower-*.f6480.7

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot k}, -27, b \cdot c\right) \]
    7. Applied rewrites80.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -500:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.3% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -500:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma (* j -27.0) k (* b c))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -500.0)
     t_1
     (if (<= t_2 2e+131) (fma (* i -4.0) x (* b c)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma((j * -27.0), k, (b * c));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -500.0) {
		tmp = t_1;
	} else if (t_2 <= 2e+131) {
		tmp = fma((i * -4.0), x, (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(Float64(j * -27.0), k, Float64(b * c))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -500.0)
		tmp = t_1;
	elseif (t_2 <= 2e+131)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * -27.0), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -500.0], t$95$1, If[LessEqual[t$95$2, 2e+131], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -500:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -500 or 1.9999999999999998e131 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6461.0

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites61.0%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + b \cdot c \]
      15. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot -27\right) \cdot k} + b \cdot c \]
      16. metadata-evalN/A

        \[\leadsto \left(j \cdot \color{blue}{\left(\mathsf{neg}\left(27\right)\right)}\right) \cdot k + b \cdot c \]
      17. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right)} \cdot k + b \cdot c \]
      18. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k + b \cdot c \]
      19. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(j \cdot 27\right), k, b \cdot c\right)} \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right), k, b \cdot c\right) \]
      21. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot \left(\mathsf{neg}\left(27\right)\right)}, k, b \cdot c\right) \]
      22. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(j \cdot \color{blue}{-27}, k, b \cdot c\right) \]
      23. lower-*.f6463.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot -27}, k, b \cdot c\right) \]
    7. Applied rewrites63.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)} \]

    if -500 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999998e131

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites74.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6474.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites78.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6477.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites77.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6453.5

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites53.5%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -500:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot -27, k, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 52.9% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+140}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+140)
     t_1
     (if (<= t_2 1e+140) (fma (* i -4.0) x (* b c)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+140) {
		tmp = t_1;
	} else if (t_2 <= 1e+140) {
		tmp = fma((i * -4.0), x, (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-27.0 * Float64(j * k))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+140)
		tmp = t_1;
	elseif (t_2 <= 1e+140)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+140], t$95$1, If[LessEqual[t$95$2, 1e+140], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000012e140 or 1.00000000000000006e140 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 87.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites87.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6487.6

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites88.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6456.3

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites56.3%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -2.00000000000000012e140 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000006e140

    1. Initial program 87.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites73.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6473.8

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6473.5

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites73.5%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6451.8

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites51.8%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+140}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 10^{+140}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.6% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.85 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{elif}\;b \cdot c \leq 0.0047:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -2.85e+131)
   (fma (* i -4.0) x (* b c))
   (if (<= (* b c) 0.0047)
     (- (* -4.0 (* t a)) (* (* j 27.0) k))
     (fma (* j k) -27.0 (* b c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -2.85e+131) {
		tmp = fma((i * -4.0), x, (b * c));
	} else if ((b * c) <= 0.0047) {
		tmp = (-4.0 * (t * a)) - ((j * 27.0) * k);
	} else {
		tmp = fma((j * k), -27.0, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -2.85e+131)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	elseif (Float64(b * c) <= 0.0047)
		tmp = Float64(Float64(-4.0 * Float64(t * a)) - Float64(Float64(j * 27.0) * k));
	else
		tmp = fma(Float64(j * k), -27.0, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2.85e+131], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 0.0047], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2.85 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{elif}\;b \cdot c \leq 0.0047:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -2.85e131

    1. Initial program 84.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites89.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6489.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites95.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6495.7

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites95.7%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6483.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites83.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]

    if -2.85e131 < (*.f64 b c) < 0.00470000000000000018

    1. Initial program 87.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6448.5

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites48.5%

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]

    if 0.00470000000000000018 < (*.f64 b c)

    1. Initial program 87.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6464.6

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites64.6%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + b \cdot c \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
      16. lower-*.f6464.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot k}, -27, b \cdot c\right) \]
    7. Applied rewrites64.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.85 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{elif}\;b \cdot c \leq 0.0047:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.5% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -1.82 \cdot 10^{-35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* t (fma -4.0 a (* 18.0 (* y (* x z)))))))
   (if (<= t -1.82e-35)
     t_1
     (if (<= t -8e-263)
       (fma (* j k) -27.0 (* b c))
       (if (<= t 4.7e+34) (fma (* i -4.0) x (* b c)) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = t * fma(-4.0, a, (18.0 * (y * (x * z))));
	double tmp;
	if (t <= -1.82e-35) {
		tmp = t_1;
	} else if (t <= -8e-263) {
		tmp = fma((j * k), -27.0, (b * c));
	} else if (t <= 4.7e+34) {
		tmp = fma((i * -4.0), x, (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(y * Float64(x * z)))))
	tmp = 0.0
	if (t <= -1.82e-35)
		tmp = t_1;
	elseif (t <= -8e-263)
		tmp = fma(Float64(j * k), -27.0, Float64(b * c));
	elseif (t <= 4.7e+34)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.82e-35], t$95$1, If[LessEqual[t, -8e-263], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.7e+34], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.82 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\

\mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.82000000000000003e-35 or 4.70000000000000015e34 < t

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6468.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites68.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      4. lower-*.f6469.8

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(\color{blue}{\left(x \cdot z\right)} \cdot y\right)\right) \]
    7. Applied rewrites69.8%

      \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]

    if -1.82000000000000003e-35 < t < -8.0000000000000001e-263

    1. Initial program 92.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6464.5

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites64.5%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + b \cdot c \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
      16. lower-*.f6464.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot k}, -27, b \cdot c\right) \]
    7. Applied rewrites64.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]

    if -8.0000000000000001e-263 < t < 4.70000000000000015e34

    1. Initial program 85.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites79.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6479.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites88.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6471.8

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites71.8%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6466.1

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites66.1%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.82 \cdot 10^{-35}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.2% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{-35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
   (if (<= t -2.6e-35)
     t_1
     (if (<= t -8e-263)
       (fma (* j k) -27.0 (* b c))
       (if (<= t 4.7e+34) (fma (* i -4.0) x (* b c)) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
	double tmp;
	if (t <= -2.6e-35) {
		tmp = t_1;
	} else if (t <= -8e-263) {
		tmp = fma((j * k), -27.0, (b * c));
	} else if (t <= 4.7e+34) {
		tmp = fma((i * -4.0), x, (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))))
	tmp = 0.0
	if (t <= -2.6e-35)
		tmp = t_1;
	elseif (t <= -8e-263)
		tmp = fma(Float64(j * k), -27.0, Float64(b * c));
	elseif (t <= 4.7e+34)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e-35], t$95$1, If[LessEqual[t, -8e-263], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.7e+34], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\

\mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.60000000000000005e-35 or 4.70000000000000015e34 < t

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6468.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites68.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]

    if -2.60000000000000005e-35 < t < -8.0000000000000001e-263

    1. Initial program 92.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6464.5

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites64.5%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + b \cdot c \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
      16. lower-*.f6464.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot k}, -27, b \cdot c\right) \]
    7. Applied rewrites64.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]

    if -8.0000000000000001e-263 < t < 4.70000000000000015e34

    1. Initial program 85.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites79.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6479.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites88.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6471.8

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites71.8%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6466.1

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites66.1%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{-35}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+34}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.1% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.36 \cdot 10^{+93}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq -1.45 \cdot 10^{-69}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;b \cdot c \leq 4100000000:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -1.36e+93)
   (* b c)
   (if (<= (* b c) -1.45e-69)
     (* -27.0 (* j k))
     (if (<= (* b c) 4100000000.0) (* -4.0 (* t a)) (* b c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -1.36e+93) {
		tmp = b * c;
	} else if ((b * c) <= -1.45e-69) {
		tmp = -27.0 * (j * k);
	} else if ((b * c) <= 4100000000.0) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = b * c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((b * c) <= (-1.36d+93)) then
        tmp = b * c
    else if ((b * c) <= (-1.45d-69)) then
        tmp = (-27.0d0) * (j * k)
    else if ((b * c) <= 4100000000.0d0) then
        tmp = (-4.0d0) * (t * a)
    else
        tmp = b * c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -1.36e+93) {
		tmp = b * c;
	} else if ((b * c) <= -1.45e-69) {
		tmp = -27.0 * (j * k);
	} else if ((b * c) <= 4100000000.0) {
		tmp = -4.0 * (t * a);
	} else {
		tmp = b * c;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -1.36e+93:
		tmp = b * c
	elif (b * c) <= -1.45e-69:
		tmp = -27.0 * (j * k)
	elif (b * c) <= 4100000000.0:
		tmp = -4.0 * (t * a)
	else:
		tmp = b * c
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -1.36e+93)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= -1.45e-69)
		tmp = Float64(-27.0 * Float64(j * k));
	elseif (Float64(b * c) <= 4100000000.0)
		tmp = Float64(-4.0 * Float64(t * a));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if ((b * c) <= -1.36e+93)
		tmp = b * c;
	elseif ((b * c) <= -1.45e-69)
		tmp = -27.0 * (j * k);
	elseif ((b * c) <= 4100000000.0)
		tmp = -4.0 * (t * a);
	else
		tmp = b * c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.36e+93], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.45e-69], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4100000000.0], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.36 \cdot 10^{+93}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;b \cdot c \leq -1.45 \cdot 10^{-69}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

\mathbf{elif}\;b \cdot c \leq 4100000000:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -1.3599999999999999e93 or 4.1e9 < (*.f64 b c)

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f6456.3

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites56.3%

      \[\leadsto \color{blue}{b \cdot c} \]

    if -1.3599999999999999e93 < (*.f64 b c) < -1.4499999999999999e-69

    1. Initial program 91.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites91.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6491.8

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites91.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6437.2

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites37.2%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]

    if -1.4499999999999999e-69 < (*.f64 b c) < 4.1e9

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      2. lower-*.f6428.8

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    5. Applied rewrites28.8%

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.36 \cdot 10^{+93}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq -1.45 \cdot 10^{-69}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;b \cdot c \leq 4100000000:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 55.8% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.4 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{elif}\;b \cdot c \leq 0.00106:\\ \;\;\;\;\mathsf{fma}\left(x \cdot -4, i, j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -2.4e+129)
   (fma (* i -4.0) x (* b c))
   (if (<= (* b c) 0.00106)
     (fma (* x -4.0) i (* j (* k -27.0)))
     (fma (* j k) -27.0 (* b c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -2.4e+129) {
		tmp = fma((i * -4.0), x, (b * c));
	} else if ((b * c) <= 0.00106) {
		tmp = fma((x * -4.0), i, (j * (k * -27.0)));
	} else {
		tmp = fma((j * k), -27.0, (b * c));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -2.4e+129)
		tmp = fma(Float64(i * -4.0), x, Float64(b * c));
	elseif (Float64(b * c) <= 0.00106)
		tmp = fma(Float64(x * -4.0), i, Float64(j * Float64(k * -27.0)));
	else
		tmp = fma(Float64(j * k), -27.0, Float64(b * c));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2.4e+129], N[(N[(i * -4.0), $MachinePrecision] * x + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 0.00106], N[(N[(x * -4.0), $MachinePrecision] * i + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2.4 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\

\mathbf{elif}\;b \cdot c \leq 0.00106:\\
\;\;\;\;\mathsf{fma}\left(x \cdot -4, i, j \cdot \left(k \cdot -27\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -2.3999999999999999e129

    1. Initial program 84.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites89.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6489.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites95.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6495.7

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    10. Applied rewrites95.7%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \color{blue}{b \cdot c}\right) \]
    11. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    12. Step-by-step derivation
      1. lower-*.f6483.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]
    13. Applied rewrites83.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, b \cdot c\right) \]

    if -2.3999999999999999e129 < (*.f64 b c) < 0.00105999999999999996

    1. Initial program 87.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} - \left(j \cdot 27\right) \cdot k \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      3. lower-*.f6445.0

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites45.0%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      3. *-commutativeN/A

        \[\leadsto -4 \cdot \left(x \cdot i\right) - \color{blue}{\left(27 \cdot j\right)} \cdot k \]
      4. associate-*l*N/A

        \[\leadsto -4 \cdot \left(x \cdot i\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      5. lift-*.f64N/A

        \[\leadsto -4 \cdot \left(x \cdot i\right) - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right) \]
      8. lift-*.f64N/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right) \]
      9. associate-*r*N/A

        \[\leadsto \color{blue}{\left(-4 \cdot x\right) \cdot i} + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right) \]
      10. metadata-evalN/A

        \[\leadsto \left(-4 \cdot x\right) \cdot i + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(-4 \cdot x\right) \cdot i + \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      12. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot x\right) \cdot i + \color{blue}{\left(j \cdot k\right)} \cdot -27 \]
      13. associate-*r*N/A

        \[\leadsto \left(-4 \cdot x\right) \cdot i + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      14. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot x\right) \cdot i + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4 \cdot x, i, j \cdot \left(k \cdot -27\right)\right)} \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot -4}, i, j \cdot \left(k \cdot -27\right)\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot -4}, i, j \cdot \left(k \cdot -27\right)\right) \]
      18. lower-*.f6445.1

        \[\leadsto \mathsf{fma}\left(x \cdot -4, i, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
    7. Applied rewrites45.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot -4, i, j \cdot \left(k \cdot -27\right)\right)} \]

    if 0.00105999999999999996 < (*.f64 b c)

    1. Initial program 87.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. lower-*.f6464.6

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Applied rewrites64.6%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      2. lift-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(j \cdot 27\right)} \cdot k \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} \]
      4. lift-*.f64N/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(\color{blue}{j \cdot 27}\right)\right) \cdot k \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto b \cdot c + \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)} \cdot k \]
      6. metadata-evalN/A

        \[\leadsto b \cdot c + \left(j \cdot \color{blue}{-27}\right) \cdot k \]
      7. associate-*r*N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      8. *-commutativeN/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      9. lift-*.f64N/A

        \[\leadsto b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      10. lift-*.f64N/A

        \[\leadsto b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)} \]
      11. +-commutativeN/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right) + b \cdot c} \]
      12. lift-*.f64N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + b \cdot c \]
      13. lift-*.f64N/A

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} + b \cdot c \]
      14. associate-*r*N/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + b \cdot c \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
      16. lower-*.f6464.6

        \[\leadsto \mathsf{fma}\left(\color{blue}{j \cdot k}, -27, b \cdot c\right) \]
    7. Applied rewrites64.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.4 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, b \cdot c\right)\\ \mathbf{elif}\;b \cdot c \leq 0.00106:\\ \;\;\;\;\mathsf{fma}\left(x \cdot -4, i, j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 72.8% accurate, 1.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t -9.8e+56)
   (* t (fma -4.0 a (* 18.0 (* x (* y z)))))
   (if (<= t 2.55e+35)
     (fma (* i -4.0) x (fma j (* k -27.0) (* b c)))
     (* t (fma -4.0 a (* 18.0 (* y (* x z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (t <= -9.8e+56) {
		tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
	} else if (t <= 2.55e+35) {
		tmp = fma((i * -4.0), x, fma(j, (k * -27.0), (b * c)));
	} else {
		tmp = t * fma(-4.0, a, (18.0 * (y * (x * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= -9.8e+56)
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))));
	elseif (t <= 2.55e+35)
		tmp = fma(Float64(i * -4.0), x, fma(j, Float64(k * -27.0), Float64(b * c)));
	else
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(y * Float64(x * z)))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -9.8e+56], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e+35], N[(N[(i * -4.0), $MachinePrecision] * x + N[(j * N[(k * -27.0), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * a + N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.8000000000000005e56

    1. Initial program 85.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6474.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites74.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]

    if -9.8000000000000005e56 < t < 2.55000000000000009e35

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites80.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6480.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites86.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in y around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6475.7

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right) \]
    10. Applied rewrites75.7%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot i}, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right) \]

    if 2.55000000000000009e35 < t

    1. Initial program 84.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6471.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites71.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      4. lower-*.f6475.0

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(\color{blue}{\left(x \cdot z\right)} \cdot y\right)\right) \]
    7. Applied rewrites75.0%

      \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 72.8% accurate, 1.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t -9.8e+56)
   (* t (fma -4.0 a (* 18.0 (* x (* y z)))))
   (if (<= t 2.55e+35)
     (fma x (* i -4.0) (fma b c (* j (* k -27.0))))
     (* t (fma -4.0 a (* 18.0 (* y (* x z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (t <= -9.8e+56) {
		tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
	} else if (t <= 2.55e+35) {
		tmp = fma(x, (i * -4.0), fma(b, c, (j * (k * -27.0))));
	} else {
		tmp = t * fma(-4.0, a, (18.0 * (y * (x * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= -9.8e+56)
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))));
	elseif (t <= 2.55e+35)
		tmp = fma(x, Float64(i * -4.0), fma(b, c, Float64(j * Float64(k * -27.0))));
	else
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(y * Float64(x * z)))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -9.8e+56], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e+35], N[(x * N[(i * -4.0), $MachinePrecision] + N[(b * c + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * a + N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.8000000000000005e56

    1. Initial program 85.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6474.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites74.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]

    if -9.8000000000000005e56 < t < 2.55000000000000009e35

    1. Initial program 88.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites80.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in i around inf

      \[\leadsto \mathsf{fma}\left(x, \color{blue}{-4 \cdot i}, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right) \]
    7. Step-by-step derivation
      1. lower-*.f6475.1

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{-4 \cdot i}, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right) \]
    8. Applied rewrites75.1%

      \[\leadsto \mathsf{fma}\left(x, \color{blue}{-4 \cdot i}, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right) \]

    if 2.55000000000000009e35 < t

    1. Initial program 84.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot a\right)} \]
      3. metadata-evalN/A

        \[\leadsto t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot a\right) \]
      4. +-commutativeN/A

        \[\leadsto t \cdot \color{blue}{\left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto t \cdot \color{blue}{\mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, \color{blue}{18 \cdot \left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      8. lower-*.f6471.4

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Applied rewrites71.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(z \cdot y\right)}\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      4. lower-*.f6475.0

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(\color{blue}{\left(x \cdot z\right)} \cdot y\right)\right) \]
    7. Applied rewrites75.0%

      \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+56}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 72.8% accurate, 1.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* x (fma -4.0 i (* t (* 18.0 (* y z)))))))
   (if (<= x -7.5e+20)
     t_1
     (if (<= x 7.6e+94) (fma b c (fma -4.0 (* t a) (* j (* k -27.0)))) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = x * fma(-4.0, i, (t * (18.0 * (y * z))));
	double tmp;
	if (x <= -7.5e+20) {
		tmp = t_1;
	} else if (x <= 7.6e+94) {
		tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))))
	tmp = 0.0
	if (x <= -7.5e+20)
		tmp = t_1;
	elseif (x <= 7.6e+94)
		tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+20], t$95$1, If[LessEqual[x, 7.6e+94], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 7.6 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5e20 or 7.5999999999999993e94 < x

    1. Initial program 74.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto x \cdot \color{blue}{\left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right)} \]
      3. metadata-evalN/A

        \[\leadsto x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \color{blue}{-4} \cdot i\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      5. lower-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot 18}\right) \]
      7. associate-*l*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
      8. lower-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
      10. lower-*.f6473.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) \]
    5. Applied rewrites73.9%

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} \]

    if -7.5e20 < x < 7.5999999999999993e94

    1. Initial program 94.8%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      3. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4 \cdot \left(a \cdot t\right)\right)\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)} + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t\right) + \left(\mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right)\right) \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{\left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right) + \color{blue}{-27} \cdot \left(j \cdot k\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\mathsf{fma}\left(-4, a \cdot t, -27 \cdot \left(j \cdot k\right)\right)}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \color{blue}{a \cdot t}, -27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{\left(j \cdot k\right) \cdot -27}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(k \cdot -27\right)}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. lower-*.f6472.2

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
    5. Applied rewrites72.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+20}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 37.5% accurate, 2.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.36 \cdot 10^{+93}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 1.2 \cdot 10^{+182}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -1.36e+93)
   (* b c)
   (if (<= (* b c) 1.2e+182) (* -27.0 (* j k)) (* b c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -1.36e+93) {
		tmp = b * c;
	} else if ((b * c) <= 1.2e+182) {
		tmp = -27.0 * (j * k);
	} else {
		tmp = b * c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((b * c) <= (-1.36d+93)) then
        tmp = b * c
    else if ((b * c) <= 1.2d+182) then
        tmp = (-27.0d0) * (j * k)
    else
        tmp = b * c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -1.36e+93) {
		tmp = b * c;
	} else if ((b * c) <= 1.2e+182) {
		tmp = -27.0 * (j * k);
	} else {
		tmp = b * c;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -1.36e+93:
		tmp = b * c
	elif (b * c) <= 1.2e+182:
		tmp = -27.0 * (j * k)
	else:
		tmp = b * c
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -1.36e+93)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 1.2e+182)
		tmp = Float64(-27.0 * Float64(j * k));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if ((b * c) <= -1.36e+93)
		tmp = b * c;
	elseif ((b * c) <= 1.2e+182)
		tmp = -27.0 * (j * k);
	else
		tmp = b * c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.36e+93], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.2e+182], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.36 \cdot 10^{+93}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;b \cdot c \leq 1.2 \cdot 10^{+182}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1.3599999999999999e93 or 1.20000000000000005e182 < (*.f64 b c)

    1. Initial program 85.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. lower-*.f6468.6

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Applied rewrites68.6%

      \[\leadsto \color{blue}{b \cdot c} \]

    if -1.3599999999999999e93 < (*.f64 b c) < 1.20000000000000005e182

    1. Initial program 88.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{-4} \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right)} - 27 \cdot \left(j \cdot k\right) \]
      5. associate-+r+N/A

        \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + b \cdot c\right)} - 27 \cdot \left(j \cdot k\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right)} \]
    5. Applied rewrites74.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \left(-4 \cdot i + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot 18\right)}\right) + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right)} + \left(b \cdot c + j \cdot \left(k \cdot -27\right)\right) \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \left(b \cdot c + \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      7. lift-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) + \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right) \cdot x} + \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right) \]
      9. lower-fma.f6474.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-4, i, t \cdot \left(\left(y \cdot z\right) \cdot 18\right)\right), x, \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    7. Applied rewrites74.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, 18 \cdot \left(t \cdot z\right), -4 \cdot i\right), x, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
      2. lower-*.f6425.8

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    10. Applied rewrites25.8%

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 23.3% accurate, 11.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ b \cdot c \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = b * c
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	return b * c
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(b * c)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = b * c;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
b \cdot c
\end{array}
Derivation
  1. Initial program 87.1%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Add Preprocessing
  3. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot c} \]
  4. Step-by-step derivation
    1. lower-*.f6427.8

      \[\leadsto \color{blue}{b \cdot c} \]
  5. Applied rewrites27.8%

    \[\leadsto \color{blue}{b \cdot c} \]
  6. Add Preprocessing

Developer Target 1: 89.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
        (t_2
         (-
          (- (* (* 18.0 t) (* (* x y) z)) t_1)
          (- (* (* k j) 27.0) (* c b)))))
   (if (< t -1.6210815397541398e-69)
     t_2
     (if (< t 165.68027943805222)
       (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((a * t) + (i * x)) * 4.0d0
    t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
    if (t < (-1.6210815397541398d-69)) then
        tmp = t_2
    else if (t < 165.68027943805222d0) then
        tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = ((a * t) + (i * x)) * 4.0
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
	tmp = 0
	if t < -1.6210815397541398e-69:
		tmp = t_2
	elif t < 165.68027943805222:
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
	tmp = 0.0
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = ((a * t) + (i * x)) * 4.0;
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	tmp = 0.0;
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024214 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))

  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))