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

Percentage Accurate: 85.0% → 91.5%
Time: 32.1s
Alternatives: 23
Speedup: 1.1×

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 23 alternatives:

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

Initial Program: 85.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 96.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

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

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6460.3

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

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

    \[\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:\\ \;\;\;\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{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 2: 87.1% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;\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}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1e270 or 1.99999999999999989e273 < (-.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)) < +inf.0

    1. Initial program 88.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in j 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) + 4 \cdot \left(i \cdot x\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) - 4 \cdot \left(i \cdot x\right)} \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + \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)} \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, \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)} \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{x \cdot i}, \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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{x \cdot i}, \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) \]
      8. sub-negN/A

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

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

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

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

    if -1e270 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 1.99999999999999989e273

    1. Initial program 99.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 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-*.f6490.6

        \[\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. Simplified90.6%

      \[\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 +inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6470.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq -1 \cdot 10^{+270}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), b \cdot c\right)\right)\\ \mathbf{elif}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq 2 \cdot 10^{+273}:\\ \;\;\;\;\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}\;\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), 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 3: 53.0% accurate, 0.8× 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, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\ \;\;\;\;\left(18 \cdot z\right) \cdot \left(y \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 -5e-46)
       (* (* 18.0 z) (* y (* x t)))
       (if (<= t_2 5e-315)
         (fma b c (* a (* t -4.0)))
         (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= -5e-46) {
		tmp = (18.0 * z) * (y * (x * t));
	} else if (t_2 <= 5e-315) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= -5e-46)
		tmp = Float64(Float64(18.0 * z) * Float64(y * Float64(x * t)));
	elseif (t_2 <= 5e-315)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, -5e-46], N[(N[(18.0 * z), $MachinePrecision] * N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-315], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;\left(18 \cdot z\right) \cdot \left(y \cdot \left(x \cdot t\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999992e-46

    1. Initial program 78.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-*.f6455.8

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified55.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(y \cdot z\right)\right) \cdot x\right)} \cdot t \]
      5. associate-*l*N/A

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

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)} \cdot \left(t \cdot x\right) \]
      9. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot 18\right)\right)} \cdot \left(t \cdot x\right) \]
      10. *-lowering-*.f64N/A

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

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      13. *-lowering-*.f6463.0

        \[\leadsto \left(y \cdot \left(18 \cdot z\right)\right) \cdot \color{blue}{\left(t \cdot x\right)} \]
    7. Applied egg-rr63.0%

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

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

        \[\leadsto \color{blue}{\left(\left(t \cdot x\right) \cdot y\right) \cdot \left(18 \cdot z\right)} \]
      3. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot t\right)} \cdot y\right) \cdot \left(18 \cdot z\right) \]
      7. *-lowering-*.f6462.8

        \[\leadsto \left(\left(x \cdot t\right) \cdot y\right) \cdot \color{blue}{\left(18 \cdot z\right)} \]
    9. Applied egg-rr62.8%

      \[\leadsto \color{blue}{\left(\left(x \cdot t\right) \cdot y\right) \cdot \left(18 \cdot z\right)} \]

    if -4.99999999999999992e-46 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000023e-315

    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. 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-*.f6458.1

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

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

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

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

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

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

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

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

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

    if 5.0000000023e-315 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6463.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified63.6%

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

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

Alternative 4: 52.8% accurate, 0.8× 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, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\ \;\;\;\;\left(y \cdot \left(18 \cdot z\right)\right) \cdot \left(x \cdot t\right)\\ \mathbf{elif}\;t\_2 \leq 10^{-317}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 -5e-46)
       (* (* y (* 18.0 z)) (* x t))
       (if (<= t_2 1e-317)
         (fma b c (* a (* t -4.0)))
         (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= -5e-46) {
		tmp = (y * (18.0 * z)) * (x * t);
	} else if (t_2 <= 1e-317) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= -5e-46)
		tmp = Float64(Float64(y * Float64(18.0 * z)) * Float64(x * t));
	elseif (t_2 <= 1e-317)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, -5e-46], N[(N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-317], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;\left(y \cdot \left(18 \cdot z\right)\right) \cdot \left(x \cdot t\right)\\

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

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999992e-46

    1. Initial program 78.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-*.f6455.8

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified55.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(y \cdot z\right)\right) \cdot x\right)} \cdot t \]
      5. associate-*l*N/A

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

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)} \cdot \left(t \cdot x\right) \]
      9. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot 18\right)\right)} \cdot \left(t \cdot x\right) \]
      10. *-lowering-*.f64N/A

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

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      13. *-lowering-*.f6463.0

        \[\leadsto \left(y \cdot \left(18 \cdot z\right)\right) \cdot \color{blue}{\left(t \cdot x\right)} \]
    7. Applied egg-rr63.0%

      \[\leadsto \color{blue}{\left(y \cdot \left(18 \cdot z\right)\right) \cdot \left(t \cdot x\right)} \]

    if -4.99999999999999992e-46 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000023e-317

    1. Initial program 87.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6459.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. Simplified59.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 a around inf

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{a \cdot \left(-4 \cdot t\right)}\right) \]
      5. *-lowering-*.f6456.2

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

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

    if 1.00000023e-317 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 b around 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
    5. Simplified72.0%

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6462.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified62.6%

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

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

Alternative 5: 52.9% accurate, 0.8× 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, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(z \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 10^{-317}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 -5e-46)
       (* 18.0 (* y (* z (* x t))))
       (if (<= t_2 1e-317)
         (fma b c (* a (* t -4.0)))
         (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= -5e-46) {
		tmp = 18.0 * (y * (z * (x * t)));
	} else if (t_2 <= 1e-317) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= -5e-46)
		tmp = Float64(18.0 * Float64(y * Float64(z * Float64(x * t))));
	elseif (t_2 <= 1e-317)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, -5e-46], N[(18.0 * N[(y * N[(z * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-317], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(z \cdot \left(x \cdot t\right)\right)\right)\\

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

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999992e-46

    1. Initial program 78.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-*.f6455.8

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified55.8%

      \[\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 \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
      2. *-commutativeN/A

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

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

        \[\leadsto 18 \cdot \color{blue}{\left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(\color{blue}{\left(\left(t \cdot x\right) \cdot z\right)} \cdot y\right) \]
      6. *-lowering-*.f6469.8

        \[\leadsto 18 \cdot \left(\left(\color{blue}{\left(t \cdot x\right)} \cdot z\right) \cdot y\right) \]
    7. Applied egg-rr69.8%

      \[\leadsto 18 \cdot \color{blue}{\left(\left(\left(t \cdot x\right) \cdot z\right) \cdot y\right)} \]

    if -4.99999999999999992e-46 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000023e-317

    1. Initial program 87.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6459.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. Simplified59.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 a around inf

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{a \cdot \left(-4 \cdot t\right)}\right) \]
      5. *-lowering-*.f6456.2

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

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

    if 1.00000023e-317 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 b around 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
    5. Simplified72.0%

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6462.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified62.6%

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

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

Alternative 6: 52.7% accurate, 0.8× 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, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 -5e-46)
       (* 18.0 (* t (* y (* x z))))
       (if (<= t_2 5e-315)
         (fma b c (* a (* t -4.0)))
         (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= -5e-46) {
		tmp = 18.0 * (t * (y * (x * z)));
	} else if (t_2 <= 5e-315) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= -5e-46)
		tmp = Float64(18.0 * Float64(t * Float64(y * Float64(x * z))));
	elseif (t_2 <= 5e-315)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, -5e-46], N[(18.0 * N[(t * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-315], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999992e-46

    1. Initial program 78.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-*.f6455.8

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified55.8%

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

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

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]
      4. *-lowering-*.f6455.9

        \[\leadsto 18 \cdot \left(t \cdot \left(\color{blue}{\left(x \cdot z\right)} \cdot y\right)\right) \]
    7. Applied egg-rr55.9%

      \[\leadsto 18 \cdot \left(t \cdot \color{blue}{\left(\left(x \cdot z\right) \cdot y\right)}\right) \]

    if -4.99999999999999992e-46 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000023e-315

    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. 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-*.f6458.1

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

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

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

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

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

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

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

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

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

    if 5.0000000023e-315 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6463.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified63.6%

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

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

Alternative 7: 52.7% accurate, 0.8× 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, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 -5e-46)
       (* 18.0 (* t (* x (* y z))))
       (if (<= t_2 5e-315)
         (fma b c (* a (* t -4.0)))
         (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= -5e-46) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (t_2 <= 5e-315) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= -5e-46)
		tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))));
	elseif (t_2 <= 5e-315)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, -5e-46], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-315], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-46}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999992e-46

    1. Initial program 78.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-*.f6455.8

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified55.8%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]

    if -4.99999999999999992e-46 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000023e-315

    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. 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-*.f6458.1

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

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

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

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

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

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

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

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

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

    if 5.0000000023e-315 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6463.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified63.6%

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

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

Alternative 8: 90.6% 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} \mathbf{if}\;y \leq -6.6 \cdot 10^{+98}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(t, 18 \cdot \left(x \cdot z\right), \frac{\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)}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \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 -6.6e+98)
   (*
    y
    (fma
     t
     (* 18.0 (* x z))
     (/ (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -27.0)))) y)))
   (fma
    (* j k)
    -27.0
    (fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (fma b c (* -4.0 (* x i)))))))
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 <= -6.6e+98) {
		tmp = y * fma(t, (18.0 * (x * z)), (fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -27.0)))) / y));
	} else {
		tmp = fma((j * k), -27.0, fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), fma(b, c, (-4.0 * (x * i)))));
	}
	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 <= -6.6e+98)
		tmp = Float64(y * fma(t, Float64(18.0 * Float64(x * z)), Float64(fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -27.0)))) / y)));
	else
		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)))));
	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, -6.6e+98], N[(y * N[(t * N[(18.0 * N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\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 -6.6 \cdot 10^{+98}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(t, 18 \cdot \left(x \cdot z\right), \frac{\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)}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.60000000000000056e98

    1. Initial program 85.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 inf

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

      \[\leadsto \color{blue}{y \cdot \mathsf{fma}\left(t, \left(x \cdot z\right) \cdot 18, \frac{\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)}{y}\right)} \]

    if -6.60000000000000056e98 < y

    1. Initial program 85.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. 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-rr92.0%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+98}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(t, 18 \cdot \left(x \cdot z\right), \frac{\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)}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.2% 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 := \mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+81)
     t_1
     (if (<= t_2 5e-315)
       (fma b c (* a (* t -4.0)))
       (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+81) {
		tmp = t_1;
	} else if (t_2 <= 5e-315) {
		tmp = fma(b, c, (a * (t * -4.0)));
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+81)
		tmp = t_1;
	elseif (t_2 <= 5e-315)
		tmp = fma(b, c, Float64(a * Float64(t * -4.0)));
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+81], t$95$1, If[LessEqual[t$95$2, 5e-315], N[(b * c + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\mathsf{fma}\left(b, c, a \cdot \left(t \cdot -4\right)\right)\\

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

\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) < -1.99999999999999984e81 or 2e104 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 87.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6473.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. Simplified73.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. *-lowering-*.f64N/A

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

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

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

    if -1.99999999999999984e81 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000023e-315

    1. Initial program 84.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 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-*.f6456.2

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

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

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

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

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

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

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

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

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

    if 5.0000000023e-315 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 82.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 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6463.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified63.6%

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

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

Alternative 10: 88.4% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+225}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, y \cdot \left(18 \cdot z\right), i \cdot -4\right), x, \mathsf{fma}\left(k, j \cdot -27, t \cdot \left(a \cdot -4\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \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 -3.6e+225)
   (fma
    (fma t (* y (* 18.0 z)) (* i -4.0))
    x
    (fma k (* j -27.0) (* t (* a -4.0))))
   (fma
    (* j k)
    -27.0
    (fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (fma b c (* -4.0 (* x i)))))))
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 <= -3.6e+225) {
		tmp = fma(fma(t, (y * (18.0 * z)), (i * -4.0)), x, fma(k, (j * -27.0), (t * (a * -4.0))));
	} else {
		tmp = fma((j * k), -27.0, fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), fma(b, c, (-4.0 * (x * i)))));
	}
	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 (x <= -3.6e+225)
		tmp = fma(fma(t, Float64(y * Float64(18.0 * z)), Float64(i * -4.0)), x, fma(k, Float64(j * -27.0), Float64(t * Float64(a * -4.0))));
	else
		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)))));
	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[x, -3.6e+225], N[(N[(t * N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x + N[(k * N[(j * -27.0), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\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}\;x \leq -3.6 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, y \cdot \left(18 \cdot z\right), i \cdot -4\right), x, \mathsf{fma}\left(k, j \cdot -27, t \cdot \left(a \cdot -4\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.5999999999999998e225

    1. Initial program 61.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 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
    5. Simplified92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999998e225 < x

    1. Initial program 87.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. 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-rr92.3%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.9%

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

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

\mathbf{elif}\;i \leq 5.7 \cdot 10^{-145}:\\
\;\;\;\;\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, t\_1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.95000000000000009e144 or 5.70000000000000032e-145 < i

    1. Initial program 82.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-*.f6490.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. Simplified90.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)} \]

    if -1.95000000000000009e144 < i < 5.70000000000000032e-145

    1. Initial program 89.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 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. Simplified90.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)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -5.0000000000000002e166 or 9.9999999999999998e146 < (*.f64 b c)

    1. Initial program 79.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-*.f6472.8

        \[\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. Simplified72.8%

      \[\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6470.5

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

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

    if -5.0000000000000002e166 < (*.f64 b c) < 9.9999999999999998e146

    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. Taylor expanded in b around 0

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

Alternative 13: 53.5% 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 := \mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+50)
     t_1
     (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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, (-27.0 * (j * k)));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+50) {
		tmp = t_1;
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(-27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+50)
		tmp = t_1;
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+50], t$95$1, If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 86.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-27 \cdot \left(j \cdot k\right)}\right) \]
      4. *-lowering-*.f6469.1

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

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

    if -5e50 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

    1. Initial program 84.2%

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
      5. *-lowering-*.f6452.6

        \[\leadsto -4 \cdot \mathsf{fma}\left(i, x, \color{blue}{t \cdot a}\right) \]
    11. Simplified52.6%

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

Alternative 14: 49.4% 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 := j \cdot \left(k \cdot -27\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+104}:\\ \;\;\;\;-4 \cdot \mathsf{fma}\left(i, x, t \cdot a\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 (* j (* k -27.0))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+81)
     t_1
     (if (<= t_2 2e+104) (* -4.0 (fma i x (* t a))) 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 <= -2e+81) {
		tmp = t_1;
	} else if (t_2 <= 2e+104) {
		tmp = -4.0 * fma(i, x, (t * a));
	} 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(j * Float64(k * -27.0))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+81)
		tmp = t_1;
	elseif (t_2 <= 2e+104)
		tmp = Float64(-4.0 * fma(i, x, Float64(t * a)));
	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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+81], t$95$1, If[LessEqual[t$95$2, 2e+104], N[(-4.0 * N[(i * x + N[(t * a), $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 := j \cdot \left(k \cdot -27\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 87.7%

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

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

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

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

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

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

        \[\leadsto j \cdot \color{blue}{\left(k \cdot -27\right)} \]
      6. *-lowering-*.f6456.9

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

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

    if -1.99999999999999984e81 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e104

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + -4 \cdot \left(i \cdot x\right)\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. distribute-lft-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 59.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} 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.8 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.85 \cdot 10^{-230}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(a, t \cdot -4, -27 \cdot \left(j \cdot k\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.8e+61)
     t_1
     (if (<= x -2.85e-230)
       (- (* b c) (* (* j 27.0) k))
       (if (<= x 1.55e+43) (fma a (* t -4.0) (* -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 = x * fma(-4.0, i, (t * (18.0 * (y * z))));
	double tmp;
	if (x <= -2.8e+61) {
		tmp = t_1;
	} else if (x <= -2.85e-230) {
		tmp = (b * c) - ((j * 27.0) * k);
	} else if (x <= 1.55e+43) {
		tmp = fma(a, (t * -4.0), (-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(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))))
	tmp = 0.0
	if (x <= -2.8e+61)
		tmp = t_1;
	elseif (x <= -2.85e-230)
		tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k));
	elseif (x <= 1.55e+43)
		tmp = fma(a, Float64(t * -4.0), 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[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+61], t$95$1, If[LessEqual[x, -2.85e-230], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+43], N[(a * N[(t * -4.0), $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 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.8000000000000001e61 or 1.5500000000000001e43 < x

    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 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-*.f6473.9

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

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

    if -2.8000000000000001e61 < x < -2.84999999999999984e-230

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

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

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

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

    if -2.84999999999999984e-230 < x < 1.5500000000000001e43

    1. Initial program 95.6%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 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-*.f6486.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. Simplified86.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. 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}{-4 \cdot \left(a \cdot t\right) + -27 \cdot \left(j \cdot k\right)} \]
      2. associate-*r*N/A

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq -2.85 \cdot 10^{-230}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(a, t \cdot -4, -27 \cdot \left(j \cdot k\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 16: 58.2% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.4e90

    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. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

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

    if -5.4e90 < t < -1.19999999999999994e-298

    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. 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-rr86.7%

      \[\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)} \]
    5. Taylor expanded in i around inf

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

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

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

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

    if -1.19999999999999994e-298 < t < 2.15000000000000004e27

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6470.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. Simplified70.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 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. *-lowering-*.f64N/A

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

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

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

    if 2.15000000000000004e27 < t

    1. Initial program 89.2%

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - \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)} \]
      2. associate--r+N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
    5. Simplified78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 58.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} t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{+90}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-298}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+26}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\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 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
   (if (<= t -1.7e+90)
     t_1
     (if (<= t -1.35e-298)
       (fma (* j k) -27.0 (* -4.0 (* x i)))
       (if (<= t 1.2e+26) (fma 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 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
	double tmp;
	if (t <= -1.7e+90) {
		tmp = t_1;
	} else if (t <= -1.35e-298) {
		tmp = fma((j * k), -27.0, (-4.0 * (x * i)));
	} else if (t <= 1.2e+26) {
		tmp = fma(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(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))))
	tmp = 0.0
	if (t <= -1.7e+90)
		tmp = t_1;
	elseif (t <= -1.35e-298)
		tmp = fma(Float64(j * k), -27.0, Float64(-4.0 * Float64(x * i)));
	elseif (t <= 1.2e+26)
		tmp = fma(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[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+90], t$95$1, If[LessEqual[t, -1.35e-298], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+26], N[(b * c + 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 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.70000000000000009e90 or 1.20000000000000002e26 < t

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000009e90 < t < -1.3500000000000001e-298

    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. 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-rr86.7%

      \[\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)} \]
    5. Taylor expanded in i around inf

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

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

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

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

    if -1.3500000000000001e-298 < t < 1.20000000000000002e26

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6470.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. Simplified70.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 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. *-lowering-*.f64N/A

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

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

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

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

Alternative 18: 49.4% 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}\;x \leq -1.3 \cdot 10^{+117}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-229}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{+99}:\\ \;\;\;\;\mathsf{fma}\left(a, t \cdot -4, -27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(18 \cdot z\right) \cdot \left(y \cdot \left(x \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 (<= x -1.3e+117)
   (fma (* j k) -27.0 (* -4.0 (* x i)))
   (if (<= x -1.02e-229)
     (- (* b c) (* (* j 27.0) k))
     (if (<= x 5.3e+99)
       (fma a (* t -4.0) (* -27.0 (* j k)))
       (* (* 18.0 z) (* y (* x 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 (x <= -1.3e+117) {
		tmp = fma((j * k), -27.0, (-4.0 * (x * i)));
	} else if (x <= -1.02e-229) {
		tmp = (b * c) - ((j * 27.0) * k);
	} else if (x <= 5.3e+99) {
		tmp = fma(a, (t * -4.0), (-27.0 * (j * k)));
	} else {
		tmp = (18.0 * z) * (y * (x * 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 (x <= -1.3e+117)
		tmp = fma(Float64(j * k), -27.0, Float64(-4.0 * Float64(x * i)));
	elseif (x <= -1.02e-229)
		tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k));
	elseif (x <= 5.3e+99)
		tmp = fma(a, Float64(t * -4.0), Float64(-27.0 * Float64(j * k)));
	else
		tmp = Float64(Float64(18.0 * z) * Float64(y * Float64(x * 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[x, -1.3e+117], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.02e-229], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.3e+99], N[(a * N[(t * -4.0), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * z), $MachinePrecision] * N[(y * N[(x * 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}\;x \leq -1.3 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, -4 \cdot \left(x \cdot i\right)\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;\left(18 \cdot z\right) \cdot \left(y \cdot \left(x \cdot t\right)\right)\\


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

    1. Initial program 69.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. 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-rr82.7%

      \[\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)} \]
    5. Taylor expanded in i around inf

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

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

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

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

    if -1.3e117 < x < -1.02e-229

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

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

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

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

    if -1.02e-229 < x < 5.30000000000000034e99

    1. Initial program 94.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-*.f6483.2

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

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

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

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

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

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

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

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

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

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

    if 5.30000000000000034e99 < x

    1. Initial program 71.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-*.f6450.0

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified50.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. *-commutativeN/A

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

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

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

        \[\leadsto \color{blue}{\left(\left(18 \cdot \left(y \cdot z\right)\right) \cdot x\right)} \cdot t \]
      5. associate-*l*N/A

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

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)} \cdot \left(t \cdot x\right) \]
      9. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot 18\right)\right)} \cdot \left(t \cdot x\right) \]
      10. *-lowering-*.f64N/A

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

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \left(y \cdot \color{blue}{\left(18 \cdot z\right)}\right) \cdot \left(t \cdot x\right) \]
      13. *-lowering-*.f6447.6

        \[\leadsto \left(y \cdot \left(18 \cdot z\right)\right) \cdot \color{blue}{\left(t \cdot x\right)} \]
    7. Applied egg-rr47.6%

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

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

        \[\leadsto \color{blue}{\left(\left(t \cdot x\right) \cdot y\right) \cdot \left(18 \cdot z\right)} \]
      3. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot t\right)} \cdot y\right) \cdot \left(18 \cdot z\right) \]
      7. *-lowering-*.f6450.2

        \[\leadsto \left(\left(x \cdot t\right) \cdot y\right) \cdot \color{blue}{\left(18 \cdot z\right)} \]
    9. Applied egg-rr50.2%

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

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

Alternative 19: 72.7% 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 -7.5 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{+92}:\\ \;\;\;\;\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 -7.5e+116)
     t_1
     (if (<= x 4.7e+92) (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 <= -7.5e+116) {
		tmp = t_1;
	} else if (x <= 4.7e+92) {
		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 <= -7.5e+116)
		tmp = t_1;
	elseif (x <= 4.7e+92)
		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, -7.5e+116], t$95$1, If[LessEqual[x, 4.7e+92], 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 -7.5 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5e116 or 4.7e92 < x

    1. Initial program 71.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 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-*.f6479.2

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

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

    if -7.5e116 < x < 4.7e92

    1. Initial program 92.8%

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

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

        \[\leadsto \color{blue}{b \cdot c + \left(\mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right)\right)} \]
      2. 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-*.f6477.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{+92}:\\ \;\;\;\;\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 20: 77.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} \mathbf{if}\;y \leq -1.7 \cdot 10^{+182}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, 18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \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 -1.7e+182)
   (fma (* j k) -27.0 (* 18.0 (* z (* t (* x y)))))
   (fma b c (fma -4.0 (fma a t (* x i)) (* j (* k -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 <= -1.7e+182) {
		tmp = fma((j * k), -27.0, (18.0 * (z * (t * (x * y)))));
	} else {
		tmp = fma(b, c, fma(-4.0, fma(a, t, (x * i)), (j * (k * -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 <= -1.7e+182)
		tmp = fma(Float64(j * k), -27.0, Float64(18.0 * Float64(z * Float64(t * Float64(x * y)))));
	else
		tmp = fma(b, c, fma(-4.0, fma(a, t, Float64(x * i)), Float64(j * Float64(k * -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, -1.7e+182], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(18.0 * N[(z * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c + N[(-4.0 * N[(a * t + N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $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.7 \cdot 10^{+182}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, 18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.69999999999999993e182

    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. 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-rr89.9%

      \[\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)} \]
    5. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999993e182 < y

    1. Initial program 84.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 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-*.f6480.4

        \[\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. Simplified80.4%

      \[\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. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+182}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, 18 \cdot \left(z \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 37.9% accurate, 2.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -1.65 \cdot 10^{+84}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 5.35 \cdot 10^{+101}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -1.65e+84)
   (* b c)
   (if (<= (* b c) 5.35e+101) (* 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 tmp;
	if ((b * c) <= -1.65e+84) {
		tmp = b * c;
	} else if ((b * c) <= 5.35e+101) {
		tmp = j * (k * -27.0);
	} 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) :: tmp
    if ((b * c) <= (-1.65d+84)) then
        tmp = b * c
    else if ((b * c) <= 5.35d+101) then
        tmp = j * (k * (-27.0d0))
    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 tmp;
	if ((b * c) <= -1.65e+84) {
		tmp = b * c;
	} else if ((b * c) <= 5.35e+101) {
		tmp = j * (k * -27.0);
	} 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):
	tmp = 0
	if (b * c) <= -1.65e+84:
		tmp = b * c
	elif (b * c) <= 5.35e+101:
		tmp = j * (k * -27.0)
	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)
	tmp = 0.0
	if (Float64(b * c) <= -1.65e+84)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 5.35e+101)
		tmp = Float64(j * Float64(k * -27.0));
	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)
	tmp = 0.0;
	if ((b * c) <= -1.65e+84)
		tmp = b * c;
	elseif ((b * c) <= 5.35e+101)
		tmp = j * (k * -27.0);
	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_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.65e+84], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5.35e+101], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.65 \cdot 10^{+84}:\\
\;\;\;\;b \cdot c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1.65000000000000008e84 or 5.35000000000000009e101 < (*.f64 b c)

    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. Taylor expanded in b around inf

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

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

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

    if -1.65000000000000008e84 < (*.f64 b c) < 5.35000000000000009e101

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

Alternative 22: 38.0% accurate, 2.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -2.1000000000000001e85 or 2.20000000000000007e102 < (*.f64 b c)

    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. Taylor expanded in b around inf

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

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

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

    if -2.1000000000000001e85 < (*.f64 b c) < 2.20000000000000007e102

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. 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-rr89.6%

      \[\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)} \]
    5. Taylor expanded in k around inf

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

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

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

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

Alternative 23: 23.7% 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 85.2%

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
  5. Simplified22.7%

    \[\leadsto \color{blue}{b \cdot c} \]
  6. Add Preprocessing

Developer Target 1: 89.2% 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 2024204 
(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)))