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

Percentage Accurate: 85.0% → 91.4%
Time: 8.2s
Alternatives: 21
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
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 21 alternatives:

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

Initial Program: 85.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
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: 91.4% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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)) < 9.99999999999999981e295

    1. Initial program 85.0%

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

    if 9.99999999999999981e295 < (-.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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.4% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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)) < 9.99999999999999981e295

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

    if 9.99999999999999981e295 < (-.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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.9% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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)) < 9.99999999999999981e295

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot \color{blue}{\left(z \cdot t\right)} - \left(a \cdot 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. Applied rewrites82.9%

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

    if 9.99999999999999981e295 < (-.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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.9% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.7% 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(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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 (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 (fma a t (* i x))))))
   (fma (* -27.0 j) k (fma (fma (* (* t y) z) 18.0 (* -4.0 i)) x (* c b)))))
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((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * fma(a, t, (i * x))))));
	} else {
		tmp = fma((-27.0 * j), k, fma(fma(((t * y) * z), 18.0, (-4.0 * i)), x, (c * b)));
	}
	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(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x))))));
	else
		tmp = fma(Float64(-27.0 * j), k, fma(fma(Float64(Float64(t * y) * z), 18.0, Float64(-4.0 * i)), x, Float64(c * b)));
	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[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(c * b), $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(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 88.6% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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.0%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right), x, c \cdot b\right) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\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.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.1% accurate, 0.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\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)) < 9.99999999999999981e295

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(b \cdot c - 4 \cdot \left(a \cdot t\right)\right) - 4 \cdot \left(i \cdot x\right)\right) \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(a \cdot t\right) + \left(b \cdot c - 4 \cdot \left(i \cdot x\right)\right)\right) \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

Alternative 8: 84.9% accurate, 0.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x\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)) < 9.99999999999999981e295

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(b \cdot c - 4 \cdot \left(a \cdot t\right)\right) - 4 \cdot \left(i \cdot x\right)\right) \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(a \cdot t\right) + \left(b \cdot c - 4 \cdot \left(i \cdot x\right)\right)\right) \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

Alternative 9: 74.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

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

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

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{a \cdot t}{y}, -4, \left(\left(z \cdot x\right) \cdot t\right) \cdot 18\right) \cdot y \]
      14. lower-*.f6438.6

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

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

      \[\leadsto \left(t \cdot \left(-4 \cdot \frac{a}{y} + 18 \cdot \left(x \cdot z\right)\right)\right) \cdot y \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{a}{y}, -4, \left(z \cdot x\right) \cdot 18\right) \cdot t\right) \cdot y \]
      9. lift-*.f6440.8

        \[\leadsto \left(\mathsf{fma}\left(\frac{a}{y}, -4, \left(z \cdot x\right) \cdot 18\right) \cdot t\right) \cdot y \]
    10. Applied rewrites40.8%

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

    if -1.7499999999999999e-18 < z < 3.1999999999999999e209

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(b \cdot c - 4 \cdot \left(a \cdot t\right)\right) - 4 \cdot \left(i \cdot x\right)\right) \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(a \cdot t\right) + \left(b \cdot c - 4 \cdot \left(i \cdot x\right)\right)\right) \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

    if 3.1999999999999999e209 < z

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18, x, c \cdot b\right)\right) \]
      6. lift-*.f6461.9

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

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

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

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

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


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

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

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

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

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{a \cdot t}{y}, -4, \left(\left(z \cdot x\right) \cdot t\right) \cdot 18\right) \cdot y \]
      14. lower-*.f6438.6

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

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

      \[\leadsto \left(t \cdot \left(-4 \cdot \frac{a}{y} + 18 \cdot \left(x \cdot z\right)\right)\right) \cdot y \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{a}{y}, -4, \left(z \cdot x\right) \cdot 18\right) \cdot t\right) \cdot y \]
      9. lift-*.f6440.8

        \[\leadsto \left(\mathsf{fma}\left(\frac{a}{y}, -4, \left(z \cdot x\right) \cdot 18\right) \cdot t\right) \cdot y \]
    10. Applied rewrites40.8%

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

    if -1.7499999999999999e-18 < z < 2.8999999999999998e227

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(b \cdot c - 4 \cdot \left(a \cdot t\right)\right) - 4 \cdot \left(i \cdot x\right)\right) \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(a \cdot t\right) + \left(b \cdot c - 4 \cdot \left(i \cdot x\right)\right)\right) \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

    if 2.8999999999999998e227 < z

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f64N/A

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

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

        \[\leadsto \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot 18 + -4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      5. lower-fma.f64N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      10. lift-*.f6459.2

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

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

      \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f64N/A

        \[\leadsto \left(\left(t \cdot \left(y \cdot z\right)\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot t\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
      6. lift-*.f6444.0

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
    10. Applied rewrites44.0%

      \[\leadsto \left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2000000000000001e73 or 8.5999999999999998e55 < x

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \cdot x \]
      7. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x \]
      13. lift-*.f6442.1

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

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

    if -5.2000000000000001e73 < x < 8.5999999999999998e55

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, b \cdot c - 4 \cdot \left(a \cdot t\right)\right) \]
    6. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

Alternative 12: 58.9% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.4999999999999998e-63

    1. Initial program 85.0%

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right) \cdot x \]
      4. associate-*r*N/A

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

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

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

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

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

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

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

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

    if -6.4999999999999998e-63 < x < 8.00000000000000008e55

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

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

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

    if 8.00000000000000008e55 < x

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + -4 \cdot i\right) \cdot x \]
      7. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right) \cdot x \]
      13. lift-*.f6442.1

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

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

Alternative 13: 58.9% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4999999999999998e-63 or 8.00000000000000008e55 < x

    1. Initial program 85.0%

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

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(4\right)\right) \cdot i\right) \cdot x \]
      4. associate-*r*N/A

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

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

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

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

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

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

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

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

    if -6.4999999999999998e-63 < x < 8.00000000000000008e55

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

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

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

Alternative 14: 55.0% 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(-27 \cdot j, k, c \cdot b\right)\\ \mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \cdot c \leq 10^{+135}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot x, -4, \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 (fma (* -27.0 j) k (* c b))))
   (if (<= (* b c) -1e+62)
     t_1
     (if (<= (* b c) 1e+135) (fma (* i x) -4.0 (* (* -27.0 j) k)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma((-27.0 * j), k, (c * b));
	double tmp;
	if ((b * c) <= -1e+62) {
		tmp = t_1;
	} else if ((b * c) <= 1e+135) {
		tmp = fma((i * x), -4.0, ((-27.0 * j) * k));
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(Float64(-27.0 * j), k, Float64(c * b))
	tmp = 0.0
	if (Float64(b * c) <= -1e+62)
		tmp = t_1;
	elseif (Float64(b * c) <= 1e+135)
		tmp = fma(Float64(i * x), -4.0, 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[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+62], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1e+135], N[(N[(i * x), $MachinePrecision] * -4.0 + 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 := \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \cdot c \leq 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot x, -4, \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 (*.f64 b c) < -1.00000000000000004e62 or 9.99999999999999962e134 < (*.f64 b c)

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

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

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

    if -1.00000000000000004e62 < (*.f64 b c) < 9.99999999999999962e134

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, \left(-27 \cdot j\right) \cdot k\right) \]
      8. lift-*.f6441.8

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, \left(-27 \cdot j\right) \cdot k\right) \]
    10. Applied rewrites41.8%

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

Alternative 15: 48.4% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 85.0%

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

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

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

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

        \[\leadsto \left(-4 \cdot i\right) \cdot x \]
    4. Applied rewrites21.0%

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

    if -3.65e158 < x < 3.10000000000000005e56

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

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

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

    if 3.10000000000000005e56 < x

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

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

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

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t \]
      5. lift-*.f64N/A

        \[\leadsto -\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t \]
      6. lift-*.f6426.1

        \[\leadsto -\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t \]
    7. Applied rewrites26.1%

      \[\leadsto -\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot -18\right) \cdot t \]
      2. lift-*.f64N/A

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

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

        \[\leadsto -\left(\left(x \cdot \left(y \cdot z\right)\right) \cdot -18\right) \cdot t \]
      5. associate-*r*N/A

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

        \[\leadsto -\left(\left(\left(x \cdot y\right) \cdot z\right) \cdot -18\right) \cdot t \]
      7. *-commutativeN/A

        \[\leadsto -\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot -18\right) \cdot t \]
      8. lower-*.f6426.9

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

      \[\leadsto -\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot -18\right) \cdot t \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot -18\right) \cdot t \]
      2. lift-*.f64N/A

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

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

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

        \[\leadsto -\left(\left(y \cdot \left(z \cdot x\right)\right) \cdot -18\right) \cdot t \]
      6. lift-*.f6426.7

        \[\leadsto -\left(\left(y \cdot \left(z \cdot x\right)\right) \cdot -18\right) \cdot t \]
    11. Applied rewrites26.7%

      \[\leadsto -\left(\left(y \cdot \left(z \cdot x\right)\right) \cdot -18\right) \cdot t \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

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

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

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


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

    1. Initial program 85.0%

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

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

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

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

        \[\leadsto \left(-4 \cdot i\right) \cdot x \]
    4. Applied rewrites21.0%

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

    if -3.65e158 < x < 3.10000000000000005e56

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

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

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

    if 3.10000000000000005e56 < x

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

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

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

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6443.0

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites43.0%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      3. lift-*.f6421.7

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    7. Applied rewrites21.7%

      \[\leadsto \left(-4 \cdot a\right) \cdot \color{blue}{t} \]
    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. *-commutativeN/A

        \[\leadsto \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot 18 \]
      2. lower-*.f64N/A

        \[\leadsto \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot 18 \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(x \cdot \left(y \cdot z\right)\right) \cdot t\right) \cdot 18 \]
      4. lower-*.f64N/A

        \[\leadsto \left(\left(x \cdot \left(y \cdot z\right)\right) \cdot t\right) \cdot 18 \]
      5. *-commutativeN/A

        \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      6. *-commutativeN/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      7. lift-*.f64N/A

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      8. lift-*.f6426.1

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
    10. Applied rewrites26.1%

      \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot \color{blue}{18} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 47.8% accurate, 2.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(-4 \cdot i\right) \cdot x\\ \mathbf{if}\;x \leq -3.65 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+228}:\\ \;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, c \cdot b\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 (* (* -4.0 i) x)))
   (if (<= x -3.65e+158)
     t_1
     (if (<= x 2.8e+228) (fma (* -27.0 j) k (* 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 = (-4.0 * i) * x;
	double tmp;
	if (x <= -3.65e+158) {
		tmp = t_1;
	} else if (x <= 2.8e+228) {
		tmp = fma((-27.0 * j), k, (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(Float64(-4.0 * i) * x)
	tmp = 0.0
	if (x <= -3.65e+158)
		tmp = t_1;
	elseif (x <= 2.8e+228)
		tmp = fma(Float64(-27.0 * j), k, 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[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.65e+158], t$95$1, If[LessEqual[x, 2.8e+228], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b), $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 := \left(-4 \cdot i\right) \cdot x\\
\mathbf{if}\;x \leq -3.65 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.65e158 or 2.7999999999999999e228 < x

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-4 \cdot i\right) \cdot \color{blue}{x} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot i\right) \cdot \color{blue}{x} \]
      3. lower-*.f6421.0

        \[\leadsto \left(-4 \cdot i\right) \cdot x \]
    4. Applied rewrites21.0%

      \[\leadsto \color{blue}{\left(-4 \cdot i\right) \cdot x} \]

    if -3.65e158 < x < 2.7999999999999999e228

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in i around 0

      \[\leadsto \color{blue}{\left(\left(-4 \cdot \left(i \cdot x\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - 4 \cdot \left(a \cdot t\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - 4 \cdot \left(a \cdot t\right)\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      2. associate-*r*N/A

        \[\leadsto \left(\left(-4 \cdot i\right) \cdot x + \left(\color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)} - 4 \cdot \left(a \cdot t\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      3. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(\left(-4 \cdot i\right) \cdot x + \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot t\right)}\right)\right) - \left(j \cdot 27\right) \cdot k \]
      4. metadata-evalN/A

        \[\leadsto \left(\left(-4 \cdot i\right) \cdot x + \left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) + -4 \cdot \left(\color{blue}{a} \cdot t\right)\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. +-commutativeN/A

        \[\leadsto \left(\left(-4 \cdot i\right) \cdot x + \left(-4 \cdot \left(a \cdot t\right) + \color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)}\right)\right) - \left(j \cdot 27\right) \cdot k \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-4 \cdot i, \color{blue}{x}, -4 \cdot \left(a \cdot t\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(j \cdot 27\right) \cdot k \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4 \cdot i, x, -4 \cdot \left(a \cdot t\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(j \cdot 27\right) \cdot k \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-4 \cdot i, x, \left(-4 \cdot a\right) \cdot t + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(j \cdot 27\right) \cdot k \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-4 \cdot a, t, 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(j \cdot 27\right) \cdot k \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-4 \cdot a, t, 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied rewrites88.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4 \cdot i, x, \mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t, 18, c \cdot b\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Taylor expanded in t around 0

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    6. Step-by-step derivation
      1. associate--r+N/A

        \[\leadsto \left(b \cdot c - 4 \cdot \left(i \cdot x\right)\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      2. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(b \cdot c + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(i \cdot x\right)\right) - \color{blue}{27} \cdot \left(j \cdot k\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(b \cdot c + -4 \cdot \left(i \cdot x\right)\right) - 27 \cdot \left(j \cdot k\right) \]
      4. +-commutativeN/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - \color{blue}{27} \cdot \left(j \cdot k\right) \]
      5. lower--.f64N/A

        \[\leadsto \left(-4 \cdot \left(i \cdot x\right) + b \cdot c\right) - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
      6. *-commutativeN/A

        \[\leadsto \left(\left(i \cdot x\right) \cdot -4 + b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, b \cdot c\right) - \color{blue}{27} \cdot \left(j \cdot k\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, b \cdot c\right) - 27 \cdot \left(j \cdot k\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - 27 \cdot \left(j \cdot k\right) \]
      10. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - 27 \cdot \left(j \cdot k\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - \left(j \cdot k\right) \cdot \color{blue}{27} \]
      12. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - \left(j \cdot k\right) \cdot \color{blue}{27} \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - \left(k \cdot j\right) \cdot 27 \]
      14. lift-*.f6460.4

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - \left(k \cdot j\right) \cdot 27 \]
    7. Applied rewrites60.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) - \left(k \cdot j\right) \cdot 27} \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot c - \color{blue}{27 \cdot \left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

        \[\leadsto b \cdot c + \left(\mathsf{neg}\left(27\right)\right) \cdot \color{blue}{\left(j \cdot k\right)} \]
      2. metadata-evalN/A

        \[\leadsto b \cdot c + -27 \cdot \left(j \cdot k\right) \]
      3. +-commutativeN/A

        \[\leadsto -27 \cdot \left(j \cdot k\right) + b \cdot \color{blue}{c} \]
      4. associate-*l*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot k + b \cdot c \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, b \cdot c\right) \]
      6. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, b \cdot c\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
      8. lift-*.f6444.7

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, c \cdot b\right) \]
    10. Applied rewrites44.7%

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, \color{blue}{k}, c \cdot b\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 35.7% accurate, 1.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(-27 \cdot j\right) \cdot k\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-105}:\\ \;\;\;\;\left(-4 \cdot a\right) \cdot t\\ \mathbf{elif}\;t\_2 \leq 10000000000:\\ \;\;\;\;\left(-4 \cdot i\right) \cdot x\\ \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 -1e+177)
     t_1
     (if (<= t_2 -5e-105)
       (* (* -4.0 a) t)
       (if (<= t_2 10000000000.0) (* (* -4.0 i) x) 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 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= -5e-105) {
		tmp = (-4.0 * a) * t;
	} else if (t_2 <= 10000000000.0) {
		tmp = (-4.0 * i) * x;
	} 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 <= (-1d+177)) then
        tmp = t_1
    else if (t_2 <= (-5d-105)) then
        tmp = ((-4.0d0) * a) * t
    else if (t_2 <= 10000000000.0d0) then
        tmp = ((-4.0d0) * i) * x
    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 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= -5e-105) {
		tmp = (-4.0 * a) * t;
	} else if (t_2 <= 10000000000.0) {
		tmp = (-4.0 * i) * x;
	} 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 <= -1e+177:
		tmp = t_1
	elif t_2 <= -5e-105:
		tmp = (-4.0 * a) * t
	elif t_2 <= 10000000000.0:
		tmp = (-4.0 * i) * x
	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(-27.0 * j) * k)
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= -5e-105)
		tmp = Float64(Float64(-4.0 * a) * t);
	elseif (t_2 <= 10000000000.0)
		tmp = Float64(Float64(-4.0 * i) * x);
	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 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= -5e-105)
		tmp = (-4.0 * a) * t;
	elseif (t_2 <= 10000000000.0)
		tmp = (-4.0 * i) * x;
	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[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+177], t$95$1, If[LessEqual[t$95$2, -5e-105], N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$2, 10000000000.0], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(-27 \cdot j\right) \cdot k\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-105}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\

\mathbf{elif}\;t\_2 \leq 10000000000:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\

\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) < -1e177 or 1e10 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. *-commutativeN/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6424.5

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    4. Applied rewrites24.5%

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      2. *-commutativeN/A

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      3. lower-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      4. associate-*r*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      5. lower-*.f64N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      6. lower-*.f6424.5

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites24.5%

      \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]

    if -1e177 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999963e-105

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

        \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      4. lower-*.f64N/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6443.0

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites43.0%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      3. lift-*.f6421.7

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    7. Applied rewrites21.7%

      \[\leadsto \left(-4 \cdot a\right) \cdot \color{blue}{t} \]

    if -4.99999999999999963e-105 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e10

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in i around inf

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-4 \cdot i\right) \cdot \color{blue}{x} \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot i\right) \cdot \color{blue}{x} \]
      3. lower-*.f6421.0

        \[\leadsto \left(-4 \cdot i\right) \cdot x \]
    4. Applied rewrites21.0%

      \[\leadsto \color{blue}{\left(-4 \cdot i\right) \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 35.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 := \left(-27 \cdot j\right) \cdot k\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+25}:\\ \;\;\;\;\left(-4 \cdot a\right) \cdot t\\ \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 -1e+177) t_1 (if (<= t_2 2e+25) (* (* -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 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= 2e+25) {
		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 <= (-1d+177)) then
        tmp = t_1
    else if (t_2 <= 2d+25) 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 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= 2e+25) {
		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 <= -1e+177:
		tmp = t_1
	elif t_2 <= 2e+25:
		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(Float64(-27.0 * j) * k)
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= 2e+25)
		tmp = Float64(Float64(-4.0 * 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 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= 2e+25)
		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[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+177], t$95$1, If[LessEqual[t$95$2, 2e+25], N[(N[(-4.0 * a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(-27 \cdot j\right) \cdot k\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\

\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) < -1e177 or 2.00000000000000018e25 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. *-commutativeN/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6424.5

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    4. Applied rewrites24.5%

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      2. *-commutativeN/A

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      3. lower-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      4. associate-*r*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      5. lower-*.f64N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      6. lower-*.f6424.5

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites24.5%

      \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]

    if -1e177 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000018e25

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

        \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      4. lower-*.f64N/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6443.0

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites43.0%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      3. lift-*.f6421.7

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    7. Applied rewrites21.7%

      \[\leadsto \left(-4 \cdot a\right) \cdot \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 35.5% 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(k \cdot j\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+25}:\\ \;\;\;\;\left(-4 \cdot a\right) \cdot t\\ \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 (* k j))) (t_2 (* (* j 27.0) k)))
   (if (<= t_2 -1e+177) t_1 (if (<= t_2 2e+25) (* (* -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 * (k * j);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= 2e+25) {
		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) * (k * j)
    t_2 = (j * 27.0d0) * k
    if (t_2 <= (-1d+177)) then
        tmp = t_1
    else if (t_2 <= 2d+25) 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 * (k * j);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -1e+177) {
		tmp = t_1;
	} else if (t_2 <= 2e+25) {
		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 * (k * j)
	t_2 = (j * 27.0) * k
	tmp = 0
	if t_2 <= -1e+177:
		tmp = t_1
	elif t_2 <= 2e+25:
		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(k * j))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= 2e+25)
		tmp = Float64(Float64(-4.0 * 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 * (k * j);
	t_2 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_2 <= -1e+177)
		tmp = t_1;
	elseif (t_2 <= 2e+25)
		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[(k * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+177], t$95$1, If[LessEqual[t$95$2, 2e+25], N[(N[(-4.0 * a), $MachinePrecision] * t), $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(k \cdot j\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot t\\

\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) < -1e177 or 2.00000000000000018e25 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. *-commutativeN/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6424.5

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    4. Applied rewrites24.5%

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]

    if -1e177 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000018e25

    1. Initial program 85.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. 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. 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) \]
      2. lower-neg.f64N/A

        \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      4. lower-*.f64N/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6443.0

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites43.0%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      2. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
      3. lift-*.f6421.7

        \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    7. Applied rewrites21.7%

      \[\leadsto \left(-4 \cdot a\right) \cdot \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 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])\\ \\ \left(-4 \cdot a\right) \cdot t \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(Float64(-4.0 * 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[(N[(-4.0 * a), $MachinePrecision] * t), $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])\\
\\
\left(-4 \cdot a\right) \cdot t
\end{array}
Derivation
  1. Initial program 85.0%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. 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. 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) \]
    2. lower-neg.f64N/A

      \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
    3. *-commutativeN/A

      \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
    4. lower-*.f64N/A

      \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
    5. fp-cancel-sub-sign-invN/A

      \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
    6. metadata-evalN/A

      \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
    7. lower-fma.f64N/A

      \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
    8. *-commutativeN/A

      \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
    9. lower-*.f64N/A

      \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
    10. *-commutativeN/A

      \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    11. lower-*.f64N/A

      \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    12. lower-*.f6443.0

      \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
  4. Applied rewrites43.0%

    \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
  5. Taylor expanded in x around 0

    \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
  6. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    2. lower-*.f64N/A

      \[\leadsto \left(-4 \cdot a\right) \cdot t \]
    3. lift-*.f6421.7

      \[\leadsto \left(-4 \cdot a\right) \cdot t \]
  7. Applied rewrites21.7%

    \[\leadsto \left(-4 \cdot a\right) \cdot \color{blue}{t} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025134 
(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)))