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

Percentage Accurate: 85.2% → 94.2%
Time: 7.4s
Alternatives: 23
Speedup: 0.9×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 alternatives:

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

Initial Program: 85.2% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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: 94.2% accurate, 0.9× speedup?

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

\mathbf{elif}\;t \leq 6 \cdot 10^{-106}:\\
\;\;\;\;\mathsf{fma}\left(y, \left(18 \cdot x\right) \cdot \left(t \cdot z\right), \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(c, b, \left(-4 \cdot x\right) \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\

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


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

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

    if -2.4999999999999999e34 < t < 6.00000000000000037e-106

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k \]
      2. lift-+.f64N/A

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

        \[\leadsto \left(\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) - \left(j \cdot 27\right) \cdot k \]
      5. sub-flipN/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 \]
      6. 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 \]
      7. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{\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 \]
      8. lift-*.f64N/A

        \[\leadsto \left(\color{blue}{\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 \]
      9. associate-*l*N/A

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

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

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

        \[\leadsto \left(\color{blue}{y \cdot \left(\left(x \cdot 18\right) \cdot \left(z \cdot t\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 \]
      13. lower-fma.f64N/A

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

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

    if 6.00000000000000037e-106 < t

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 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. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot j}\right), k, \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 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. distribute-lft-neg-inN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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


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

    1. Initial program 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. lift--.f64N/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(j \cdot 27\right) \cdot k \]
      3. lift-+.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(z, y \cdot \left(18 \cdot x\right), -4 \cdot a\right), t, \mathsf{fma}\left(c, b, \left(-4 \cdot x\right) \cdot i\right) - k \cdot \left(27 \cdot j\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 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

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

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


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

    1. Initial program 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(j \cdot 27\right)\right) \cdot k} + \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 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. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{27 \cdot j}\right), k, \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 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. distribute-lft-neg-inN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4 \cdot x, i, \mathsf{fma}\left(\mathsf{fma}\left(z, y \cdot \left(18 \cdot x\right), -4 \cdot a\right), t, c \cdot b\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 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.1500000000000001e99

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1500000000000001e99 < i < 9.9999999999999995e32

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. lift--.f64N/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(j \cdot 27\right) \cdot k \]
      3. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999995e32 < i

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

\mathbf{elif}\;i \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(b, c, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.34999999999999988e55

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999988e55 < i < 1.7e33

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-j, k \cdot 27, \mathsf{fma}\left(-4 \cdot x, i, \mathsf{fma}\left(\mathsf{fma}\left(z, y \cdot \left(18 \cdot x\right), -4 \cdot a\right), t, c \cdot b\right)\right)\right)} \]
    4. 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)} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(b, c, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right)\right) \]
      8. lower-*.f6477.1

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

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

    if 1.7e33 < i

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.50000000000000004e-110

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

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

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

        \[\leadsto \mathsf{neg}\left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      3. lift-*.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites44.1%

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

    if -9.50000000000000004e-110 < z < 1.45e186

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

    if 1.45e186 < z

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.5999999999999998e149 or 1.8000000000000001e188 < x

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

    if -5.5999999999999998e149 < x < 1.8000000000000001e188

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.5999999999999998e149 or 1.8000000000000001e188 < x

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

    if -5.5999999999999998e149 < x < 1.8000000000000001e188

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4e145 or 4.8000000000000004e122 < x

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

    if -4e145 < x < 4.8000000000000004e122

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4e145 or 4.8000000000000004e122 < x

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

    if -4e145 < x < 4.8000000000000004e122

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

Alternative 11: 70.7% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.24999999999999999e88 or 3.4000000000000003e-35 < t

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

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

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

        \[\leadsto \mathsf{neg}\left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      3. lift-*.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites44.1%

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

    if -1.24999999999999999e88 < t < 3.4000000000000003e-35

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right) \]
      5. lower-*.f6460.0

        \[\leadsto \mathsf{fma}\left(-27, j \cdot k, \mathsf{fma}\left(-4, i \cdot x, b \cdot c\right)\right) \]
    6. Applied rewrites60.0%

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

Alternative 12: 59.2% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+164}:\\
\;\;\;\;c \cdot b - \left(27 \cdot j\right) \cdot k\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_2\\

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


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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

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

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

        \[\leadsto \mathsf{neg}\left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      3. lift-*.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t\right) \]
      5. distribute-lft-neg-inN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)\right) \cdot t \]
      7. sub-negate-revN/A

        \[\leadsto \left(-4 \cdot a - -18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t \]
    6. Applied rewrites44.1%

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

    if -inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1.9999999999999998e131 or 1e164 < (-.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)) < 5e302

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

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

    if -1.9999999999999998e131 < (-.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)) < 1e164

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

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

    if 5e302 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

Alternative 13: 57.8% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+164}:\\
\;\;\;\;c \cdot b - \left(27 \cdot j\right) \cdot k\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_2\\

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


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

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6442.9

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites42.9%

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

    if -inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1.9999999999999998e131 or 1e164 < (-.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)) < 5e302

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

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

    if -1.9999999999999998e131 < (-.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)) < 1e164

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

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

    if 5e302 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i))

    1. Initial program 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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6441.9

        \[\leadsto x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites41.9%

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

Alternative 14: 57.7% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.00000000000000003e-23 or 3.4000000000000003e-35 < t

    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. Step-by-step derivation
      1. lift--.f64N/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(j \cdot 27\right) \cdot k} \]
      2. sub-flipN/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)} \]
      3. +-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)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      5. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\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) \]
      6. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, \color{blue}{k \cdot 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) \]
      11. lower-*.f6486.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-j, k \cdot 27, \color{blue}{\left(\mathsf{neg}\left(\left(x \cdot 4\right) \cdot i\right)\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)}\right) \]
    3. Applied rewrites90.9%

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

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

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

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
      5. lower-*.f6442.9

        \[\leadsto t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
    6. Applied rewrites42.9%

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

    if -3.00000000000000003e-23 < t < 3.4000000000000003e-35

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

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

Alternative 15: 55.4% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ t_2 := b \cdot c - 4 \cdot \left(a \cdot t\right)\\ t_3 := \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+131}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 10^{+164}:\\ \;\;\;\;c \cdot b - \left(27 \cdot j\right) \cdot k\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;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 (* 18.0 (* t (* x (* y z)))))
        (t_2 (- (* b c) (* 4.0 (* a t))))
        (t_3
         (-
          (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
          (* (* x 4.0) i))))
   (if (<= t_3 (- INFINITY))
     t_1
     (if (<= t_3 -2e+131)
       t_2
       (if (<= t_3 1e+164)
         (- (* c b) (* (* 27.0 j) k))
         (if (<= t_3 INFINITY) 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 = 18.0 * (t * (x * (y * z)));
	double t_2 = (b * c) - (4.0 * (a * t));
	double t_3 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_3 <= -2e+131) {
		tmp = t_2;
	} else if (t_3 <= 1e+164) {
		tmp = (c * b) - ((27.0 * j) * k);
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
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 = 18.0 * (t * (x * (y * z)));
	double t_2 = (b * c) - (4.0 * (a * t));
	double t_3 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_3 <= -2e+131) {
		tmp = t_2;
	} else if (t_3 <= 1e+164) {
		tmp = (c * b) - ((27.0 * j) * k);
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = 18.0 * (t * (x * (y * z)))
	t_2 = (b * c) - (4.0 * (a * t))
	t_3 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)
	tmp = 0
	if t_3 <= -math.inf:
		tmp = t_1
	elif t_3 <= -2e+131:
		tmp = t_2
	elif t_3 <= 1e+164:
		tmp = (c * b) - ((27.0 * j) * k)
	elif t_3 <= math.inf:
		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 = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))
	t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t)))
	t_3 = 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))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_3 <= -2e+131)
		tmp = t_2;
	elseif (t_3 <= 1e+164)
		tmp = Float64(Float64(c * b) - Float64(Float64(27.0 * j) * k));
	elseif (t_3 <= Inf)
		tmp = t_2;
	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 = 18.0 * (t * (x * (y * z)));
	t_2 = (b * c) - (4.0 * (a * t));
	t_3 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = t_1;
	elseif (t_3 <= -2e+131)
		tmp = t_2;
	elseif (t_3 <= 1e+164)
		tmp = (c * b) - ((27.0 * j) * k);
	elseif (t_3 <= Inf)
		tmp = t_2;
	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[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -2e+131], t$95$2, If[LessEqual[t$95$3, 1e+164], N[(N[(c * b), $MachinePrecision] - N[(N[(27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], 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 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := b \cdot c - 4 \cdot \left(a \cdot t\right)\\
t_3 := \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 10^{+164}:\\
\;\;\;\;c \cdot b - \left(27 \cdot j\right) \cdot k\\

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

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


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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.7%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    8. Taylor expanded in x around inf

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

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

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \]
    10. Applied rewrites26.2%

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

    if -inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1.9999999999999998e131 or 1e164 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < +inf.0

    1. Initial program 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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

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

    if -1.9999999999999998e131 < (-.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)) < 1e164

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

      \[\leadsto \color{blue}{c \cdot b - \left(27 \cdot j\right) \cdot k} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

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

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

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


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

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

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

    if -2.0000000000000001e96 < (*.f64 b c) < 5.0000000000000001e109

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      5. lower-*.f6442.1

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
    7. Applied rewrites42.1%

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

        \[\leadsto -1 \cdot \mathsf{fma}\left(4, \color{blue}{a \cdot t}, 27 \cdot \left(j \cdot k\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right)\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \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) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \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) \]
      6. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, \mathsf{neg}\left(27 \cdot \left(j \cdot k\right)\right)\right) \]
      14. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      15. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, \left(\mathsf{neg}\left(27\right)\right) \cdot \left(j \cdot k\right)\right) \]
      16. metadata-eval42.5

        \[\leadsto \mathsf{fma}\left(t \cdot -4, a, -27 \cdot \left(j \cdot k\right)\right) \]
    9. Applied rewrites42.5%

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

    if 5.0000000000000001e109 < (*.f64 b c)

    1. Initial program 85.2%

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

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

      \[\leadsto b \cdot c - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 55.0% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+94}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+48}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b - \left(27 \cdot j\right) \cdot k\\ \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 -2e+94)
     (- (* b c) (* 27.0 (* j k)))
     (if (<= t_1 1e+48)
       (- (* b c) (* 4.0 (* a t)))
       (- (* c b) (* (* 27.0 j) k))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -2e+94) {
		tmp = (b * c) - (27.0 * (j * k));
	} else if (t_1 <= 1e+48) {
		tmp = (b * c) - (4.0 * (a * t));
	} else {
		tmp = (c * b) - ((27.0 * j) * k);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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 <= (-2d+94)) then
        tmp = (b * c) - (27.0d0 * (j * k))
    else if (t_1 <= 1d+48) then
        tmp = (b * c) - (4.0d0 * (a * t))
    else
        tmp = (c * b) - ((27.0d0 * j) * k)
    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 <= -2e+94) {
		tmp = (b * c) - (27.0 * (j * k));
	} else if (t_1 <= 1e+48) {
		tmp = (b * c) - (4.0 * (a * t));
	} else {
		tmp = (c * b) - ((27.0 * j) * k);
	}
	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 <= -2e+94:
		tmp = (b * c) - (27.0 * (j * k))
	elif t_1 <= 1e+48:
		tmp = (b * c) - (4.0 * (a * t))
	else:
		tmp = (c * b) - ((27.0 * j) * k)
	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 <= -2e+94)
		tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k)));
	elseif (t_1 <= 1e+48)
		tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t)));
	else
		tmp = Float64(Float64(c * b) - Float64(Float64(27.0 * j) * k));
	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 <= -2e+94)
		tmp = (b * c) - (27.0 * (j * k));
	elseif (t_1 <= 1e+48)
		tmp = (b * c) - (4.0 * (a * t));
	else
		tmp = (c * b) - ((27.0 * j) * k);
	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, -2e+94], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+48], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(N[(27.0 * j), $MachinePrecision] * k), $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 -2 \cdot 10^{+94}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+48}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\

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


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

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

    if -2e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e48

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

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

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

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

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

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

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

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

        \[\leadsto c \cdot b - 27 \cdot \left(j \cdot k\right) \]
      6. associate-*r*N/A

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

        \[\leadsto c \cdot b - \left(j \cdot 27\right) \cdot k \]
      8. lower-*.f64N/A

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

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
      10. lower-*.f6444.1

        \[\leadsto c \cdot b - \left(27 \cdot j\right) \cdot k \]
    9. Applied rewrites44.1%

      \[\leadsto \color{blue}{c \cdot b - \left(27 \cdot j\right) \cdot k} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 52.3% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+94}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+48}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(a \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 (- (* b c) (* 27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+94)
     t_1
     (if (<= t_2 1e+48) (- (* b c) (* 4.0 (* a 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 = (b * c) - (27.0 * (j * k));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+94) {
		tmp = t_1;
	} else if (t_2 <= 1e+48) {
		tmp = (b * c) - (4.0 * (a * t));
	} 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.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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 = (b * c) - (27.0d0 * (j * k))
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-2d+94)) then
        tmp = t_1
    else if (t_2 <= 1d+48) then
        tmp = (b * c) - (4.0d0 * (a * t))
    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 = (b * c) - (27.0 * (j * k));
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+94) {
		tmp = t_1;
	} else if (t_2 <= 1e+48) {
		tmp = (b * c) - (4.0 * (a * 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (b * c) - (27.0 * (j * k))
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -2e+94:
		tmp = t_1
	elif t_2 <= 1e+48:
		tmp = (b * c) - (4.0 * (a * 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 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k)))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+94)
		tmp = t_1;
	elseif (t_2 <= 1e+48)
		tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t)));
	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 = (b * c) - (27.0 * (j * k));
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -2e+94)
		tmp = t_1;
	elseif (t_2 <= 1e+48)
		tmp = (b * c) - (4.0 * (a * t));
	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[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+94], t$95$1, If[LessEqual[t$95$2, 1e+48], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $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 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+48}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\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) < -2e94 or 1.00000000000000004e48 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

        \[\leadsto b \cdot c - 27 \cdot \left(j \cdot k\right) \]
    7. Applied rewrites44.2%

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

    if -2e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000004e48

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

      \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(a \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 51.0% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+94}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+125}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot j\right) \cdot k\\ \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 -2e+94)
     (* -27.0 (* j k))
     (if (<= t_1 2e+125) (- (* b c) (* 4.0 (* a t))) (* (* -27.0 j) k)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -2e+94) {
		tmp = -27.0 * (j * k);
	} else if (t_1 <= 2e+125) {
		tmp = (b * c) - (4.0 * (a * t));
	} else {
		tmp = (-27.0 * j) * k;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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 <= (-2d+94)) then
        tmp = (-27.0d0) * (j * k)
    else if (t_1 <= 2d+125) then
        tmp = (b * c) - (4.0d0 * (a * t))
    else
        tmp = ((-27.0d0) * j) * k
    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 <= -2e+94) {
		tmp = -27.0 * (j * k);
	} else if (t_1 <= 2e+125) {
		tmp = (b * c) - (4.0 * (a * t));
	} else {
		tmp = (-27.0 * j) * k;
	}
	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 <= -2e+94:
		tmp = -27.0 * (j * k)
	elif t_1 <= 2e+125:
		tmp = (b * c) - (4.0 * (a * t))
	else:
		tmp = (-27.0 * j) * k
	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 <= -2e+94)
		tmp = Float64(-27.0 * Float64(j * k));
	elseif (t_1 <= 2e+125)
		tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(a * t)));
	else
		tmp = Float64(Float64(-27.0 * j) * k);
	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 <= -2e+94)
		tmp = -27.0 * (j * k);
	elseif (t_1 <= 2e+125)
		tmp = (b * c) - (4.0 * (a * t));
	else
		tmp = (-27.0 * j) * k;
	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, -2e+94], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+125], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k), $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 -2 \cdot 10^{+94}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+125}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(a \cdot t\right)\\

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


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

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

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

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

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

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

    if -2e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999998e125

    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. 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)} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

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

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

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

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

        \[\leadsto b \cdot c - \mathsf{fma}\left(4, a \cdot t, 27 \cdot \left(j \cdot k\right)\right) \]
      6. lower-*.f6461.2

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

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

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

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

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

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      4. lower-*.f6442.3

        \[\leadsto b \cdot c - 4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites42.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites23.8%

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

Alternative 20: 35.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -4 \cdot \left(i \cdot x\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+64}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-234}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-153}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot j\right) \cdot k\\ \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 (* i x))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -5e+64)
     (* -27.0 (* j k))
     (if (<= t_2 -1e-234)
       t_1
       (if (<= t_2 5e-153)
         (* -4.0 (* a t))
         (if (<= t_2 1e+91) t_1 (* (* -27.0 j) k)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -4.0 * (i * x);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+64) {
		tmp = -27.0 * (j * k);
	} else if (t_2 <= -1e-234) {
		tmp = t_1;
	} else if (t_2 <= 5e-153) {
		tmp = -4.0 * (a * t);
	} else if (t_2 <= 1e+91) {
		tmp = t_1;
	} else {
		tmp = (-27.0 * j) * k;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-234}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_2 \leq 10^{+91}:\\
\;\;\;\;t\_1\\

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


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

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

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

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

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

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

    if -5e64 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999996e-235 or 5.00000000000000033e-153 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000008e91

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} \]
      2. lower-*.f6420.8

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) \]
    4. Applied rewrites20.8%

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

    if -9.9999999999999996e-235 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000033e-153

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.7%

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

    if 1.00000000000000008e91 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites23.8%

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

Alternative 21: 35.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := -4 \cdot \left(i \cdot x\right)\\ t_3 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-234}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-153}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{elif}\;t\_3 \leq 10^{+91}:\\ \;\;\;\;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 (* -27.0 (* j k))) (t_2 (* -4.0 (* i x))) (t_3 (* (* j 27.0) k)))
   (if (<= t_3 -5e+64)
     t_1
     (if (<= t_3 -1e-234)
       t_2
       (if (<= t_3 5e-153) (* -4.0 (* a t)) (if (<= t_3 1e+91) 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 = -27.0 * (j * k);
	double t_2 = -4.0 * (i * x);
	double t_3 = (j * 27.0) * k;
	double tmp;
	if (t_3 <= -5e+64) {
		tmp = t_1;
	} else if (t_3 <= -1e-234) {
		tmp = t_2;
	} else if (t_3 <= 5e-153) {
		tmp = -4.0 * (a * t);
	} else if (t_3 <= 1e+91) {
		tmp = t_2;
	} 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.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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) :: t_3
    real(8) :: tmp
    t_1 = (-27.0d0) * (j * k)
    t_2 = (-4.0d0) * (i * x)
    t_3 = (j * 27.0d0) * k
    if (t_3 <= (-5d+64)) then
        tmp = t_1
    else if (t_3 <= (-1d-234)) then
        tmp = t_2
    else if (t_3 <= 5d-153) then
        tmp = (-4.0d0) * (a * t)
    else if (t_3 <= 1d+91) then
        tmp = t_2
    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 = -27.0 * (j * k);
	double t_2 = -4.0 * (i * x);
	double t_3 = (j * 27.0) * k;
	double tmp;
	if (t_3 <= -5e+64) {
		tmp = t_1;
	} else if (t_3 <= -1e-234) {
		tmp = t_2;
	} else if (t_3 <= 5e-153) {
		tmp = -4.0 * (a * t);
	} else if (t_3 <= 1e+91) {
		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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = -4.0 * (i * x)
	t_3 = (j * 27.0) * k
	tmp = 0
	if t_3 <= -5e+64:
		tmp = t_1
	elif t_3 <= -1e-234:
		tmp = t_2
	elif t_3 <= 5e-153:
		tmp = -4.0 * (a * t)
	elif t_3 <= 1e+91:
		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 = Float64(-27.0 * Float64(j * k))
	t_2 = Float64(-4.0 * Float64(i * x))
	t_3 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_3 <= -5e+64)
		tmp = t_1;
	elseif (t_3 <= -1e-234)
		tmp = t_2;
	elseif (t_3 <= 5e-153)
		tmp = Float64(-4.0 * Float64(a * t));
	elseif (t_3 <= 1e+91)
		tmp = t_2;
	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 = -27.0 * (j * k);
	t_2 = -4.0 * (i * x);
	t_3 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_3 <= -5e+64)
		tmp = t_1;
	elseif (t_3 <= -1e-234)
		tmp = t_2;
	elseif (t_3 <= 5e-153)
		tmp = -4.0 * (a * t);
	elseif (t_3 <= 1e+91)
		tmp = t_2;
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+64], t$95$1, If[LessEqual[t$95$3, -1e-234], t$95$2, If[LessEqual[t$95$3, 5e-153], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+91], 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 := -27 \cdot \left(j \cdot k\right)\\
t_2 := -4 \cdot \left(i \cdot x\right)\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-153}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

\mathbf{elif}\;t\_3 \leq 10^{+91}:\\
\;\;\;\;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) < -5e64 or 1.00000000000000008e91 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

    if -5e64 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999996e-235 or 5.00000000000000033e-153 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000008e91

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(i \cdot x\right)} \]
      2. lower-*.f6420.8

        \[\leadsto -4 \cdot \left(i \cdot \color{blue}{x}\right) \]
    4. Applied rewrites20.8%

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

    if -9.9999999999999996e-235 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000033e-153

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.7%

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

Alternative 22: 35.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} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+94}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+77}:\\ \;\;\;\;-4 \cdot \left(a \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 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -2e+94) t_1 (if (<= t_2 1e+77) (* -4.0 (* a 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 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+94) {
		tmp = t_1;
	} else if (t_2 <= 1e+77) {
		tmp = -4.0 * (a * t);
	} 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.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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 = (-27.0d0) * (j * k)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-2d+94)) then
        tmp = t_1
    else if (t_2 <= 1d+77) then
        tmp = (-4.0d0) * (a * t)
    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 = -27.0 * (j * k);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -2e+94) {
		tmp = t_1;
	} else if (t_2 <= 1e+77) {
		tmp = -4.0 * (a * 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])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = -27.0 * (j * k)
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -2e+94:
		tmp = t_1
	elif t_2 <= 1e+77:
		tmp = -4.0 * (a * 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 = Float64(-27.0 * Float64(j * k))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -2e+94)
		tmp = t_1;
	elseif (t_2 <= 1e+77)
		tmp = Float64(-4.0 * Float64(a * t));
	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 = -27.0 * (j * k);
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -2e+94)
		tmp = t_1;
	elseif (t_2 <= 1e+77)
		tmp = -4.0 * (a * t);
	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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+94], t$95$1, If[LessEqual[t$95$2, 1e+77], N[(-4.0 * N[(a * 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 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+77}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\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) < -2e94 or 9.99999999999999983e76 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

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

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

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

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

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

    if -2e94 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999983e76

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      7. lower-*.f6442.9

        \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
    4. Applied rewrites42.9%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    5. Taylor expanded in x around 0

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

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

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.7%

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

Alternative 23: 21.7% accurate, 6.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])\\ \\ -4 \cdot \left(a \cdot t\right) \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 (* -4.0 (* a t)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return -4.0 * (a * t);
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    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 = (-4.0d0) * (a * t)
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 -4.0 * (a * t);
}
[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 -4.0 * (a * t)
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(-4.0 * Float64(a * t))
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 = -4.0 * (a * t);
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[(-4.0 * N[(a * t), $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])\\
\\
-4 \cdot \left(a \cdot t\right)
\end{array}
Derivation
  1. Initial program 85.2%

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

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

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

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

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

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

      \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
    6. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
    7. lower-*.f6442.9

      \[\leadsto -1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot \color{blue}{a}\right)\right) \]
  4. Applied rewrites42.9%

    \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
  5. Taylor expanded in x around 0

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

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

      \[\leadsto -4 \cdot \left(a \cdot t\right) \]
  7. Applied rewrites21.7%

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

Reproduce

?
herbie shell --seed 2025150 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))