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

Percentage Accurate: 85.6% → 90.4%
Time: 9.0s
Alternatives: 22
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 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.6% 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: 90.4% accurate, 1.0× speedup?

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.99999999999999991e-44

    1. Initial program 83.1%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites88.9%

      \[\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)} \]
    6. Step-by-step derivation
      1. 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) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\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) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right) \]
      3. lift-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      11. lift-*.f6491.7

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
    7. Applied rewrites91.7%

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      2. lift-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
      9. lift-*.f6491.7

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
    9. Applied rewrites91.7%

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

    if 1.99999999999999991e-44 < t

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.3% accurate, 0.5× speedup?

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

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


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

    1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites93.7%

      \[\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)} \]
    6. Step-by-step derivation
      1. 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) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\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) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right) \]
      3. lift-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      11. lift-*.f6493.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
    7. Applied rewrites93.2%

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, 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) \]
      2. lift-fma.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
      9. lift-*.f6493.2

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t \cdot z, 18 \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) \]
    9. Applied rewrites93.2%

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

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

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.9% accurate, 0.5× speedup?

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

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


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

    1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites93.7%

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

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

    1. Initial program 0.0%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.2% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 79.8%

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

      \[\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)} \]
    6. Taylor expanded in j around 0

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

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

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

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

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

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

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

    if -5.2999999999999997e59 < t < -1.74999999999999999e-76

    1. Initial program 90.5%

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

        \[\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) \]
    5. Applied rewrites90.7%

      \[\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.74999999999999999e-76 < t < 5.2e6

    1. Initial program 84.1%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites93.8%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2e6 < t

    1. Initial program 87.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \color{blue}{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) \]
      5. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \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) \]
      15. lower-*.f6486.2

        \[\leadsto \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) \]
    5. Applied rewrites86.2%

      \[\leadsto \color{blue}{\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)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 84.6% accurate, 1.1× speedup?

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

\mathbf{elif}\;t \leq -1.75 \cdot 10^{-76}:\\
\;\;\;\;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{elif}\;t \leq 5200000:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.2999999999999997e59 or 5.2e6 < t

    1. Initial program 84.9%

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

      \[\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)} \]
    6. Taylor expanded in j around 0

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

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

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

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

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

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

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

    if -5.2999999999999997e59 < t < -1.74999999999999999e-76

    1. Initial program 90.5%

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

        \[\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) \]
    5. Applied rewrites90.7%

      \[\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.74999999999999999e-76 < t < 5.2e6

    1. Initial program 84.1%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites93.8%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 36.2% accurate, 1.2× speedup?

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

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

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

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

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

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


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

    1. Initial program 82.3%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6449.3

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

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

    if -2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.00000000000000008e36

    1. Initial program 90.0%

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
      2. lower-*.f6438.1

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites38.1%

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

    if 2.00000000000000008e36 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 87.3%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. 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-*.f6439.3

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

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

    if 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 66.8%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6461.0

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

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

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

        \[\leadsto -27 \cdot \color{blue}{\left(k \cdot 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. lift-*.f6461.0

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    7. Applied rewrites61.0%

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

Alternative 7: 83.2% accurate, 1.2× speedup?

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-90}:\\
\;\;\;\;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(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\right)\right)\\


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

    1. Initial program 87.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites87.4%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

    if -6.50000000000000035e-170 < z < 1.99999999999999999e-90

    1. Initial program 84.0%

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

        \[\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) \]
    5. Applied rewrites92.7%

      \[\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.99999999999999999e-90 < z

    1. Initial program 83.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites84.7%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 82.7% accurate, 1.2× speedup?

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-90}:\\
\;\;\;\;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(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot y\right) \cdot z, 18, -4 \cdot i\right), x, c \cdot b\right)\right)\\


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

    1. Initial program 86.2%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites86.3%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.36e-33 < z < 1.99999999999999999e-90

    1. Initial program 86.2%

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

        \[\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) \]
    5. Applied rewrites88.3%

      \[\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.99999999999999999e-90 < z

    1. Initial program 83.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites84.7%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 80.1% accurate, 1.3× speedup?

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

\mathbf{elif}\;t \leq 1.45 \cdot 10^{+45}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_1 - \left(j \cdot 27\right) \cdot k\\


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

    1. Initial program 72.6%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. *-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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    if -4.1e154 < t < 1.4499999999999999e45

    1. Initial program 86.3%

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

        \[\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) \]
    5. Applied rewrites85.1%

      \[\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.4499999999999999e45 < t

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.8% accurate, 1.3× speedup?

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

\mathbf{elif}\;t \leq 3.05 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 5200000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.20000000000000039e78 or 5.2e6 < t

    1. Initial program 85.6%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. *-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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    if -7.20000000000000039e78 < t < 3.05000000000000014e-220 or 1.99999999999999994e-28 < t < 5.2e6

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.05000000000000014e-220 < t < 1.99999999999999994e-28

    1. Initial program 79.7%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites94.9%

      \[\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)} \]
    6. 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)} \]
    7. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 64.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 72000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, -4 \cdot i\right), x, c \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6499999999999999e160 or 72000 < t

    1. Initial program 85.2%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. *-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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    if -1.6499999999999999e160 < t < -1.65e-258

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e-258 < t < 72000

    1. Initial program 82.3%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Add Preprocessing
    3. Taylor expanded in 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)} \]
    4. 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)} \]
    5. Applied rewrites95.9%

      \[\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)} \]
    6. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 54.4% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;c \cdot b - t\_1\\


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

    1. Initial program 82.3%

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

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

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
      2. lower-*.f6461.8

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

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

    if -2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) \]
    8. Applied rewrites57.4%

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

    if 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 66.8%

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

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

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

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

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

Alternative 13: 53.4% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;c \cdot b - t\_1\\


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

    1. Initial program 79.9%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6471.1

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

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

    if -3.9999999999999996e212 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) \]
      8. lift-*.f6453.5

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) \]
    8. Applied rewrites53.5%

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

    if 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 66.8%

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

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

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

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

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

Alternative 14: 53.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 79.9%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6471.1

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

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

    if -3.9999999999999996e212 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) \]
      8. lift-*.f6453.5

        \[\leadsto \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) \]
    8. Applied rewrites53.5%

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

    if 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 78.7% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1e154 or 1.4499999999999999e45 < t

    1. Initial program 83.2%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    4. Step-by-step derivation
      1. *-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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

    if -4.1e154 < t < 1.4499999999999999e45

    1. Initial program 86.3%

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

        \[\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) \]
    5. Applied rewrites85.1%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.1%

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

Alternative 16: 58.7% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.35e95

    1. Initial program 68.0%

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

      \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
    4. Step-by-step derivation
      1. *-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-*.f6461.3

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

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

    if -1.35e95 < x < -2.05000000000000002e-249

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05000000000000002e-249 < x < 3e-37

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e-37 < x

    1. Initial program 79.7%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 58.7% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.35e95 or 3e-37 < x

    1. Initial program 75.1%

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

      \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
    4. Step-by-step derivation
      1. *-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-*.f6464.8

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

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

    if -1.35e95 < x < -2.05000000000000002e-249

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05000000000000002e-249 < x < 3e-37

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 36.5% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+43} \lor \neg \left(t\_1 \leq 10^{+145}\right):\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (or (<= t_1 -2e+43) (not (<= t_1 1e+145))) (* -27.0 (* k j)) (* c b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if ((t_1 <= -2e+43) || !(t_1 <= 1e+145)) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{else}:\\
\;\;\;\;c \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2.00000000000000003e43 or 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 77.2%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. 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-*.f6453.1

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

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

    if -2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 89.7%

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
      2. lower-*.f6435.7

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites35.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+43} \lor \neg \left(\left(j \cdot 27\right) \cdot k \leq 10^{+145}\right):\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 36.5% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+43}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+145}:\\ \;\;\;\;c \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot j\right) \cdot k\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -2e+43)
     (* -27.0 (* k j))
     (if (<= t_1 1e+145) (* c b) (* (* -27.0 j) k)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = (j * 27.0) * k;
	double tmp;
	if (t_1 <= -2e+43) {
		tmp = -27.0 * (k * j);
	} else if (t_1 <= 1e+145) {
		tmp = c * b;
	} else {
		tmp = (-27.0 * j) * k;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

\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) < -2.00000000000000003e43

    1. Initial program 82.3%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6449.3

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

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

    if -2.00000000000000003e43 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999999e144

    1. Initial program 89.7%

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
      2. lower-*.f6435.7

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites35.7%

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

    if 9.9999999999999999e144 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 66.8%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. 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-*.f6461.0

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

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

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

        \[\leadsto -27 \cdot \color{blue}{\left(k \cdot 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. lift-*.f6461.0

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    7. Applied rewrites61.0%

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

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

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

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


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

    1. Initial program 47.4%

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

      \[\leadsto \color{blue}{x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
    4. Step-by-step derivation
      1. *-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-*.f6484.7

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

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

    if -2.05e214 < x < 3.20000000000000005e101

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000005e101 < x

    1. Initial program 71.5%

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

      \[\leadsto \color{blue}{\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)} \]
    4. 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)} \]
    5. Applied rewrites92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 47.2% accurate, 2.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.60000000000000026e228 or 8.0000000000000004e152 < a

    1. Initial program 84.4%

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

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

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

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

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

    if -4.60000000000000026e228 < a < 8.0000000000000004e152

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{+228} \lor \neg \left(a \leq 8 \cdot 10^{+152}\right):\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-27, k \cdot j, c \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 24.1% accurate, 11.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ c \cdot b \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* c b))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
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 = c * b
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
[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 c * b
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(c * b)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = c * b;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(c * b), $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])\\
\\
c \cdot b
\end{array}
Derivation
  1. Initial program 85.3%

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

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

      \[\leadsto c \cdot \color{blue}{b} \]
    2. lower-*.f6426.6

      \[\leadsto c \cdot \color{blue}{b} \]
  5. Applied rewrites26.6%

    \[\leadsto \color{blue}{c \cdot b} \]
  6. Add Preprocessing

Developer Target 1: 89.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
        (t_2
         (-
          (- (* (* 18.0 t) (* (* x y) z)) t_1)
          (- (* (* k j) 27.0) (* c b)))))
   (if (< t -1.6210815397541398e-69)
     t_2
     (if (< t 165.68027943805222)
       (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
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 = ((a * t) + (i * x)) * 4.0d0
    t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
    if (t < (-1.6210815397541398d-69)) then
        tmp = t_2
    else if (t < 165.68027943805222d0) then
        tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = ((a * t) + (i * x)) * 4.0
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
	tmp = 0
	if t < -1.6210815397541398e-69:
		tmp = t_2
	elif t < 165.68027943805222:
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
	tmp = 0.0
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = ((a * t) + (i * x)) * 4.0;
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	tmp = 0.0;
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2025037 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))

  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))