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

Percentage Accurate: 85.4% → 92.8%
Time: 6.5s
Alternatives: 17
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 17 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.4% 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: 92.8% 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 \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\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
 (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 INFINITY) t_1 (* (fma (* (* t z) 18.0) y (* i -4.0)) 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 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 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * 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)
	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 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * 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_] := 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, Infinity], t$95$1, N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $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}
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 \infty:\\
\;\;\;\;t\_1\\

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


\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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.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} t_1 := \left(x \cdot 4\right) \cdot i\\ t_2 := \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) - t\_1\right) - t\_2 \leq \infty:\\ \;\;\;\;\left(\mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(x \cdot y\right) \cdot z, 18, -4 \cdot a\right) \cdot t\right) - t\_1\right) - t\_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\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
 (let* ((t_1 (* (* x 4.0) i)) (t_2 (* (* j 27.0) k)))
   (if (<=
        (-
         (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) t_1)
         t_2)
        INFINITY)
     (- (- (fma c b (* (fma (* (* x y) z) 18.0 (* -4.0 a)) t)) t_1) t_2)
     (* (fma (* (* t z) 18.0) y (* i -4.0)) 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 t_1 = (x * 4.0) * i;
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (((((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - t_1) - t_2) <= ((double) INFINITY)) {
		tmp = (fma(c, b, (fma(((x * y) * z), 18.0, (-4.0 * a)) * t)) - t_1) - t_2;
	} else {
		tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * 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)
	t_1 = Float64(Float64(x * 4.0) * i)
	t_2 = 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)) - t_1) - t_2) <= Inf)
		tmp = Float64(Float64(fma(c, b, Float64(fma(Float64(Float64(x * y) * z), 18.0, Float64(-4.0 * a)) * t)) - t_1) - t_2);
	else
		tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * 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_] := Block[{t$95$1 = N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = 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] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], Infinity], N[(N[(N[(c * b + N[(N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $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}
t_1 := \left(x \cdot 4\right) \cdot i\\
t_2 := \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) - t\_1\right) - t\_2 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(c, b, \mathsf{fma}\left(\left(x \cdot y\right) \cdot z, 18, -4 \cdot a\right) \cdot t\right) - t\_1\right) - t\_2\\

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


\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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.6% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.19999999999999987e-39 or 2.5e14 < a

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999987e-39 < a < 2.5e14

    1. Initial program 85.4%

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

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

        \[\leadsto \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(i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.6% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.75e-161 or 2.8e-113 < t

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.75e-161 < t < 2.8e-113

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.6% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.9999999999999999e-177 or 7.99999999999999969e-80 < t

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-177 < t < 7.99999999999999969e-80

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5e65 or 4.3999999999999996e152 < x

    1. Initial program 85.4%

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

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

        \[\leadsto \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(i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\left(-18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - -4 \cdot i\right) \cdot x\right) - \left(j \cdot 27\right) \cdot k \]
      7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

    if -4.5e65 < x < 4.3999999999999996e152

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    5. Applied rewrites60.5%

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

Alternative 7: 71.5% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.7999999999999994e-36 or 5.1999999999999998e38 < a

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

    if -9.7999999999999994e-36 < a < 5.1999999999999998e38

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.8% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3000000000000001e36 < x < 1.75e153

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot t\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)} \]
    5. Applied rewrites60.5%

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

    if 1.75e153 < x

    1. Initial program 85.4%

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.2000000000000006e-110 or 5.4000000000000003e-85 < t

    1. Initial program 85.4%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]
    5. Taylor expanded in t around inf

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

        \[\leadsto \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right) \cdot \color{blue}{t} \]
      2. 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 \]
      3. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000006e-110 < t < 5.4000000000000003e-85

    1. Initial program 85.4%

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

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

        \[\leadsto \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(i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.1% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.6500000000000002e-59 or 1.8999999999999998e103 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6500000000000002e-59 < x < 1.8999999999999998e103

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 57.0% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.59999999999999998e-59 or 1.20000000000000006e126 < x

    1. Initial program 85.4%

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

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

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

    if -2.59999999999999998e-59 < x < 1.20000000000000006e126

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 48.5% accurate, 1.6× speedup?

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-247}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.70000000000000023e-29 or 8.1e108 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
      4. lift-*.f6420.1

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
    10. Applied rewrites20.1%

      \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
    11. Taylor expanded in y around inf

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

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

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

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

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

        \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
      6. lower-*.f6427.6

        \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
    13. Applied rewrites27.6%

      \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]

    if -2.70000000000000023e-29 < z < -9.49999999999999939e-247

    1. Initial program 85.4%

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

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

        \[\leadsto \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(i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      2. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.49999999999999939e-247 < z < 2.20000000000000007e-154

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(\left(i \cdot x\right) \cdot 4 + 27 \cdot \left(j \cdot k\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.20000000000000007e-154 < z < 8.1e108

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.19999999999999996e36 or 7.50000000000000065e153 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
      4. lift-*.f6420.1

        \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
    10. Applied rewrites20.1%

      \[\leadsto \left(\frac{i \cdot x}{z} \cdot -4\right) \cdot z \]
    11. Taylor expanded in y around inf

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

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

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

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

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

        \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
      6. lower-*.f6427.6

        \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
    13. Applied rewrites27.6%

      \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]

    if -1.19999999999999996e36 < x < 7.50000000000000065e153

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.35000000000000012e207 or 9.9999999999999991e130 < i

    1. Initial program 85.4%

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

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

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

    if -1.35000000000000012e207 < i < 9.9999999999999991e130

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 36.3% 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(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+97}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+65}:\\ \;\;\;\;\left(-4 \cdot i\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot k\right) \cdot j\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -2e+97)
     (* -27.0 (* k j))
     (if (<= t_1 2e+65) (* (* -4.0 i) x) (* (* -27.0 k) j)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -2e+97) {
		tmp = -27.0 * (k * j);
	} else if (t_1 <= 2e+65) {
		tmp = (-4.0 * i) * x;
	} else {
		tmp = (-27.0 * k) * j;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


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

    1. Initial program 85.4%

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

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

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

    if -2.0000000000000001e97 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e65

    1. Initial program 85.4%

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

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

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

    if 2e65 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 85.4%

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

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

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

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

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

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

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

        \[\leadsto \left(-27 \cdot k\right) \cdot j \]
    6. Applied rewrites24.2%

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

Alternative 16: 24.2% 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(-27 \cdot k\right) \cdot j \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 (* (* -27.0 k) j))
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 (-27.0 * k) * j;
}
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 = ((-27.0d0) * k) * j
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 (-27.0 * k) * j;
}
[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 (-27.0 * k) * j
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(-27.0 * k) * j)
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 = (-27.0 * k) * j;
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[(-27.0 * k), $MachinePrecision] * j), $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(-27 \cdot k\right) \cdot j
\end{array}
Derivation
  1. Initial program 85.4%

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

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

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

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

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

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

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

      \[\leadsto \left(-27 \cdot k\right) \cdot j \]
  6. Applied rewrites24.2%

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

Alternative 17: 24.2% 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])\\ \\ -27 \cdot \left(k \cdot j\right) \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* -27.0 (* k j)))
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 -27.0 * (k * j);
}
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 = (-27.0d0) * (k * j)
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 -27.0 * (k * j);
}
[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 -27.0 * (k * j)
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(-27.0 * Float64(k * j))
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 = -27.0 * (k * j);
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[(-27.0 * N[(k * j), $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])\\
\\
-27 \cdot \left(k \cdot j\right)
\end{array}
Derivation
  1. Initial program 85.4%

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

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

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

Reproduce

?
herbie shell --seed 2025139 
(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)))