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

Percentage Accurate: 85.4% → 91.2%
Time: 6.5s
Alternatives: 19
Speedup: 1.0×

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 19 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: 91.2% accurate, 0.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.8% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.49999999999999984e150

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

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

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

    if 3.49999999999999984e150 < 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 z around inf

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

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

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

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

Alternative 3: 89.9% accurate, 1.0× speedup?

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

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

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


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

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

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

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

    if -9.5999999999999994e-182 < x < 1.85e35

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85e35 < 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 0

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

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

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

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

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

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

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

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

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

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

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


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

    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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.0000000000000006e151 or 1.85e35 < 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 0

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

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

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

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

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

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

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

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

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

    if -7.0000000000000006e151 < x < 1.85e35

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4999999999999997e28

    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 -4.4999999999999997e28 < z < 1.7000000000000001e263

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000001e263 < 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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.1% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4999999999999997e28

    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 -4.4999999999999997e28 < z < 1.7000000000000001e263

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000001e263 < 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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.39999999999999981e28

    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.39999999999999981e28 < z < 1.7000000000000001e263

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000001e263 < 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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 72.5% accurate, 1.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4e18 < t < 7.4999999999999996e-15

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

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

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

    if 7.4999999999999996e-15 < t < 1.41999999999999999e130

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t + i \cdot x\right)\right) \]
      6. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      7. lift-*.f6458.9

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
    7. Applied rewrites58.9%

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

    if 1.41999999999999999e130 < 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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.85000000000000012e133 or 1.35000000000000001e35 < 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 -1.85000000000000012e133 < x < 1.35000000000000001e35

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 68.0% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+256}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e262 or 4.0000000000000001e256 < (*.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.4

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

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

    if -1e262 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999993e158

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right) \]
      10. lift-*.f6459.0

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right) \]
    10. Applied rewrites59.0%

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

    if 9.9999999999999993e158 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.0000000000000001e256

    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 12: 67.8% accurate, 1.2× speedup?

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

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

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


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

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

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

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

    if -1e262 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.9999999999999997e159

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right) \]
      10. lift-*.f6459.0

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right) \]
    10. Applied rewrites59.0%

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

    if 3.9999999999999997e159 < (*.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.4

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

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

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

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

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

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

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

Alternative 13: 67.7% accurate, 1.2× speedup?

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

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

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


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

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

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

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

    if -1e262 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.9999999999999997e159

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t + i \cdot x\right)\right) \]
      6. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      7. lift-*.f6458.9

        \[\leadsto \mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
    7. Applied rewrites58.9%

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

    if 3.9999999999999997e159 < (*.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.4

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

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

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

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

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

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

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

Alternative 14: 52.8% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [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}\;k \leq -8.6 \cdot 10^{+24}:\\ \;\;\;\;\left(-27 \cdot j\right) \cdot k\\ \mathbf{elif}\;k \leq 7.8 \cdot 10^{+14}:\\ \;\;\;\;c \cdot b - \left(4 \cdot a\right) \cdot t\\ \mathbf{elif}\;k \leq 4.2 \cdot 10^{+157}:\\ \;\;\;\;c \cdot b - \left(i \cdot x\right) \cdot 4\\ \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.
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 (<= k -8.6e+24)
   (* (* -27.0 j) k)
   (if (<= k 7.8e+14)
     (- (* c b) (* (* 4.0 a) t))
     (if (<= k 4.2e+157) (- (* c b) (* (* i x) 4.0)) (* (* -27.0 k) j)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (k <= -8.6e+24) {
		tmp = (-27.0 * j) * k;
	} else if (k <= 7.8e+14) {
		tmp = (c * b) - ((4.0 * a) * t);
	} else if (k <= 4.2e+157) {
		tmp = (c * b) - ((i * x) * 4.0);
	} 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.
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) :: tmp
    if (k <= (-8.6d+24)) then
        tmp = ((-27.0d0) * j) * k
    else if (k <= 7.8d+14) then
        tmp = (c * b) - ((4.0d0 * a) * t)
    else if (k <= 4.2d+157) then
        tmp = (c * b) - ((i * x) * 4.0d0)
    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;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (k <= -8.6e+24) {
		tmp = (-27.0 * j) * k;
	} else if (k <= 7.8e+14) {
		tmp = (c * b) - ((4.0 * a) * t);
	} else if (k <= 4.2e+157) {
		tmp = (c * b) - ((i * x) * 4.0);
	} 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])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if k <= -8.6e+24:
		tmp = (-27.0 * j) * k
	elif k <= 7.8e+14:
		tmp = (c * b) - ((4.0 * a) * t)
	elif k <= 4.2e+157:
		tmp = (c * b) - ((i * x) * 4.0)
	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])
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 (k <= -8.6e+24)
		tmp = Float64(Float64(-27.0 * j) * k);
	elseif (k <= 7.8e+14)
		tmp = Float64(Float64(c * b) - Float64(Float64(4.0 * a) * t));
	elseif (k <= 4.2e+157)
		tmp = Float64(Float64(c * b) - Float64(Float64(i * x) * 4.0));
	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])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if (k <= -8.6e+24)
		tmp = (-27.0 * j) * k;
	elseif (k <= 7.8e+14)
		tmp = (c * b) - ((4.0 * a) * t);
	elseif (k <= 4.2e+157)
		tmp = (c * b) - ((i * x) * 4.0);
	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.
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[k, -8.6e+24], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[k, 7.8e+14], N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.2e+157], N[(N[(c * b), $MachinePrecision] - N[(N[(i * x), $MachinePrecision] * 4.0), $MachinePrecision]), $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])\\\\
[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}\;k \leq -8.6 \cdot 10^{+24}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\

\mathbf{elif}\;k \leq 7.8 \cdot 10^{+14}:\\
\;\;\;\;c \cdot b - \left(4 \cdot a\right) \cdot t\\

\mathbf{elif}\;k \leq 4.2 \cdot 10^{+157}:\\
\;\;\;\;c \cdot b - \left(i \cdot x\right) \cdot 4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if k < -8.59999999999999975e24

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

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

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

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

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

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

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

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

    if -8.59999999999999975e24 < k < 7.8e14

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      3. lift-*.f6441.5

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
    7. Applied rewrites41.5%

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

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

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

        \[\leadsto c \cdot b - \left(4 \cdot a\right) \cdot t \]
      3. lower-*.f6441.6

        \[\leadsto c \cdot b - \left(4 \cdot a\right) \cdot t \]
    10. Applied rewrites41.6%

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

    if 7.8e14 < k < 4.2e157

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      3. lift-*.f6441.5

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
    7. Applied rewrites41.5%

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

    if 4.2e157 < 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.4

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

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

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

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

Alternative 15: 47.7% accurate, 1.4× speedup?

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+112}:\\
\;\;\;\;c \cdot b - \left(4 \cdot a\right) \cdot t\\

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


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

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

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

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

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

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

    if -4e220 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e112

    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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
      3. lift-*.f6441.5

        \[\leadsto c \cdot b - \left(i \cdot x\right) \cdot 4 \]
    7. Applied rewrites41.5%

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

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

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

        \[\leadsto c \cdot b - \left(4 \cdot a\right) \cdot t \]
      3. lower-*.f6441.6

        \[\leadsto c \cdot b - \left(4 \cdot a\right) \cdot t \]
    10. Applied rewrites41.6%

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

    if 5e112 < (*.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.4

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

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

Alternative 16: 35.9% accurate, 2.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])\\\\ [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}\;k \leq -4.2 \cdot 10^{-60}:\\ \;\;\;\;\left(-27 \cdot j\right) \cdot k\\ \mathbf{elif}\;k \leq 4.4 \cdot 10^{+14}:\\ \;\;\;\;\left(a \cdot t\right) \cdot -4\\ \mathbf{elif}\;k \leq 1.4 \cdot 10^{+152}:\\ \;\;\;\;\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.
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 (<= k -4.2e-60)
   (* (* -27.0 j) k)
   (if (<= k 4.4e+14)
     (* (* a t) -4.0)
     (if (<= k 1.4e+152) (* (* -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);
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 (k <= -4.2e-60) {
		tmp = (-27.0 * j) * k;
	} else if (k <= 4.4e+14) {
		tmp = (a * t) * -4.0;
	} else if (k <= 1.4e+152) {
		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.
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) :: tmp
    if (k <= (-4.2d-60)) then
        tmp = ((-27.0d0) * j) * k
    else if (k <= 4.4d+14) then
        tmp = (a * t) * (-4.0d0)
    else if (k <= 1.4d+152) 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;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (k <= -4.2e-60) {
		tmp = (-27.0 * j) * k;
	} else if (k <= 4.4e+14) {
		tmp = (a * t) * -4.0;
	} else if (k <= 1.4e+152) {
		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])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if k <= -4.2e-60:
		tmp = (-27.0 * j) * k
	elif k <= 4.4e+14:
		tmp = (a * t) * -4.0
	elif k <= 1.4e+152:
		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])
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 (k <= -4.2e-60)
		tmp = Float64(Float64(-27.0 * j) * k);
	elseif (k <= 4.4e+14)
		tmp = Float64(Float64(a * t) * -4.0);
	elseif (k <= 1.4e+152)
		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])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if (k <= -4.2e-60)
		tmp = (-27.0 * j) * k;
	elseif (k <= 4.4e+14)
		tmp = (a * t) * -4.0;
	elseif (k <= 1.4e+152)
		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.
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[k, -4.2e-60], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[k, 4.4e+14], N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[k, 1.4e+152], 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])\\\\
[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}\;k \leq -4.2 \cdot 10^{-60}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\

\mathbf{elif}\;k \leq 4.4 \cdot 10^{+14}:\\
\;\;\;\;\left(a \cdot t\right) \cdot -4\\

\mathbf{elif}\;k \leq 1.4 \cdot 10^{+152}:\\
\;\;\;\;\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 4 regimes
  2. if k < -4.19999999999999982e-60

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

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

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

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

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

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

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

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

    if -4.19999999999999982e-60 < k < 4.4e14

    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 -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      3. lift-*.f6421.4

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

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

    if 4.4e14 < k < 1.4000000000000001e152

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

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

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

    if 1.4000000000000001e152 < 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.4

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

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

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

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

Alternative 17: 35.9% accurate, 1.7× speedup?

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

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

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


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

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

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

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

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

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

    if -9.9999999999999998e23 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e53

    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 -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      3. lift-*.f6421.4

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

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

    if 2e53 < (*.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.4

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.9999999999999998e23 or 2e53 < (*.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.4

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

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

    if -9.9999999999999998e23 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e53

    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 -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      2. lower-*.f64N/A

        \[\leadsto \left(a \cdot t\right) \cdot -4 \]
      3. lift-*.f6421.4

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

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

Alternative 19: 21.4% 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])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \left(a \cdot t\right) \cdot -4 \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 (* (* a t) -4.0))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (a * t) * -4.0;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 = (a * t) * (-4.0d0)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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 (a * t) * -4.0;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[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 (a * t) * -4.0
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
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(a * t) * -4.0)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
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 = (a * t) * -4.0;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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[(a * t), $MachinePrecision] * -4.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\left(a \cdot t\right) \cdot -4
\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 t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(a \cdot t\right) \cdot -4 \]
    2. lower-*.f64N/A

      \[\leadsto \left(a \cdot t\right) \cdot -4 \]
    3. lift-*.f6421.4

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

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

Reproduce

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