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

Percentage Accurate: 85.6% → 90.2%
Time: 37.9s
Alternatives: 29
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 29 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.6% 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: 90.2% 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])\\ \\ \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(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<=
      (-
       (-
        (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
        (* (* x 4.0) i))
       (* (* j 27.0) k))
      INFINITY)
   (fma
    (fma x (* 18.0 (* y z)) (* a -4.0))
    t
    (- (* b c) (fma x (* 4.0 i) (* 27.0 (* j k)))))
   (fma (fma (* (* x 18.0) z) y (* a -4.0)) t (* b c))))
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 (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
		tmp = fma(fma(x, (18.0 * (y * z)), (a * -4.0)), t, ((b * c) - fma(x, (4.0 * i), (27.0 * (j * k)))));
	} else {
		tmp = fma(fma(((x * 18.0) * z), y, (a * -4.0)), t, (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])
function code(x, y, z, t, a, b, c, i, j, 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)) - Float64(Float64(j * 27.0) * k)) <= Inf)
		tmp = fma(fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), t, Float64(Float64(b * c) - fma(x, Float64(4.0 * i), Float64(27.0 * Float64(j * k)))));
	else
		tmp = fma(fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0)), t, 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := 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] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + 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])\\
\\
\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(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, 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 95.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot z\right) \cdot y} + a \cdot -4, t, b \cdot c\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right)} \cdot z, y, a \cdot -4\right), t, b \cdot c\right) \]
      7. *-lowering-*.f6461.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, \color{blue}{a \cdot -4}\right), t, b \cdot c\right) \]
    9. Applied egg-rr61.3%

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

    \[\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(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 90.2% 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])\\ \\ \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(j \cdot k, -27, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<=
      (-
       (-
        (+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
        (* (* x 4.0) i))
       (* (* j 27.0) k))
      INFINITY)
   (fma
    (* j k)
    -27.0
    (fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (fma b c (* -4.0 (* x i)))))
   (fma (fma (* (* x 18.0) z) y (* a -4.0)) t (* b c))))
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 (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
		tmp = fma((j * k), -27.0, fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), fma(b, c, (-4.0 * (x * i)))));
	} else {
		tmp = fma(fma(((x * 18.0) * z), y, (a * -4.0)), t, (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])
function code(x, y, z, t, a, b, c, i, j, 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)) - Float64(Float64(j * 27.0) * k)) <= Inf)
		tmp = fma(Float64(j * k), -27.0, fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), fma(b, c, Float64(-4.0 * Float64(x * i)))));
	else
		tmp = fma(fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0)), t, 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := 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] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + 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])\\
\\
\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(j \cdot k, -27, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, 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 95.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. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{\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(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \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)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) + \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) \]
      4. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(k \cdot j\right) \cdot 27}\right)\right) + \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) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right)} + \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) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot j, \mathsf{neg}\left(27\right), \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)} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{k \cdot j}, \mathsf{neg}\left(27\right), \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) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, \color{blue}{-27}, \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) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) \]
      10. distribute-rgt-out--N/A

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

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

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

    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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot z\right) \cdot y} + a \cdot -4, t, b \cdot c\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right)} \cdot z, y, a \cdot -4\right), t, b \cdot c\right) \]
      7. *-lowering-*.f6461.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, \color{blue}{a \cdot -4}\right), t, b \cdot c\right) \]
    9. Applied egg-rr61.3%

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

    \[\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(j \cdot k, -27, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.1% accurate, 0.9× 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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot k\right) \cdot -27\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+174}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-21}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-215}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+122}:\\ \;\;\;\;b \cdot c\\ \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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j k) -27.0)) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -4e+174)
     t_1
     (if (<= t_2 -5e-21)
       (* b c)
       (if (<= t_2 -1e-215)
         (* -4.0 (* t a))
         (if (<= t_2 5e+122) (* b c) t_1))))))
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 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -4e+174) {
		tmp = t_1;
	} else if (t_2 <= -5e-21) {
		tmp = b * c;
	} else if (t_2 <= -1e-215) {
		tmp = -4.0 * (t * a);
	} else if (t_2 <= 5e+122) {
		tmp = b * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (j * k) * (-27.0d0)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-4d+174)) then
        tmp = t_1
    else if (t_2 <= (-5d-21)) then
        tmp = b * c
    else if (t_2 <= (-1d-215)) then
        tmp = (-4.0d0) * (t * a)
    else if (t_2 <= 5d+122) then
        tmp = b * c
    else
        tmp = t_1
    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;
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 = (j * k) * -27.0;
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -4e+174) {
		tmp = t_1;
	} else if (t_2 <= -5e-21) {
		tmp = b * c;
	} else if (t_2 <= -1e-215) {
		tmp = -4.0 * (t * a);
	} else if (t_2 <= 5e+122) {
		tmp = 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * k) * -27.0
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -4e+174:
		tmp = t_1
	elif t_2 <= -5e-21:
		tmp = b * c
	elif t_2 <= -1e-215:
		tmp = -4.0 * (t * a)
	elif t_2 <= 5e+122:
		tmp = 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * k) * -27.0)
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -4e+174)
		tmp = t_1;
	elseif (t_2 <= -5e-21)
		tmp = Float64(b * c);
	elseif (t_2 <= -1e-215)
		tmp = Float64(-4.0 * Float64(t * a));
	elseif (t_2 <= 5e+122)
		tmp = Float64(b * c);
	else
		tmp = t_1;
	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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * k) * -27.0;
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -4e+174)
		tmp = t_1;
	elseif (t_2 <= -5e-21)
		tmp = b * c;
	elseif (t_2 <= -1e-215)
		tmp = -4.0 * (t * a);
	elseif (t_2 <= 5e+122)
		tmp = b * c;
	else
		tmp = t_1;
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+174], t$95$1, If[LessEqual[t$95$2, -5e-21], N[(b * c), $MachinePrecision], If[LessEqual[t$95$2, -1e-215], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+122], N[(b * c), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot k\right) \cdot -27\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+174}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-21}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-215}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+122}:\\
\;\;\;\;b \cdot c\\

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


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

    1. Initial program 83.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6483.5

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

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

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

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

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    8. Simplified61.1%

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

    if -4.00000000000000028e174 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999973e-21 or -1.00000000000000004e-215 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999989e122

    1. Initial program 84.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 b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6432.0

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified32.0%

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

    if -4.99999999999999973e-21 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000004e-215

    1. Initial program 86.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 a around inf

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

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      2. *-lowering-*.f6440.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -4 \cdot 10^{+174}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{-21}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{-215}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{+122}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.4% accurate, 1.0× 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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -0.002:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+84}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, a, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -0.002)
     (fma j (* k -27.0) (fma -4.0 (* x i) (* b c)))
     (if (<= t_1 2e+84)
       (fma (fma (* (* x 18.0) z) y (* a -4.0)) t (* b c))
       (fma (* t -4.0) a (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);
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 <= -0.002) {
		tmp = fma(j, (k * -27.0), fma(-4.0, (x * i), (b * c)));
	} else if (t_1 <= 2e+84) {
		tmp = fma(fma(((x * 18.0) * z), y, (a * -4.0)), t, (b * c));
	} else {
		tmp = fma((t * -4.0), a, 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])
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 <= -0.002)
		tmp = fma(j, Float64(k * -27.0), fma(-4.0, Float64(x * i), Float64(b * c)));
	elseif (t_1 <= 2e+84)
		tmp = fma(fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0)), t, Float64(b * c));
	else
		tmp = fma(Float64(t * -4.0), a, fma(j, Float64(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.
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, -0.002], N[(j * N[(k * -27.0), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+84], N[(N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(t * -4.0), $MachinePrecision] * a + N[(j * N[(k * -27.0), $MachinePrecision] + N[(b * c), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -0.002:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\

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


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

    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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

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

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

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

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

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

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

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

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

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

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

    if -2e-3 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000012e84

    1. Initial program 83.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot z\right) \cdot y} + a \cdot -4, t, b \cdot c\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right)} \cdot z, y, a \cdot -4\right), t, b \cdot c\right) \]
      7. *-lowering-*.f6476.0

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

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

    if 2.00000000000000012e84 < (*.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6471.5

        \[\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. Simplified71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.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])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(y \cdot z\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq -4.3 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_2\\ \mathbf{elif}\;x \leq 0.23:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{+111}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, t\_1, a \cdot -4\right), t, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right) - 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* 18.0 (* y z))) (t_2 (* (* j 27.0) k)))
   (if (<= x -4.3e+99)
     (- (* x (fma 18.0 (* z (* y t)) (* i -4.0))) t_2)
     (if (<= x 0.23)
       (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -27.0))))
       (if (<= x 2.15e+111)
         (fma (fma x t_1 (* a -4.0)) t (* b c))
         (- (* x (fma -4.0 i (* t t_1))) t_2))))))
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 = 18.0 * (y * z);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (x <= -4.3e+99) {
		tmp = (x * fma(18.0, (z * (y * t)), (i * -4.0))) - t_2;
	} else if (x <= 0.23) {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -27.0))));
	} else if (x <= 2.15e+111) {
		tmp = fma(fma(x, t_1, (a * -4.0)), t, (b * c));
	} else {
		tmp = (x * fma(-4.0, i, (t * t_1))) - 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(y * z))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (x <= -4.3e+99)
		tmp = Float64(Float64(x * fma(18.0, Float64(z * Float64(y * t)), Float64(i * -4.0))) - t_2);
	elseif (x <= 0.23)
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -27.0))));
	elseif (x <= 2.15e+111)
		tmp = fma(fma(x, t_1, Float64(a * -4.0)), t, Float64(b * c));
	else
		tmp = Float64(Float64(x * fma(-4.0, i, Float64(t * t_1))) - 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -4.3e+99], N[(N[(x * N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 0.23], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.15e+111], N[(N[(x * t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-4.0 * i + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $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])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot z\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_2\\

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right) - t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.3000000000000001e99

    1. Initial program 75.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18, z \cdot \color{blue}{\left(t \cdot y\right)}, -4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f6491.5

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

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

    if -4.3000000000000001e99 < x < 0.23000000000000001

    1. Initial program 91.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6482.7

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

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

    if 0.23000000000000001 < x < 2.14999999999999997e111

    1. Initial program 76.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.14999999999999997e111 < x

    1. Initial program 73.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 x around inf

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      5. accelerator-lowering-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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f6490.6

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) - \left(j \cdot 27\right) \cdot k \]
    5. Simplified90.6%

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

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

Alternative 6: 79.9% 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])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(y \cdot z\right)\\ t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{+102}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 0.0075:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, t\_1, a \cdot -4\right), t, b \cdot c\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* 18.0 (* y z)))
        (t_2 (- (* x (fma -4.0 i (* t t_1))) (* (* j 27.0) k))))
   (if (<= x -1.02e+102)
     t_2
     (if (<= x 0.0075)
       (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -27.0))))
       (if (<= x 1.8e+112) (fma (fma x t_1 (* a -4.0)) t (* b c)) t_2)))))
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 = 18.0 * (y * z);
	double t_2 = (x * fma(-4.0, i, (t * t_1))) - ((j * 27.0) * k);
	double tmp;
	if (x <= -1.02e+102) {
		tmp = t_2;
	} else if (x <= 0.0075) {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -27.0))));
	} else if (x <= 1.8e+112) {
		tmp = fma(fma(x, t_1, (a * -4.0)), t, (b * c));
	} 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(y * z))
	t_2 = Float64(Float64(x * fma(-4.0, i, Float64(t * t_1))) - Float64(Float64(j * 27.0) * k))
	tmp = 0.0
	if (x <= -1.02e+102)
		tmp = t_2;
	elseif (x <= 0.0075)
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -27.0))));
	elseif (x <= 1.8e+112)
		tmp = fma(fma(x, t_1, Float64(a * -4.0)), t, Float64(b * c));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-4.0 * i + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e+102], t$95$2, If[LessEqual[x, 0.0075], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+112], N[(N[(x * t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $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])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot z\right)\\
t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.01999999999999999e102 or 1.8e112 < x

    1. Initial program 74.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 x around inf

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      5. accelerator-lowering-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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f6490.9

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

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

    if -1.01999999999999999e102 < x < 0.0074999999999999997

    1. Initial program 91.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6482.7

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

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

    if 0.0074999999999999997 < x < 1.8e112

    1. Initial program 76.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 82.4% 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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq -1 \cdot 10^{+123}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_1\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+81}:\\ \;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(\left(x \cdot 18\right) \cdot y, z, a \cdot -4\right), \mathsf{fma}\left(b, c, 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) - 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= x -1e+123)
     (- (* x (fma 18.0 (* z (* y t)) (* i -4.0))) t_1)
     (if (<= x 6.8e+81)
       (fma t (fma (* (* x 18.0) y) z (* a -4.0)) (fma b c (* j (* k -27.0))))
       (- (* x (fma -4.0 i (* t (* 18.0 (* y z))))) t_1)))))
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 <= -1e+123) {
		tmp = (x * fma(18.0, (z * (y * t)), (i * -4.0))) - t_1;
	} else if (x <= 6.8e+81) {
		tmp = fma(t, fma(((x * 18.0) * y), z, (a * -4.0)), fma(b, c, (j * (k * -27.0))));
	} else {
		tmp = (x * fma(-4.0, i, (t * (18.0 * (y * z))))) - 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (x <= -1e+123)
		tmp = Float64(Float64(x * fma(18.0, Float64(z * Float64(y * t)), Float64(i * -4.0))) - t_1);
	elseif (x <= 6.8e+81)
		tmp = fma(t, fma(Float64(Float64(x * 18.0) * y), z, Float64(a * -4.0)), fma(b, c, Float64(j * Float64(k * -27.0))));
	else
		tmp = Float64(Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))) - 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.
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[x, -1e+123], N[(N[(x * N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 6.8e+81], N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -1 \cdot 10^{+123}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_1\\

\mathbf{elif}\;x \leq 6.8 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(\left(x \cdot 18\right) \cdot y, z, a \cdot -4\right), \mathsf{fma}\left(b, c, 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) - t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.99999999999999978e122

    1. Initial program 74.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18, z \cdot \color{blue}{\left(t \cdot y\right)}, -4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f6491.0

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

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

    if -9.99999999999999978e122 < x < 6.80000000000000005e81

    1. Initial program 90.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 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(a \cdot t\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(a \cdot t\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t - \color{blue}{\left(4 \cdot a\right) \cdot t}\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right) \]
      9. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.80000000000000005e81 < x

    1. Initial program 71.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 x around inf

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      5. accelerator-lowering-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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f6487.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+123}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+81}:\\ \;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(\left(x \cdot 18\right) \cdot y, z, a \cdot -4\right), \mathsf{fma}\left(b, c, 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) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 80.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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;x \leq -2.4 \cdot 10^{+122}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_1\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, 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) - 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= x -2.4e+122)
     (- (* x (fma 18.0 (* z (* y t)) (* i -4.0))) t_1)
     (if (<= x 5.2e+112)
       (fma t (fma -4.0 a (* 18.0 (* x (* y z)))) (fma b c (* j (* k -27.0))))
       (- (* x (fma -4.0 i (* t (* 18.0 (* y z))))) t_1)))))
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 <= -2.4e+122) {
		tmp = (x * fma(18.0, (z * (y * t)), (i * -4.0))) - t_1;
	} else if (x <= 5.2e+112) {
		tmp = fma(t, fma(-4.0, a, (18.0 * (x * (y * z)))), fma(b, c, (j * (k * -27.0))));
	} else {
		tmp = (x * fma(-4.0, i, (t * (18.0 * (y * z))))) - 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (x <= -2.4e+122)
		tmp = Float64(Float64(x * fma(18.0, Float64(z * Float64(y * t)), Float64(i * -4.0))) - t_1);
	elseif (x <= 5.2e+112)
		tmp = fma(t, fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))), fma(b, c, Float64(j * Float64(k * -27.0))));
	else
		tmp = Float64(Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))) - 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.
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[x, -2.4e+122], N[(N[(x * N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 5.2e+112], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+122}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - t\_1\\

\mathbf{elif}\;x \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, 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) - t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.4000000000000002e122

    1. Initial program 74.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(18, z \cdot \color{blue}{\left(t \cdot y\right)}, -4 \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f6491.0

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

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

    if -2.4000000000000002e122 < x < 5.2000000000000001e112

    1. Initial program 89.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 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(a \cdot t\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(a \cdot t\right)\right) - 27 \cdot \left(j \cdot k\right)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

        \[\leadsto \left(\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t - \color{blue}{\left(4 \cdot a\right) \cdot t}\right) + \left(b \cdot c - 27 \cdot \left(j \cdot k\right)\right) \]
      9. distribute-rgt-out--N/A

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

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

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

    if 5.2000000000000001e112 < x

    1. Initial program 73.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 x around inf

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      5. accelerator-lowering-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)} - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      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) - \left(j \cdot 27\right) \cdot k \]
      8. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f6490.6

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(\color{blue}{\left(y \cdot z\right)} \cdot 18\right)\right) - \left(j \cdot 27\right) \cdot k \]
    5. Simplified90.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+122}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(18, z \cdot \left(y \cdot t\right), i \cdot -4\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, 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) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+202}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+193}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -5e+202)
     (fma j (* k -27.0) (* -4.0 (* t a)))
     (if (<= t_1 1e+193)
       (fma b c (* -4.0 (fma a t (* x i))))
       (fma (* x i) -4.0 (* k (* j -27.0)))))))
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 <= -5e+202) {
		tmp = fma(j, (k * -27.0), (-4.0 * (t * a)));
	} else if (t_1 <= 1e+193) {
		tmp = fma(b, c, (-4.0 * fma(a, t, (x * i))));
	} else {
		tmp = fma((x * i), -4.0, (k * (j * -27.0)));
	}
	return tmp;
}
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 <= -5e+202)
		tmp = fma(j, Float64(k * -27.0), Float64(-4.0 * Float64(t * a)));
	elseif (t_1 <= 1e+193)
		tmp = fma(b, c, Float64(-4.0 * fma(a, t, Float64(x * i))));
	else
		tmp = fma(Float64(x * i), -4.0, Float64(k * Float64(j * -27.0)));
	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.
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, -5e+202], N[(j * N[(k * -27.0), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+193], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * i), $MachinePrecision] * -4.0 + N[(k * N[(j * -27.0), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+202}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(t \cdot a\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)\\


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

    1. Initial program 74.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6474.5

        \[\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. Simplified74.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in b around 0

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

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

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

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      8. *-lowering-*.f6474.9

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified74.9%

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

    if -4.9999999999999999e202 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e193

    1. Initial program 85.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6471.8

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}\right) \]
      3. *-lowering-*.f6467.1

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right)\right) \]
    8. Simplified67.1%

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

    if 1.00000000000000007e193 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.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 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. *-lowering-*.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. *-lowering-*.f6481.6

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot i\right) \cdot -4} + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) \]
      6. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      10. metadata-eval81.6

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

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

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

Alternative 10: 72.4% accurate, 1.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])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(y \cdot z\right)\\ t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right)\\ \mathbf{if}\;x \leq -6 \cdot 10^{+99}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 0.022:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, a, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+111}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, t\_1, a \cdot -4\right), t, b \cdot c\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* 18.0 (* y z))) (t_2 (* x (fma -4.0 i (* t t_1)))))
   (if (<= x -6e+99)
     t_2
     (if (<= x 0.022)
       (fma (* t -4.0) a (fma j (* k -27.0) (* b c)))
       (if (<= x 1.5e+111) (fma (fma x t_1 (* a -4.0)) t (* b c)) t_2)))))
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 = 18.0 * (y * z);
	double t_2 = x * fma(-4.0, i, (t * t_1));
	double tmp;
	if (x <= -6e+99) {
		tmp = t_2;
	} else if (x <= 0.022) {
		tmp = fma((t * -4.0), a, fma(j, (k * -27.0), (b * c)));
	} else if (x <= 1.5e+111) {
		tmp = fma(fma(x, t_1, (a * -4.0)), t, (b * c));
	} 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(y * z))
	t_2 = Float64(x * fma(-4.0, i, Float64(t * t_1)))
	tmp = 0.0
	if (x <= -6e+99)
		tmp = t_2;
	elseif (x <= 0.022)
		tmp = fma(Float64(t * -4.0), a, fma(j, Float64(k * -27.0), Float64(b * c)));
	elseif (x <= 1.5e+111)
		tmp = fma(fma(x, t_1, Float64(a * -4.0)), t, Float64(b * c));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-4.0 * i + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+99], t$95$2, If[LessEqual[x, 0.022], N[(N[(t * -4.0), $MachinePrecision] * a + N[(j * N[(k * -27.0), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+111], N[(N[(x * t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $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])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot z\right)\\
t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.00000000000000029e99 or 1.5e111 < x

    1. Initial program 74.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 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. *-lowering-*.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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6483.8

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

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

    if -6.00000000000000029e99 < x < 0.021999999999999999

    1. Initial program 91.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6474.3

        \[\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. Simplified74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.021999999999999999 < x < 1.5e111

    1. Initial program 76.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 0.022:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, a, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\right)\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+111}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c\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 11: 52.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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+202}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+162}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -5e+202)
     (* (* j k) -27.0)
     (if (<= t_1 2e+162) (fma -4.0 (* x i) (* b c)) (* k (* j -27.0))))))
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 <= -5e+202) {
		tmp = (j * k) * -27.0;
	} else if (t_1 <= 2e+162) {
		tmp = fma(-4.0, (x * i), (b * c));
	} else {
		tmp = k * (j * -27.0);
	}
	return tmp;
}
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 <= -5e+202)
		tmp = Float64(Float64(j * k) * -27.0);
	elseif (t_1 <= 2e+162)
		tmp = fma(-4.0, Float64(x * i), Float64(b * c));
	else
		tmp = Float64(k * Float64(j * -27.0));
	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.
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, -5e+202], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+162], N[(-4.0 * N[(x * i), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+202}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\

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

\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\


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

    1. Initial program 74.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6483.8

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

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

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

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

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    8. Simplified68.5%

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

    if -4.9999999999999999e202 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e162

    1. Initial program 85.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

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

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

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

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

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

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

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

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

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

    if 1.9999999999999999e162 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 88.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \color{blue}{k \cdot \left(-27 \cdot j\right)} \]
      3. *-lowering-*.f64N/A

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

        \[\leadsto k \cdot \color{blue}{\left(j \cdot -27\right)} \]
      5. *-lowering-*.f6463.0

        \[\leadsto k \cdot \color{blue}{\left(j \cdot -27\right)} \]
    7. Simplified63.0%

      \[\leadsto \color{blue}{k \cdot \left(j \cdot -27\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.2%

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

Alternative 12: 82.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])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\ \mathbf{if}\;t \leq -2 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma (fma (* (* x 18.0) z) y (* a -4.0)) t (* b c))))
   (if (<= t -2e+100)
     t_1
     (if (<= t 4.7e+45)
       (fma b c (fma -4.0 (fma a t (* x i)) (* 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);
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(((x * 18.0) * z), y, (a * -4.0)), t, (b * c));
	double tmp;
	if (t <= -2e+100) {
		tmp = t_1;
	} else if (t <= 4.7e+45) {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(fma(Float64(Float64(x * 18.0) * z), y, Float64(a * -4.0)), t, Float64(b * c))
	tmp = 0.0
	if (t <= -2e+100)
		tmp = t_1;
	elseif (t <= 4.7e+45)
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+100], t$95$1, If[LessEqual[t, 4.7e+45], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\left(x \cdot 18\right) \cdot z, y, a \cdot -4\right), t, b \cdot c\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.7 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), 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 t < -2.00000000000000003e100 or 4.70000000000000002e45 < t

    1. Initial program 82.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot z\right) \cdot y} + a \cdot -4, t, b \cdot c\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right)} \cdot z, y, a \cdot -4\right), t, b \cdot c\right) \]
      7. *-lowering-*.f6482.8

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

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

    if -2.00000000000000003e100 < t < 4.70000000000000002e45

    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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6484.0

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

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

Alternative 13: 56.3% 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])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+136}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, z \cdot \left(18 \cdot \left(x \cdot y\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= y -1e+136)
   (* x (fma -4.0 i (* t (* 18.0 (* y z)))))
   (if (<= y -1.22e-175)
     (fma b c (* -4.0 (fma a t (* x i))))
     (if (<= y 2.3e-85)
       (fma (* x i) -4.0 (* k (* j -27.0)))
       (* t (fma -4.0 a (* z (* 18.0 (* x y)))))))))
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 (y <= -1e+136) {
		tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
	} else if (y <= -1.22e-175) {
		tmp = fma(b, c, (-4.0 * fma(a, t, (x * i))));
	} else if (y <= 2.3e-85) {
		tmp = fma((x * i), -4.0, (k * (j * -27.0)));
	} else {
		tmp = t * fma(-4.0, a, (z * (18.0 * (x * y))));
	}
	return tmp;
}
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 (y <= -1e+136)
		tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))));
	elseif (y <= -1.22e-175)
		tmp = fma(b, c, Float64(-4.0 * fma(a, t, Float64(x * i))));
	elseif (y <= 2.3e-85)
		tmp = fma(Float64(x * i), -4.0, Float64(k * Float64(j * -27.0)));
	else
		tmp = Float64(t * fma(-4.0, a, Float64(z * Float64(18.0 * Float64(x * y)))));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -1e+136], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.22e-175], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-85], N[(N[(x * i), $MachinePrecision] * -4.0 + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * a + N[(z * N[(18.0 * N[(x * y), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+136}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq -1.22 \cdot 10^{-175}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\right)\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{-85}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.00000000000000006e136

    1. Initial program 76.9%

      \[\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. *-lowering-*.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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6459.6

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

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

    if -1.00000000000000006e136 < y < -1.2200000000000001e-175

    1. Initial program 79.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6470.8

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\mathsf{fma}\left(a, t, i \cdot x\right)}\right) \]
      3. *-lowering-*.f6466.3

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \mathsf{fma}\left(a, t, \color{blue}{i \cdot x}\right)\right) \]
    8. Simplified66.3%

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

    if -1.2200000000000001e-175 < y < 2.3e-85

    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 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. *-lowering-*.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. *-lowering-*.f6458.9

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot i\right) \cdot -4} + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) \]
      6. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      8. distribute-rgt-neg-inN/A

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

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      10. metadata-eval58.9

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

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

    if 2.3e-85 < y

    1. Initial program 82.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. accelerator-lowering-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)} \]
      3. associate-*r*N/A

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

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

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

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

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

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

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

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

Alternative 14: 37.7% accurate, 1.6× 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])\\ \\ \begin{array}{l} t_1 := \left(j \cdot k\right) \cdot -27\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{+174}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+122}:\\ \;\;\;\;b \cdot c\\ \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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j k) -27.0)) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -4e+174) t_1 (if (<= t_2 5e+122) (* b c) t_1))))
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 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -4e+174) {
		tmp = t_1;
	} else if (t_2 <= 5e+122) {
		tmp = b * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (j * k) * (-27.0d0)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-4d+174)) then
        tmp = t_1
    else if (t_2 <= 5d+122) then
        tmp = b * c
    else
        tmp = t_1
    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;
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 = (j * k) * -27.0;
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -4e+174) {
		tmp = t_1;
	} else if (t_2 <= 5e+122) {
		tmp = 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * k) * -27.0
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -4e+174:
		tmp = t_1
	elif t_2 <= 5e+122:
		tmp = 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(j * k) * -27.0)
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -4e+174)
		tmp = t_1;
	elseif (t_2 <= 5e+122)
		tmp = Float64(b * c);
	else
		tmp = t_1;
	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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * k) * -27.0;
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -4e+174)
		tmp = t_1;
	elseif (t_2 <= 5e+122)
		tmp = b * c;
	else
		tmp = t_1;
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+174], t$95$1, If[LessEqual[t$95$2, 5e+122], N[(b * c), $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])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot k\right) \cdot -27\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+174}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+122}:\\
\;\;\;\;b \cdot c\\

\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) < -4.00000000000000028e174 or 4.99999999999999989e122 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 83.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6483.5

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

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

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

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

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    8. Simplified61.1%

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

    if -4.00000000000000028e174 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999989e122

    1. Initial program 84.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} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6428.5

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified28.5%

      \[\leadsto \color{blue}{b \cdot c} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.6%

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

Alternative 15: 31.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])\\ \\ \begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right)\\ \mathbf{if}\;c \leq -2600000:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -1.2 \cdot 10^{-189}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;c \leq 3.1 \cdot 10^{-137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+38}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;c \leq 9 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -4.0 (* x i))))
   (if (<= c -2600000.0)
     (* b c)
     (if (<= c -1.2e-189)
       (* k (* j -27.0))
       (if (<= c 3.1e-137)
         t_1
         (if (<= c 5.4e+38)
           (* -4.0 (* t a))
           (if (<= c 9e+151) t_1 (* b c))))))))
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 = -4.0 * (x * i);
	double tmp;
	if (c <= -2600000.0) {
		tmp = b * c;
	} else if (c <= -1.2e-189) {
		tmp = k * (j * -27.0);
	} else if (c <= 3.1e-137) {
		tmp = t_1;
	} else if (c <= 5.4e+38) {
		tmp = -4.0 * (t * a);
	} else if (c <= 9e+151) {
		tmp = t_1;
	} 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.
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) :: tmp
    t_1 = (-4.0d0) * (x * i)
    if (c <= (-2600000.0d0)) then
        tmp = b * c
    else if (c <= (-1.2d-189)) then
        tmp = k * (j * (-27.0d0))
    else if (c <= 3.1d-137) then
        tmp = t_1
    else if (c <= 5.4d+38) then
        tmp = (-4.0d0) * (t * a)
    else if (c <= 9d+151) then
        tmp = t_1
    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;
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 = -4.0 * (x * i);
	double tmp;
	if (c <= -2600000.0) {
		tmp = b * c;
	} else if (c <= -1.2e-189) {
		tmp = k * (j * -27.0);
	} else if (c <= 3.1e-137) {
		tmp = t_1;
	} else if (c <= 5.4e+38) {
		tmp = -4.0 * (t * a);
	} else if (c <= 9e+151) {
		tmp = t_1;
	} 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -4.0 * (x * i)
	tmp = 0
	if c <= -2600000.0:
		tmp = b * c
	elif c <= -1.2e-189:
		tmp = k * (j * -27.0)
	elif c <= 3.1e-137:
		tmp = t_1
	elif c <= 5.4e+38:
		tmp = -4.0 * (t * a)
	elif c <= 9e+151:
		tmp = t_1
	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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-4.0 * Float64(x * i))
	tmp = 0.0
	if (c <= -2600000.0)
		tmp = Float64(b * c);
	elseif (c <= -1.2e-189)
		tmp = Float64(k * Float64(j * -27.0));
	elseif (c <= 3.1e-137)
		tmp = t_1;
	elseif (c <= 5.4e+38)
		tmp = Float64(-4.0 * Float64(t * a));
	elseif (c <= 9e+151)
		tmp = t_1;
	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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -4.0 * (x * i);
	tmp = 0.0;
	if (c <= -2600000.0)
		tmp = b * c;
	elseif (c <= -1.2e-189)
		tmp = k * (j * -27.0);
	elseif (c <= 3.1e-137)
		tmp = t_1;
	elseif (c <= 5.4e+38)
		tmp = -4.0 * (t * a);
	elseif (c <= 9e+151)
		tmp = t_1;
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2600000.0], N[(b * c), $MachinePrecision], If[LessEqual[c, -1.2e-189], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.1e-137], t$95$1, If[LessEqual[c, 5.4e+38], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9e+151], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;c \leq -2600000:\\
\;\;\;\;b \cdot c\\

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

\mathbf{elif}\;c \leq 3.1 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 5.4 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

\mathbf{elif}\;c \leq 9 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.6e6 or 8.9999999999999997e151 < c

    1. Initial program 81.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} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6450.2

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified50.2%

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

    if -2.6e6 < c < -1.1999999999999999e-189

    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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

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

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

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \color{blue}{k \cdot \left(-27 \cdot j\right)} \]
      3. *-lowering-*.f64N/A

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

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

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

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

    if -1.1999999999999999e-189 < c < 3.09999999999999978e-137 or 5.39999999999999992e38 < c < 8.9999999999999997e151

    1. Initial program 85.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)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. *-lowering-*.f6438.0

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified38.0%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 3.09999999999999978e-137 < c < 5.39999999999999992e38

    1. Initial program 75.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 inf

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

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      2. *-lowering-*.f6433.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2600000:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -1.2 \cdot 10^{-189}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;c \leq 3.1 \cdot 10^{-137}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+38}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;c \leq 9 \cdot 10^{+151}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 31.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])\\ \\ \begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right)\\ \mathbf{if}\;c \leq -180000000:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -2.7 \cdot 10^{-192}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{-138}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+38}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* -4.0 (* x i))))
   (if (<= c -180000000.0)
     (* b c)
     (if (<= c -2.7e-192)
       (* (* j k) -27.0)
       (if (<= c 9.8e-138)
         t_1
         (if (<= c 5.8e+38)
           (* -4.0 (* t a))
           (if (<= c 5e+151) t_1 (* b c))))))))
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 = -4.0 * (x * i);
	double tmp;
	if (c <= -180000000.0) {
		tmp = b * c;
	} else if (c <= -2.7e-192) {
		tmp = (j * k) * -27.0;
	} else if (c <= 9.8e-138) {
		tmp = t_1;
	} else if (c <= 5.8e+38) {
		tmp = -4.0 * (t * a);
	} else if (c <= 5e+151) {
		tmp = t_1;
	} 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.
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) :: tmp
    t_1 = (-4.0d0) * (x * i)
    if (c <= (-180000000.0d0)) then
        tmp = b * c
    else if (c <= (-2.7d-192)) then
        tmp = (j * k) * (-27.0d0)
    else if (c <= 9.8d-138) then
        tmp = t_1
    else if (c <= 5.8d+38) then
        tmp = (-4.0d0) * (t * a)
    else if (c <= 5d+151) then
        tmp = t_1
    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;
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 = -4.0 * (x * i);
	double tmp;
	if (c <= -180000000.0) {
		tmp = b * c;
	} else if (c <= -2.7e-192) {
		tmp = (j * k) * -27.0;
	} else if (c <= 9.8e-138) {
		tmp = t_1;
	} else if (c <= 5.8e+38) {
		tmp = -4.0 * (t * a);
	} else if (c <= 5e+151) {
		tmp = t_1;
	} 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -4.0 * (x * i)
	tmp = 0
	if c <= -180000000.0:
		tmp = b * c
	elif c <= -2.7e-192:
		tmp = (j * k) * -27.0
	elif c <= 9.8e-138:
		tmp = t_1
	elif c <= 5.8e+38:
		tmp = -4.0 * (t * a)
	elif c <= 5e+151:
		tmp = t_1
	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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-4.0 * Float64(x * i))
	tmp = 0.0
	if (c <= -180000000.0)
		tmp = Float64(b * c);
	elseif (c <= -2.7e-192)
		tmp = Float64(Float64(j * k) * -27.0);
	elseif (c <= 9.8e-138)
		tmp = t_1;
	elseif (c <= 5.8e+38)
		tmp = Float64(-4.0 * Float64(t * a));
	elseif (c <= 5e+151)
		tmp = t_1;
	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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = -4.0 * (x * i);
	tmp = 0.0;
	if (c <= -180000000.0)
		tmp = b * c;
	elseif (c <= -2.7e-192)
		tmp = (j * k) * -27.0;
	elseif (c <= 9.8e-138)
		tmp = t_1;
	elseif (c <= 5.8e+38)
		tmp = -4.0 * (t * a);
	elseif (c <= 5e+151)
		tmp = t_1;
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -180000000.0], N[(b * c), $MachinePrecision], If[LessEqual[c, -2.7e-192], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[c, 9.8e-138], t$95$1, If[LessEqual[c, 5.8e+38], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5e+151], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;c \leq -180000000:\\
\;\;\;\;b \cdot c\\

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

\mathbf{elif}\;c \leq 9.8 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 5.8 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\

\mathbf{elif}\;c \leq 5 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.8e8 or 5.0000000000000002e151 < c

    1. Initial program 81.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} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6450.2

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified50.2%

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

    if -1.8e8 < c < -2.69999999999999991e-192

    1. Initial program 89.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 y around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\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) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)\right)} \]
      2. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, \mathsf{fma}\left(a, t, x \cdot i\right), j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      19. *-lowering-*.f6487.1

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

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

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

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

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

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

    if -2.69999999999999991e-192 < c < 9.80000000000000033e-138 or 5.80000000000000013e38 < c < 5.0000000000000002e151

    1. Initial program 86.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 i around inf

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. *-lowering-*.f6439.1

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified39.1%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 9.80000000000000033e-138 < c < 5.80000000000000013e38

    1. Initial program 76.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 inf

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

        \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
      2. *-lowering-*.f6432.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -180000000:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -2.7 \cdot 10^{-192}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{-138}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+38}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+151}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 47.0% 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])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-139}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+40}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= y -2.7e+63)
   (* z (* (* x y) (* 18.0 t)))
   (if (<= y -1.7e-139)
     (fma (* a -4.0) t (* b c))
     (if (<= y 1.22e+40)
       (fma j (* k -27.0) (* -4.0 (* t a)))
       (* (* x y) (* z (* 18.0 t)))))))
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 (y <= -2.7e+63) {
		tmp = z * ((x * y) * (18.0 * t));
	} else if (y <= -1.7e-139) {
		tmp = fma((a * -4.0), t, (b * c));
	} else if (y <= 1.22e+40) {
		tmp = fma(j, (k * -27.0), (-4.0 * (t * a)));
	} else {
		tmp = (x * y) * (z * (18.0 * t));
	}
	return tmp;
}
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 (y <= -2.7e+63)
		tmp = Float64(z * Float64(Float64(x * y) * Float64(18.0 * t)));
	elseif (y <= -1.7e-139)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	elseif (y <= 1.22e+40)
		tmp = fma(j, Float64(k * -27.0), Float64(-4.0 * Float64(t * a)));
	else
		tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t)));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2.7e+63], N[(z * N[(N[(x * y), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-139], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e+40], N[(j * N[(k * -27.0), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+63}:\\
\;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-139}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\

\mathbf{elif}\;y \leq 1.22 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.70000000000000017e63

    1. Initial program 75.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 y around inf

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

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6445.7

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified45.7%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6448.8

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]

    if -2.70000000000000017e63 < y < -1.69999999999999999e-139

    1. Initial program 79.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6459.5

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified59.5%

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

    if -1.69999999999999999e-139 < y < 1.22000000000000004e40

    1. Initial program 90.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6460.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. Simplified60.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)} \]
    6. Taylor expanded in b around 0

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

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

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

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + -4 \cdot \left(a \cdot t\right) \]
      4. accelerator-lowering-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      8. *-lowering-*.f6442.7

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified42.7%

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

    if 1.22000000000000004e40 < y

    1. Initial program 85.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 y around inf

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

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6446.3

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified46.3%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6451.0

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr51.0%

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

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

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      4. *-lowering-*.f64N/A

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

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      7. *-lowering-*.f6447.8

        \[\leadsto \left(z \cdot \left(t \cdot 18\right)\right) \cdot \color{blue}{\left(x \cdot y\right)} \]
    9. Applied egg-rr47.8%

      \[\leadsto \color{blue}{\left(z \cdot \left(t \cdot 18\right)\right) \cdot \left(x \cdot y\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.2%

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

Alternative 18: 72.0% 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])\\ \\ \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 -4.2 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, a, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\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.
(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 -4.2e+101)
     t_1
     (if (<= x 1.4e+41) (fma (* t -4.0) a (fma j (* k -27.0) (* b c))) t_1))))
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 <= -4.2e+101) {
		tmp = t_1;
	} else if (x <= 1.4e+41) {
		tmp = fma((t * -4.0), a, fma(j, (k * -27.0), (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])
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 <= -4.2e+101)
		tmp = t_1;
	elseif (x <= 1.4e+41)
		tmp = fma(Float64(t * -4.0), a, fma(j, Float64(k * -27.0), 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.
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, -4.2e+101], t$95$1, If[LessEqual[x, 1.4e+41], N[(N[(t * -4.0), $MachinePrecision] * a + N[(j * N[(k * -27.0), $MachinePrecision] + N[(b * c), $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])\\
\\
\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 -4.2 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.2e101 or 1.4e41 < x

    1. Initial program 73.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 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. *-lowering-*.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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6480.3

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

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

    if -4.2e101 < x < 1.4e41

    1. Initial program 91.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6474.3

        \[\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. Simplified74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+101}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, a, \mathsf{fma}\left(j, k \cdot -27, b \cdot c\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 19: 71.9% 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])\\ \\ \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 -5.4 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(j \cdot k, -27, t \cdot \left(a \cdot -4\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.
(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 -5.4e+99)
     t_1
     (if (<= x 2.1e+41) (fma b c (fma (* j k) -27.0 (* t (* a -4.0)))) t_1))))
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 <= -5.4e+99) {
		tmp = t_1;
	} else if (x <= 2.1e+41) {
		tmp = fma(b, c, fma((j * k), -27.0, (t * (a * -4.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])
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 <= -5.4e+99)
		tmp = t_1;
	elseif (x <= 2.1e+41)
		tmp = fma(b, c, fma(Float64(j * k), -27.0, Float64(t * Float64(a * -4.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.
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, -5.4e+99], t$95$1, If[LessEqual[x, 2.1e+41], N[(b * c + N[(N[(j * k), $MachinePrecision] * -27.0 + N[(t * N[(a * -4.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])\\
\\
\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 -5.4 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.39999999999999978e99 or 2.1e41 < x

    1. Initial program 73.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 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. *-lowering-*.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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6480.3

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

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

    if -5.39999999999999978e99 < x < 2.1e41

    1. Initial program 91.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6474.3

        \[\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. Simplified74.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(j \cdot k, -27, t \cdot \left(a \cdot -4\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 20: 71.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])\\ \\ \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 -2.7 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+38}:\\ \;\;\;\;\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.
(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 -2.7e+102)
     t_1
     (if (<= x 6e+38) (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);
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 <= -2.7e+102) {
		tmp = t_1;
	} else if (x <= 6e+38) {
		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])
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 <= -2.7e+102)
		tmp = t_1;
	elseif (x <= 6e+38)
		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.
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, -2.7e+102], t$95$1, If[LessEqual[x, 6e+38], 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])\\
\\
\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 -2.7 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 6 \cdot 10^{+38}:\\
\;\;\;\;\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 < -2.7000000000000001e102 or 6.0000000000000002e38 < x

    1. Initial program 73.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 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. *-lowering-*.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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6480.3

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

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

    if -2.7000000000000001e102 < x < 6.0000000000000002e38

    1. Initial program 91.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6474.3

        \[\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. Simplified74.3%

      \[\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 simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{+102}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+38}:\\ \;\;\;\;\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 21: 47.0% 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])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-172}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+46}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= y -2e+63)
   (* z (* (* x y) (* 18.0 t)))
   (if (<= y -8.2e-172)
     (fma (* a -4.0) t (* b c))
     (if (<= y 1.9e+46)
       (- (* b c) (* 27.0 (* j k)))
       (* (* x y) (* z (* 18.0 t)))))))
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 (y <= -2e+63) {
		tmp = z * ((x * y) * (18.0 * t));
	} else if (y <= -8.2e-172) {
		tmp = fma((a * -4.0), t, (b * c));
	} else if (y <= 1.9e+46) {
		tmp = (b * c) - (27.0 * (j * k));
	} else {
		tmp = (x * y) * (z * (18.0 * t));
	}
	return tmp;
}
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 (y <= -2e+63)
		tmp = Float64(z * Float64(Float64(x * y) * Float64(18.0 * t)));
	elseif (y <= -8.2e-172)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	elseif (y <= 1.9e+46)
		tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k)));
	else
		tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t)));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2e+63], N[(z * N[(N[(x * y), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.2e-172], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+46], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+63}:\\
\;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\

\mathbf{elif}\;y \leq -8.2 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+46}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.00000000000000012e63

    1. Initial program 75.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 y around inf

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

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6445.7

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified45.7%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6448.8

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]

    if -2.00000000000000012e63 < y < -8.2e-172

    1. Initial program 81.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6460.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified60.0%

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

    if -8.2e-172 < y < 1.9e46

    1. Initial program 89.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. *-lowering-*.f6442.2

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

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

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

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

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

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

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right) \cdot 27} \]
      6. *-lowering-*.f6442.2

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

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

    if 1.9e46 < y

    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 y around inf

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

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6445.4

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified45.4%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6450.2

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr50.2%

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

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

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      4. *-lowering-*.f64N/A

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

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      7. *-lowering-*.f6446.9

        \[\leadsto \left(z \cdot \left(t \cdot 18\right)\right) \cdot \color{blue}{\left(x \cdot y\right)} \]
    9. Applied egg-rr46.9%

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

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

Alternative 22: 47.0% 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])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-174}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+43}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= y -2.7e+63)
   (* 18.0 (* z (* t (* x y))))
   (if (<= y -2.3e-174)
     (fma (* a -4.0) t (* b c))
     (if (<= y 1.3e+43)
       (- (* b c) (* 27.0 (* j k)))
       (* (* x y) (* z (* 18.0 t)))))))
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 (y <= -2.7e+63) {
		tmp = 18.0 * (z * (t * (x * y)));
	} else if (y <= -2.3e-174) {
		tmp = fma((a * -4.0), t, (b * c));
	} else if (y <= 1.3e+43) {
		tmp = (b * c) - (27.0 * (j * k));
	} else {
		tmp = (x * y) * (z * (18.0 * t));
	}
	return tmp;
}
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 (y <= -2.7e+63)
		tmp = Float64(18.0 * Float64(z * Float64(t * Float64(x * y))));
	elseif (y <= -2.3e-174)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	elseif (y <= 1.3e+43)
		tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k)));
	else
		tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t)));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2.7e+63], N[(18.0 * N[(z * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-174], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+43], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+63}:\\
\;\;\;\;18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\

\mathbf{elif}\;y \leq -2.3 \cdot 10^{-174}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+43}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.70000000000000017e63

    1. Initial program 75.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 y around inf

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

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6445.7

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified45.7%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(\color{blue}{\left(t \cdot \left(x \cdot y\right)\right)} \cdot z\right) \]
      5. *-lowering-*.f6448.7

        \[\leadsto 18 \cdot \left(\left(t \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z\right) \]
    7. Applied egg-rr48.7%

      \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]

    if -2.70000000000000017e63 < y < -2.2999999999999999e-174

    1. Initial program 81.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6460.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified60.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]

    if -2.2999999999999999e-174 < y < 1.3000000000000001e43

    1. Initial program 89.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. *-lowering-*.f6442.6

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Simplified42.6%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \color{blue}{b \cdot c - \left(j \cdot 27\right) \cdot k} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      3. *-commutativeN/A

        \[\leadsto b \cdot c - \color{blue}{k \cdot \left(j \cdot 27\right)} \]
      4. associate-*r*N/A

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right) \cdot 27} \]
      5. *-lowering-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right) \cdot 27} \]
      6. *-lowering-*.f6442.6

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right)} \cdot 27 \]
    7. Applied egg-rr42.6%

      \[\leadsto \color{blue}{b \cdot c - \left(k \cdot j\right) \cdot 27} \]

    if 1.3000000000000001e43 < y

    1. Initial program 85.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 y around inf

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6446.3

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified46.3%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
      2. associate-*r*N/A

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6451.0

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot \left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right) \cdot \left(x \cdot y\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \left(18 \cdot t\right)\right)} \cdot \left(x \cdot y\right) \]
      5. *-commutativeN/A

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(z \cdot \color{blue}{\left(t \cdot 18\right)}\right) \cdot \left(x \cdot y\right) \]
      7. *-lowering-*.f6447.8

        \[\leadsto \left(z \cdot \left(t \cdot 18\right)\right) \cdot \color{blue}{\left(x \cdot y\right)} \]
    9. Applied egg-rr47.8%

      \[\leadsto \color{blue}{\left(z \cdot \left(t \cdot 18\right)\right) \cdot \left(x \cdot y\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-174}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+43}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 46.9% 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])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\ \mathbf{if}\;y \leq -8.6 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-174}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{+40}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* 18.0 (* z (* t (* x y))))))
   (if (<= y -8.6e+62)
     t_1
     (if (<= y -1.45e-174)
       (fma (* a -4.0) t (* b c))
       (if (<= y 3.25e+40) (- (* b c) (* 27.0 (* j k))) t_1)))))
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 = 18.0 * (z * (t * (x * y)));
	double tmp;
	if (y <= -8.6e+62) {
		tmp = t_1;
	} else if (y <= -1.45e-174) {
		tmp = fma((a * -4.0), t, (b * c));
	} else if (y <= 3.25e+40) {
		tmp = (b * c) - (27.0 * (j * k));
	} 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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(z * Float64(t * Float64(x * y))))
	tmp = 0.0
	if (y <= -8.6e+62)
		tmp = t_1;
	elseif (y <= -1.45e-174)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	elseif (y <= 3.25e+40)
		tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k)));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(z * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.6e+62], t$95$1, If[LessEqual[y, -1.45e-174], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.25e+40], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $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])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{-174}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\

\mathbf{elif}\;y \leq 3.25 \cdot 10^{+40}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.5999999999999994e62 or 3.2500000000000001e40 < y

    1. Initial program 80.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 y around inf

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6446.0

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified46.0%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)}\right) \]
      2. associate-*r*N/A

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(\color{blue}{\left(t \cdot \left(x \cdot y\right)\right)} \cdot z\right) \]
      5. *-lowering-*.f6450.0

        \[\leadsto 18 \cdot \left(\left(t \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z\right) \]
    7. Applied egg-rr50.0%

      \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot \left(x \cdot y\right)\right) \cdot z\right)} \]

    if -8.5999999999999994e62 < y < -1.45000000000000005e-174

    1. Initial program 81.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      3. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right)} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) \cdot t} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot y\right) \cdot z + \left(\mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right) \cdot \left(y \cdot z\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot \left(18 \cdot \left(y \cdot z\right)\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, \color{blue}{18 \cdot \left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \color{blue}{\left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot \color{blue}{-4}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      15. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)}\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c} - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
    4. Applied egg-rr87.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    5. Taylor expanded in b around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f6472.6

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    7. Simplified72.6%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6460.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified60.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]

    if -1.45000000000000005e-174 < y < 3.2500000000000001e40

    1. Initial program 89.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. *-lowering-*.f6442.6

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Simplified42.6%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \color{blue}{b \cdot c - \left(j \cdot 27\right) \cdot k} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
      3. *-commutativeN/A

        \[\leadsto b \cdot c - \color{blue}{k \cdot \left(j \cdot 27\right)} \]
      4. associate-*r*N/A

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right) \cdot 27} \]
      5. *-lowering-*.f64N/A

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right) \cdot 27} \]
      6. *-lowering-*.f6442.6

        \[\leadsto b \cdot c - \color{blue}{\left(k \cdot j\right)} \cdot 27 \]
    7. Applied egg-rr42.6%

      \[\leadsto \color{blue}{b \cdot c - \left(k \cdot j\right) \cdot 27} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{+62}:\\ \;\;\;\;18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-174}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{+40}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 51.0% 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])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma (* a -4.0) t (* b c))))
   (if (<= (* a 4.0) -2e+35)
     t_1
     (if (<= (* a 4.0) 4e+110) (fma -4.0 (* x i) (* b c)) t_1))))
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((a * -4.0), t, (b * c));
	double tmp;
	if ((a * 4.0) <= -2e+35) {
		tmp = t_1;
	} else if ((a * 4.0) <= 4e+110) {
		tmp = fma(-4.0, (x * i), (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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(Float64(a * -4.0), t, Float64(b * c))
	tmp = 0.0
	if (Float64(a * 4.0) <= -2e+35)
		tmp = t_1;
	elseif (Float64(a * 4.0) <= 4e+110)
		tmp = fma(-4.0, Float64(x * i), 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 4.0), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(a * 4.0), $MachinePrecision], 4e+110], N[(-4.0 * N[(x * i), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\
\mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 4 binary64)) < -1.9999999999999999e35 or 4.0000000000000001e110 < (*.f64 a #s(literal 4 binary64))

    1. Initial program 78.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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      3. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right)} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) \cdot t} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot y\right) \cdot z + \left(\mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right) \cdot \left(y \cdot z\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot \left(18 \cdot \left(y \cdot z\right)\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, \color{blue}{18 \cdot \left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \color{blue}{\left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot \color{blue}{-4}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      15. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)}\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c} - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
    4. Applied egg-rr84.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    5. Taylor expanded in b around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f6474.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    7. Simplified74.3%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6462.5

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified62.5%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]

    if -1.9999999999999999e35 < (*.f64 a #s(literal 4 binary64)) < 4.0000000000000001e110

    1. Initial program 87.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

        \[\leadsto \left(\color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      4. *-commutativeN/A

        \[\leadsto \left(\color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right)} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot z} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t \cdot \left(\left(x \cdot 18\right) \cdot y\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \color{blue}{\left(18 \cdot y\right)}\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(a \cdot 4\right)}\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot \color{blue}{-4}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied egg-rr87.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      2. metadata-evalN/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      6. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)}\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right)\right) \]
      12. *-lowering-*.f6470.6

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right)\right) \]
    7. Simplified70.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right) \]
      3. *-lowering-*.f6453.2

        \[\leadsto \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right) \]
    10. Simplified53.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 51.0% 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])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, 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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma b c (* -4.0 (* t a)))))
   (if (<= (* a 4.0) -2e+35)
     t_1
     (if (<= (* a 4.0) 4e+110) (fma -4.0 (* x i) (* b c)) t_1))))
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(b, c, (-4.0 * (t * a)));
	double tmp;
	if ((a * 4.0) <= -2e+35) {
		tmp = t_1;
	} else if ((a * 4.0) <= 4e+110) {
		tmp = fma(-4.0, (x * i), (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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(-4.0 * Float64(t * a)))
	tmp = 0.0
	if (Float64(a * 4.0) <= -2e+35)
		tmp = t_1;
	elseif (Float64(a * 4.0) <= 4e+110)
		tmp = fma(-4.0, Float64(x * i), 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 4.0), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(a * 4.0), $MachinePrecision], 4e+110], N[(-4.0 * N[(x * i), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a #s(literal 4 binary64)) < -1.9999999999999999e35 or 4.0000000000000001e110 < (*.f64 a #s(literal 4 binary64))

    1. Initial program 78.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6468.9

        \[\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. Simplified68.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + b \cdot c} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot c + -4 \cdot \left(a \cdot t\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      4. *-lowering-*.f6460.3

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified60.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -1.9999999999999999e35 < (*.f64 a #s(literal 4 binary64)) < 4.0000000000000001e110

    1. Initial program 87.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

        \[\leadsto \left(\color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      4. *-commutativeN/A

        \[\leadsto \left(\color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right)} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot z} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t \cdot \left(\left(x \cdot 18\right) \cdot y\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \color{blue}{\left(18 \cdot y\right)}\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(a \cdot 4\right)}\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot \color{blue}{-4}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied egg-rr87.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      2. metadata-evalN/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      6. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)}\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right)\right) \]
      12. *-lowering-*.f6470.6

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right)\right) \]
    7. Simplified70.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right) \]
      3. *-lowering-*.f6453.2

        \[\leadsto \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right) \]
    10. Simplified53.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 4 \leq -2 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;a \cdot 4 \leq 4 \cdot 10^{+110}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 51.5% accurate, 1.9× 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])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{if}\;i \leq -2.05 \cdot 10^{+26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -3.5 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;i \leq 0.033:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma -4.0 (* x i) (* b c))))
   (if (<= i -2.05e+26)
     t_1
     (if (<= i -3.5e-208)
       (fma b c (* -4.0 (* t a)))
       (if (<= i 0.033) (fma c b (* k (* j -27.0))) t_1)))))
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(-4.0, (x * i), (b * c));
	double tmp;
	if (i <= -2.05e+26) {
		tmp = t_1;
	} else if (i <= -3.5e-208) {
		tmp = fma(b, c, (-4.0 * (t * a)));
	} else if (i <= 0.033) {
		tmp = fma(c, b, (k * (j * -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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(-4.0, Float64(x * i), Float64(b * c))
	tmp = 0.0
	if (i <= -2.05e+26)
		tmp = t_1;
	elseif (i <= -3.5e-208)
		tmp = fma(b, c, Float64(-4.0 * Float64(t * a)));
	elseif (i <= 0.033)
		tmp = fma(c, b, Float64(k * Float64(j * -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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.05e+26], t$95$1, If[LessEqual[i, -3.5e-208], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.033], N[(c * b + N[(k * N[(j * -27.0), $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])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\
\mathbf{if}\;i \leq -2.05 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -3.5 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{elif}\;i \leq 0.033:\\
\;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.04999999999999992e26 or 0.033000000000000002 < i

    1. Initial program 81.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

        \[\leadsto \left(\color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      4. *-commutativeN/A

        \[\leadsto \left(\color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right)} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot z} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t \cdot \left(\left(x \cdot 18\right) \cdot y\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \color{blue}{\left(18 \cdot y\right)}\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(a \cdot 4\right)}\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot \color{blue}{-4}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied egg-rr82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      2. metadata-evalN/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      6. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)}\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right)\right) \]
      12. *-lowering-*.f6472.0

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right)\right) \]
    7. Simplified72.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right) \]
      3. *-lowering-*.f6464.1

        \[\leadsto \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right) \]
    10. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]

    if -2.04999999999999992e26 < i < -3.49999999999999991e-208

    1. Initial program 83.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6464.4

        \[\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. Simplified64.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + b \cdot c} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot c + -4 \cdot \left(a \cdot t\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      4. *-lowering-*.f6452.7

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified52.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -3.49999999999999991e-208 < i < 0.033000000000000002

    1. Initial program 88.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. *-lowering-*.f6452.5

        \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    5. Simplified52.5%

      \[\leadsto \color{blue}{b \cdot c} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{c \cdot b} + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, \mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(c, b, \mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(c, b, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      9. metadata-eval52.6

        \[\leadsto \mathsf{fma}\left(c, b, k \cdot \left(j \cdot \color{blue}{-27}\right)\right) \]
    7. Applied egg-rr52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.05 \cdot 10^{+26}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{elif}\;i \leq -3.5 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;i \leq 0.033:\\ \;\;\;\;\mathsf{fma}\left(c, b, k \cdot \left(j \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 51.5% accurate, 1.9× 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])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{if}\;i \leq -9.2 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq -2.3 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;i \leq 0.8:\\ \;\;\;\;\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma -4.0 (* x i) (* b c))))
   (if (<= i -9.2e+25)
     t_1
     (if (<= i -2.3e-208)
       (fma b c (* -4.0 (* t a)))
       (if (<= i 0.8) (fma b c (* 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);
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(-4.0, (x * i), (b * c));
	double tmp;
	if (i <= -9.2e+25) {
		tmp = t_1;
	} else if (i <= -2.3e-208) {
		tmp = fma(b, c, (-4.0 * (t * a)));
	} else if (i <= 0.8) {
		tmp = fma(b, c, (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])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(-4.0, Float64(x * i), Float64(b * c))
	tmp = 0.0
	if (i <= -9.2e+25)
		tmp = t_1;
	elseif (i <= -2.3e-208)
		tmp = fma(b, c, Float64(-4.0 * Float64(t * a)));
	elseif (i <= 0.8)
		tmp = fma(b, c, 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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -9.2e+25], t$95$1, If[LessEqual[i, -2.3e-208], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 0.8], N[(b * c + N[(j * N[(k * -27.0), $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])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\
\mathbf{if}\;i \leq -9.2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;i \leq -2.3 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\

\mathbf{elif}\;i \leq 0.8:\\
\;\;\;\;\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -9.1999999999999992e25 or 0.80000000000000004 < i

    1. Initial program 81.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. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{\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) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. sub-negN/A

        \[\leadsto \left(\color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      4. *-commutativeN/A

        \[\leadsto \left(\color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right)} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot z} + \left(\left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t \cdot \left(\left(x \cdot 18\right) \cdot y\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \color{blue}{\left(x \cdot \left(18 \cdot y\right)\right)}, z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \color{blue}{\left(18 \cdot y\right)}\right), z, \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot t\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \left(\mathsf{neg}\left(\color{blue}{t \cdot \left(a \cdot 4\right)}\right)\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{t \cdot \left(\mathsf{neg}\left(a \cdot 4\right)\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \color{blue}{\mathsf{fma}\left(t, \mathsf{neg}\left(a \cdot 4\right), b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot \color{blue}{-4}, b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied egg-rr82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)} \]
      2. metadata-evalN/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) + \color{blue}{-27} \cdot \left(j \cdot k\right) \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{j \cdot \left(k \cdot -27\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      6. *-commutativeN/A

        \[\leadsto j \cdot \color{blue}{\left(-27 \cdot k\right)} + \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(j, -27 \cdot k, -4 \cdot \left(i \cdot x\right) + b \cdot c\right)} \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, \color{blue}{k \cdot -27}, -4 \cdot \left(i \cdot x\right) + b \cdot c\right) \]
      10. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)}\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right)\right) \]
      12. *-lowering-*.f6472.0

        \[\leadsto \mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right)\right) \]
    7. Simplified72.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right)} \]
    8. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right) \]
      3. *-lowering-*.f6464.1

        \[\leadsto \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right) \]
    10. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]

    if -9.1999999999999992e25 < i < -2.29999999999999997e-208

    1. Initial program 83.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 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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6464.4

        \[\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. Simplified64.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in j around 0

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right) + b \cdot c} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot c + -4 \cdot \left(a \cdot t\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      4. *-lowering-*.f6452.7

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified52.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(a \cdot t\right)\right)} \]

    if -2.29999999999999997e-208 < i < 0.80000000000000004

    1. Initial program 88.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. accelerator-lowering-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. accelerator-lowering-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. *-lowering-*.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. *-lowering-*.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. *-lowering-*.f6465.7

        \[\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. Simplified65.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \left(k \cdot -27\right)\right)\right)} \]
    6. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right) + b \cdot c} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{b \cdot c + -27 \cdot \left(j \cdot k\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)} \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(j \cdot k\right) \cdot -27}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{j \cdot \left(k \cdot -27\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, j \cdot \color{blue}{\left(-27 \cdot k\right)}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{j \cdot \left(-27 \cdot k\right)}\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, c, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
      8. *-lowering-*.f6452.5

        \[\leadsto \mathsf{fma}\left(b, c, j \cdot \color{blue}{\left(k \cdot -27\right)}\right) \]
    8. Simplified52.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -9.2 \cdot 10^{+25}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{elif}\;i \leq -2.3 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;i \leq 0.8:\\ \;\;\;\;\mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 44.1% accurate, 2.0× 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])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-135}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\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.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= y -2.1e+63)
   (* z (* (* x y) (* 18.0 t)))
   (if (<= y -2.3e-135)
     (fma (* a -4.0) t (* b c))
     (fma (* x i) -4.0 (* k (* j -27.0))))))
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 (y <= -2.1e+63) {
		tmp = z * ((x * y) * (18.0 * t));
	} else if (y <= -2.3e-135) {
		tmp = fma((a * -4.0), t, (b * c));
	} else {
		tmp = fma((x * i), -4.0, (k * (j * -27.0)));
	}
	return tmp;
}
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 (y <= -2.1e+63)
		tmp = Float64(z * Float64(Float64(x * y) * Float64(18.0 * t)));
	elseif (y <= -2.3e-135)
		tmp = fma(Float64(a * -4.0), t, Float64(b * c));
	else
		tmp = fma(Float64(x * i), -4.0, Float64(k * Float64(j * -27.0)));
	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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2.1e+63], N[(z * N[(N[(x * y), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-135], N[(N[(a * -4.0), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(x * i), $MachinePrecision] * -4.0 + N[(k * N[(j * -27.0), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+63}:\\
\;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\

\mathbf{elif}\;y \leq -2.3 \cdot 10^{-135}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1000000000000002e63

    1. Initial program 75.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 y around inf

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(x \cdot \left(y \cdot z\right)\right)}\right) \]
      4. *-lowering-*.f6445.7

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified45.7%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
      2. associate-*r*N/A

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right)} \cdot z \]
      6. *-lowering-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(18 \cdot t\right)} \cdot \left(x \cdot y\right)\right) \cdot z \]
      7. *-lowering-*.f6448.8

        \[\leadsto \left(\left(18 \cdot t\right) \cdot \color{blue}{\left(x \cdot y\right)}\right) \cdot z \]
    7. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\left(\left(18 \cdot t\right) \cdot \left(x \cdot y\right)\right) \cdot z} \]

    if -2.1000000000000002e63 < y < -2.2999999999999999e-135

    1. Initial program 77.9%

      \[\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. Step-by-step derivation
      1. associate--l-N/A

        \[\leadsto \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]
      2. associate--l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      3. distribute-rgt-out--N/A

        \[\leadsto \color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right)} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right) \cdot t} + \left(b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right)} \]
      6. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(x \cdot 18\right) \cdot y\right) \cdot z + \left(\mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x \cdot 18\right) \cdot \left(y \cdot z\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot \left(18 \cdot \left(y \cdot z\right)\right)} + \left(\mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \mathsf{neg}\left(a \cdot 4\right)\right)}, t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, \color{blue}{18 \cdot \left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \color{blue}{\left(y \cdot z\right)}, \mathsf{neg}\left(a \cdot 4\right)\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), \color{blue}{a \cdot \left(\mathsf{neg}\left(4\right)\right)}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot \color{blue}{-4}\right), t, b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
      15. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)}\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c} - \left(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)\right) \]
    4. Applied egg-rr84.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)} \]
    5. Taylor expanded in b around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f6474.0

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    7. Simplified74.0%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), t, \color{blue}{b \cdot c}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f6458.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]
    10. Simplified58.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-4 \cdot a}, t, b \cdot c\right) \]

    if -2.2999999999999999e-135 < y

    1. Initial program 88.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 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. *-lowering-*.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. *-lowering-*.f6447.1

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Simplified47.1%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right) + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot i\right) \cdot -4} + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot i, -4, \mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{x \cdot i}, -4, \mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, \color{blue}{k \cdot \left(\mathsf{neg}\left(j \cdot 27\right)\right)}\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, k \cdot \color{blue}{\left(j \cdot \left(\mathsf{neg}\left(27\right)\right)\right)}\right) \]
      10. metadata-eval47.1

        \[\leadsto \mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot \color{blue}{-27}\right)\right) \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-135}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot -4, t, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot i, -4, k \cdot \left(j \cdot -27\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 29: 24.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])\\ \\ 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.
(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);
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.
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;
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])
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])
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])){:}
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.
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])\\
\\
b \cdot c
\end{array}
Derivation
  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 b around inf

    \[\leadsto \color{blue}{b \cdot c} \]
  4. Step-by-step derivation
    1. *-lowering-*.f6424.1

      \[\leadsto \color{blue}{b \cdot c} \]
  5. Simplified24.1%

    \[\leadsto \color{blue}{b \cdot c} \]
  6. Add Preprocessing

Developer Target 1: 89.6% 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 2024199 
(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)))