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

Percentage Accurate: 85.1% → 91.6%
Time: 33.3s
Alternatives: 25
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 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.1% 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.6% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_4 \leq 10^{+283}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\

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


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

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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)) < 9.99999999999999955e282

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

    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 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-*.f6445.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(t\_1, z, a \cdot -4\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 94.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 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-*.f6445.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(t\_1, z, a \cdot -4\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 94.0%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+94}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(x \cdot \left(z \cdot t\right)\right)\right)\\

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


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

    1. Initial program 72.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 i around inf

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

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

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

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

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

    if -4e14 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6460.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. Simplified60.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 inf

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

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e-68

    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-rr94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-68 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

    1. Initial program 94.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr94.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)} \]
    5. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+94}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(x \cdot \left(z \cdot t\right)\right)\right)\\

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


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

    1. Initial program 72.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr75.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 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-*.f6459.0

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

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

    if -4e14 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6460.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. Simplified60.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 inf

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

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e-68

    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-rr94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-68 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

    1. Initial program 94.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr94.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)} \]
    5. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+94}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(x \cdot \left(z \cdot t\right)\right)\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) < -2.0000000000000002e230 or 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6457.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. Simplified57.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. *-lowering-*.f64N/A

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e-68

    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-rr94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-68 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

    1. Initial program 94.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr94.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)} \]
    5. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+94}:\\
\;\;\;\;\left(z \cdot \left(18 \cdot y\right)\right) \cdot \left(x \cdot t\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) < -2.0000000000000002e230 or 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6457.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. Simplified57.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. *-lowering-*.f64N/A

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999994e-28

    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. 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-rr93.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999994e-28 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot t\right) \cdot \left(z \cdot \color{blue}{\left(18 \cdot y\right)}\right) \]
    7. Simplified53.3%

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+94}:\\
\;\;\;\;t \cdot \left(\left(18 \cdot y\right) \cdot \left(x \cdot z\right)\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) < -2.0000000000000002e230 or 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6457.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. Simplified57.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. *-lowering-*.f64N/A

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000007e-68

    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-rr94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-68 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

    1. Initial program 94.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr94.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)} \]
    5. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+94}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\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) < -2.0000000000000002e230 or 1e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, a \cdot t, j \cdot \color{blue}{\left(k \cdot -27\right)}\right)\right) \]
      15. *-lowering-*.f6457.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. Simplified57.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. *-lowering-*.f64N/A

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999994e-28

    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. 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-rr93.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999994e-28 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e94

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_3 \leq 10^{+62}:\\
\;\;\;\;t\_2\\

\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) < -2.0000000000000002e230 or 1.00000000000000004e62 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311 or 1.99999999999999994e-28 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

    1. Initial program 85.1%

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

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999994e-28

    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. 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-rr93.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_3 \leq 10^{+62}:\\
\;\;\;\;t\_2\\

\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) < -2.0000000000000002e230 or 1.00000000000000004e62 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.999999999999969e-311 or 1.99999999999999994e-28 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

    1. Initial program 85.1%

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

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

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

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

    if -9.999999999999969e-311 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999994e-28

    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. 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-rr93.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 35.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

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

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


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

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

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

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

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

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

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

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

    if -1.00000000000000004e201 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999998e-95

    1. Initial program 85.1%

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

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. *-lowering-*.f6433.5

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified33.5%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 1.99999999999999998e-95 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

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

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

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified27.4%

      \[\leadsto \color{blue}{b \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.7%

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

Alternative 13: 35.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+62}:\\
\;\;\;\;b \cdot c\\

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


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

    1. Initial program 69.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 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-*.f6462.6

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

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

    if -1.00000000000000004e201 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999998e-95

    1. Initial program 85.1%

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

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. *-lowering-*.f6433.5

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified33.5%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 1.99999999999999998e-95 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

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

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

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified27.4%

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

    if 1.00000000000000004e62 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 73.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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-rr74.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 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-*.f6457.2

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

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

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

Alternative 14: 35.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-95}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\

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

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


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

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

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

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

    if -1.00000000000000004e201 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999998e-95

    1. Initial program 85.1%

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

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
      3. *-lowering-*.f6433.5

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified33.5%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]

    if 1.99999999999999998e-95 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

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

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

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified27.4%

      \[\leadsto \color{blue}{b \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.7%

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

Alternative 15: 35.1% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 73.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-rr74.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-*.f6461.7

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

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

    if -2.0000000000000002e230 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999982e-307

    1. Initial program 84.4%

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

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

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

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

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

    if 1.99999999999999982e-307 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

    1. Initial program 89.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-*.f6430.2

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified30.2%

      \[\leadsto \color{blue}{b \cdot c} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.6%

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.59999999999999975e-81

    1. Initial program 84.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-rr88.2%

      \[\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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999975e-81 < t < 8.49999999999999981e-25

    1. Initial program 81.0%

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

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

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

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

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

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

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

    if 8.49999999999999981e-25 < t

    1. Initial program 83.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 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. Simplified83.5%

      \[\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 3 regimes into one program.
  4. Final simplification83.7%

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

Alternative 17: 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 := \mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{-81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-25}:\\ \;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1
         (fma
          t
          (fma -4.0 a (* 18.0 (* x (* y z))))
          (fma b c (* j (* k -27.0))))))
   (if (<= t -3.5e-81)
     t_1
     (if (<= t 6.2e-25) (fma (* j k) -27.0 (fma b c (* -4.0 (* x i)))) 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(t, fma(-4.0, a, (18.0 * (x * (y * z)))), fma(b, c, (j * (k * -27.0))));
	double tmp;
	if (t <= -3.5e-81) {
		tmp = t_1;
	} else if (t <= 6.2e-25) {
		tmp = fma((j * k), -27.0, fma(b, c, (-4.0 * (x * i))));
	} 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(t, fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))), fma(b, c, Float64(j * Float64(k * -27.0))))
	tmp = 0.0
	if (t <= -3.5e-81)
		tmp = t_1;
	elseif (t <= 6.2e-25)
		tmp = fma(Float64(j * k), -27.0, fma(b, c, Float64(-4.0 * Float64(x * i))));
	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] + N[(b * c + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-81], t$95$1, If[LessEqual[t, 6.2e-25], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right), \mathsf{fma}\left(b, c, j \cdot \left(k \cdot -27\right)\right)\right)\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.49999999999999986e-81 or 6.19999999999999989e-25 < 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 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. Simplified81.6%

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

    if -3.49999999999999986e-81 < t < 6.19999999999999989e-25

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

Alternative 18: 51.2% accurate, 1.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

    if -1.00000000000000004e201 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 59.5% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{+42}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-257}:\\ \;\;\;\;t\_1 - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left(b, c, 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 (* -4.0 (* t a))) (t_2 (* x (fma -4.0 i (* t (* 18.0 (* y z)))))))
   (if (<= x -2.5e+42)
     t_2
     (if (<= x -6e-257)
       (- t_1 (* (* j 27.0) k))
       (if (<= x 2.75e-9) (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 = -4.0 * (t * a);
	double t_2 = x * fma(-4.0, i, (t * (18.0 * (y * z))));
	double tmp;
	if (x <= -2.5e+42) {
		tmp = t_2;
	} else if (x <= -6e-257) {
		tmp = t_1 - ((j * 27.0) * k);
	} else if (x <= 2.75e-9) {
		tmp = 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(-4.0 * Float64(t * a))
	t_2 = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z)))))
	tmp = 0.0
	if (x <= -2.5e+42)
		tmp = t_2;
	elseif (x <= -6e-257)
		tmp = Float64(t_1 - Float64(Float64(j * 27.0) * k));
	elseif (x <= 2.75e-9)
		tmp = 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[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e+42], t$95$2, If[LessEqual[x, -6e-257], N[(t$95$1 - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e-9], N[(b * c + 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 := -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -6 \cdot 10^{-257}:\\
\;\;\;\;t\_1 - \left(j \cdot 27\right) \cdot k\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.50000000000000003e42 or 2.7499999999999998e-9 < x

    1. Initial program 75.1%

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

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

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

    if -2.50000000000000003e42 < x < -5.9999999999999999e-257

    1. Initial program 92.1%

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

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

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

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

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

    if -5.9999999999999999e-257 < x < 2.7499999999999998e-9

    1. Initial program 89.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+42}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-257}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\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: 36.5% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 72.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-rr75.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)} \]
    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-*.f6447.6

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

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

    if -4e14 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e62

    1. Initial program 89.3%

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

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

        \[\leadsto \color{blue}{b \cdot c} \]
    5. Simplified24.9%

      \[\leadsto \color{blue}{b \cdot c} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.9%

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

Alternative 21: 72.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} 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 -1.02 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\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 -1.02e+44)
     t_1
     (if (<= x 7e-8) (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 <= -1.02e+44) {
		tmp = t_1;
	} else if (x <= 7e-8) {
		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 <= -1.02e+44)
		tmp = t_1;
	elseif (x <= 7e-8)
		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, -1.02e+44], t$95$1, If[LessEqual[x, 7e-8], 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 -1.02 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.01999999999999999e44 or 7.00000000000000048e-8 < x

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, t \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot 18\right)}\right) \]
      10. *-lowering-*.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 -1.01999999999999999e44 < x < 7.00000000000000048e-8

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\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 22: 58.2% 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}\;t \leq -1.7 \cdot 10^{-114}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t \leq 48000:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(\left(x \cdot 18\right) \cdot y, z, a \cdot -4\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 -1.7e-114)
   (* t (fma -4.0 a (* 18.0 (* x (* y z)))))
   (if (<= t 48000.0)
     (- (* -4.0 (* x i)) (* (* j 27.0) k))
     (* t (fma (* (* x 18.0) y) z (* a -4.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 (t <= -1.7e-114) {
		tmp = t * fma(-4.0, a, (18.0 * (x * (y * z))));
	} else if (t <= 48000.0) {
		tmp = (-4.0 * (x * i)) - ((j * 27.0) * k);
	} else {
		tmp = t * fma(((x * 18.0) * y), z, (a * -4.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 (t <= -1.7e-114)
		tmp = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z)))));
	elseif (t <= 48000.0)
		tmp = Float64(Float64(-4.0 * Float64(x * i)) - Float64(Float64(j * 27.0) * k));
	else
		tmp = Float64(t * fma(Float64(Float64(x * 18.0) * y), z, Float64(a * -4.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[t, -1.7e-114], N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 48000.0], N[(N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-114}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;t \leq 48000:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.69999999999999991e-114

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

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

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

    if -1.69999999999999991e-114 < t < 48000

    1. Initial program 81.7%

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

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

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

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

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

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

    if 48000 < t

    1. Initial program 82.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 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-*.f6465.2

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 23: 58.1% 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 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{if}\;t \leq -4 \cdot 10^{-111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-24}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \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 -4e-111)
     t_1
     (if (<= t 3.8e-24) (- (* -4.0 (* x i)) (* (* j 27.0) 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 <= -4e-111) {
		tmp = t_1;
	} else if (t <= 3.8e-24) {
		tmp = (-4.0 * (x * i)) - ((j * 27.0) * 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 <= -4e-111)
		tmp = t_1;
	elseif (t <= 3.8e-24)
		tmp = Float64(Float64(-4.0 * Float64(x * i)) - Float64(Float64(j * 27.0) * 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, -4e-111], t$95$1, If[LessEqual[t, 3.8e-24], N[(N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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 -4 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-24}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.00000000000000035e-111 or 3.80000000000000026e-24 < t

    1. Initial program 83.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. 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-*.f6461.0

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \color{blue}{\left(y \cdot z\right)}\right)\right) \]
    5. Simplified61.0%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]

    if -4.00000000000000035e-111 < t < 3.80000000000000026e-24

    1. Initial program 81.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 i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} - \left(j \cdot 27\right) \cdot k \]
      2. *-commutativeN/A

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
      3. *-lowering-*.f6465.2

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Simplified65.2%

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 24: 50.3% accurate, 2.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(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{if}\;t \leq -1.15 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma b c (* -4.0 (* t a)))))
   (if (<= t -1.15e-13)
     t_1
     (if (<= t 1.18e+27) (fma -4.0 (* x i) (* b c)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(b, c, (-4.0 * (t * a)));
	double tmp;
	if (t <= -1.15e-13) {
		tmp = t_1;
	} else if (t <= 1.18e+27) {
		tmp = fma(-4.0, (x * i), (b * c));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(b, c, Float64(-4.0 * Float64(t * a)))
	tmp = 0.0
	if (t <= -1.15e-13)
		tmp = t_1;
	elseif (t <= 1.18e+27)
		tmp = fma(-4.0, Float64(x * i), Float64(b * c));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e-13], t$95$1, If[LessEqual[t, 1.18e+27], N[(-4.0 * N[(x * i), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.18 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1499999999999999e-13 or 1.18000000000000006e27 < t

    1. Initial program 82.5%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in x around 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-*.f6461.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. Simplified61.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 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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]
      2. *-lowering-*.f6448.8

        \[\leadsto \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(a \cdot t\right)}\right) \]
    8. Simplified48.8%

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(a \cdot t\right)}\right) \]

    if -1.1499999999999999e-13 < t < 1.18000000000000006e27

    1. Initial program 82.7%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) + \left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(j \cdot 27\right) \cdot k\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right)} \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{k \cdot \left(j \cdot 27\right)}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
      4. associate-*r*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(k \cdot j\right) \cdot 27}\right)\right) + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(k \cdot j\right) \cdot \left(\mathsf{neg}\left(27\right)\right)} + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(k \cdot j, \mathsf{neg}\left(27\right), \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right)} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{k \cdot j}, \mathsf{neg}\left(27\right), \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, \color{blue}{-27}, \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) \]
      9. associate--l+N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) \]
      10. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4\right)} + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) \]
      11. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \left(x \cdot 4\right) \cdot i\right)}\right) \]
    4. Applied egg-rr86.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 t around 0

      \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c}\right) \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{b \cdot c + -4 \cdot \left(i \cdot x\right)}\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(i \cdot x\right)\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(b, c, \color{blue}{-4 \cdot \left(i \cdot x\right)}\right)\right) \]
      4. *-lowering-*.f6480.5

        \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \mathsf{fma}\left(b, c, -4 \cdot \color{blue}{\left(i \cdot x\right)}\right)\right) \]
    7. Simplified80.5%

      \[\leadsto \mathsf{fma}\left(k \cdot j, -27, \color{blue}{\mathsf{fma}\left(b, c, -4 \cdot \left(i \cdot x\right)\right)}\right) \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right) + b \cdot c} \]
    9. Step-by-step derivation
      1. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{i \cdot x}, b \cdot c\right) \]
      3. *-lowering-*.f6458.7

        \[\leadsto \mathsf{fma}\left(-4, i \cdot x, \color{blue}{b \cdot c}\right) \]
    10. Simplified58.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{-13}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(-4, x \cdot i, b \cdot c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 23.2% 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 82.6%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Add Preprocessing
  3. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot c} \]
  4. Step-by-step derivation
    1. *-lowering-*.f6420.1

      \[\leadsto \color{blue}{b \cdot c} \]
  5. Simplified20.1%

    \[\leadsto \color{blue}{b \cdot c} \]
  6. Add Preprocessing

Developer Target 1: 89.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
        (t_2
         (-
          (- (* (* 18.0 t) (* (* x y) z)) t_1)
          (- (* (* k j) 27.0) (* c b)))))
   (if (< t -1.6210815397541398e-69)
     t_2
     (if (< t 165.68027943805222)
       (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((a * t) + (i * x)) * 4.0d0
    t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
    if (t < (-1.6210815397541398d-69)) then
        tmp = t_2
    else if (t < 165.68027943805222d0) then
        tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = ((a * t) + (i * x)) * 4.0
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
	tmp = 0
	if t < -1.6210815397541398e-69:
		tmp = t_2
	elif t < 165.68027943805222:
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
	tmp = 0.0
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = ((a * t) + (i * x)) * 4.0;
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	tmp = 0.0;
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024205 
(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)))