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

Percentage Accurate: 85.6% → 92.4%
Time: 7.1s
Alternatives: 20
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}

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 20 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: 92.4% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+296}:\\
\;\;\;\;t\_2 - j \cdot \left(k \cdot 27\right)\\

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

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 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)) < -1.0000000000000001e178

    1. Initial program 91.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 rewrites98.6%

      \[\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 -1.0000000000000001e178 < (-.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.99999999999999996e296

    1. Initial program 99.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

    if 1.99999999999999996e296 < (-.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 86.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 rewrites90.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. 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.3

        \[\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.3%

      \[\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) \]

    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 rewrites29.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 rewrites70.6%

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

    \[\leadsto \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 -1 \cdot 10^{+178}:\\ \;\;\;\;\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{elif}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 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 2 \cdot 10^{+296}:\\ \;\;\;\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\ \mathbf{elif}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 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(\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)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 90.4% accurate, 0.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)) < -1.0000000000000001e178

    1. Initial program 91.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 rewrites98.6%

      \[\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 -1.0000000000000001e178 < (-.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.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. Step-by-step derivation
      1. 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 \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\left(\left(\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(\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 \]
      5. 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 \]
      6. 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 \]
      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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 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 rewrites29.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 rewrites70.6%

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

    \[\leadsto \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 -1 \cdot 10^{+178}:\\ \;\;\;\;\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{elif}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 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:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(\left(18 \cdot x\right) \cdot y, z \cdot t, \left(\left(-4\right) \cdot a\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.5% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)) < -5.00000000000000009e183

    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}{\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 rewrites98.6%

      \[\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 -5.00000000000000009e183 < (-.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.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 rewrites91.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. 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-*.f6494.0

        \[\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 rewrites94.0%

      \[\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) \]

    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 rewrites29.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 rewrites70.6%

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

    \[\leadsto \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 -5 \cdot 10^{+183}:\\ \;\;\;\;\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{elif}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 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(\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)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 55.9% accurate, 0.5× speedup?

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

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


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

    1. Initial program 63.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 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-*.f6465.3

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

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

    if -4.9999999999999996e260 < (-.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)) < 5.0000000000000003e299

    1. Initial program 99.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-*.f6459.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 80.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-*.f6473.5

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

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

    if -4.9999999999999996e260 < (-.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)) < 5.0000000000000003e299

    1. Initial program 99.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-*.f6459.4

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 51.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 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-*.f6458.4

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

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

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

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

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


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

    1. Initial program 80.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-*.f6473.5

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

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

    if -4.9999999999999996e260 < (-.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)) < 5.0000000000000003e299

    1. Initial program 99.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-*.f6459.4

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 51.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 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-*.f6458.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 90.5% 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(-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)\\ \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 (* -4.0 a) t (fma (fma (* (* z y) t) 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((-4.0 * a), t, fma(fma(((z * y) * t), 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(-4.0 * a), t, fma(fma(Float64(Float64(z * y) * t), 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[(-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]]
\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(-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)\\


\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 93.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.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)} \]

    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 rewrites29.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 rewrites70.6%

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

    \[\leadsto \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(-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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 35.0% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-273}:\\
\;\;\;\;c \cdot b\\

\mathbf{elif}\;t\_2 \leq 5000000000:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 76.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 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-*.f6455.5

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

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

    if -2e110 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e-180 or 4e-273 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5e9

    1. Initial program 82.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 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-*.f6432.7

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

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

    if -1e-180 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4e-273

    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 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-*.f6441.6

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites41.6%

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

    if 5e9 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e99

    1. Initial program 82.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 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-*.f6441.3

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
    5. Applied rewrites41.3%

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

    if 1.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 76.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 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-*.f6468.0

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    5. Applied rewrites68.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. associate-*r*N/A

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

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

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

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

Alternative 9: 84.0% accurate, 0.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.99999999999999966e89 or 5.0000000000000002e107 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 77.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 rewrites81.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. 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-*.f6481.6

        \[\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 rewrites81.6%

      \[\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. Taylor expanded in t around 0

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

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

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

    if -9.99999999999999966e89 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000002e107

    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 rewrites87.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right), x, c \cdot b\right) - \mathsf{fma}\left(k \cdot j, 27, \left(a \cdot t\right) \cdot 4\right)} \]
    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 rewrites88.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{+90} \lor \neg \left(\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{+107}\right):\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, -4 \cdot i\right), x, c \cdot b\right) - \left(k \cdot j\right) \cdot 27\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 83.7% accurate, 0.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -9.99999999999999966e89 or 5.0000000000000004e96 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 76.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 rewrites81.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. 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-*.f6481.0

        \[\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 rewrites81.0%

      \[\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. 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)} \]
    9. 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. *-commutativeN/A

        \[\leadsto \left(j \cdot k\right) \cdot -27 + \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. lower-fma.f64N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(k \cdot j, \color{blue}{-27}, \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 -9.99999999999999966e89 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000004e96

    1. Initial program 83.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 rewrites87.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 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 rewrites88.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{+90} \lor \neg \left(\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{+96}\right):\\ \;\;\;\;\mathsf{fma}\left(k \cdot j, -27, \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{else}:\\ \;\;\;\;\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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 79.4% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(i \cdot x\right) \cdot -4 - t\_3\\


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

    1. Initial program 76.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 rewrites78.6%

      \[\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-*.f6478.8

        \[\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 rewrites78.8%

      \[\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. Taylor expanded in t around 0

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, -4 \cdot i\right), x, c \cdot b\right) - 27 \cdot \color{blue}{\left(j \cdot k\right)} \]
    9. Step-by-step derivation
      1. *-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) - \left(j \cdot k\right) \cdot 27 \]
      2. 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) - \left(j \cdot k\right) \cdot 27 \]
      3. *-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) - \left(k \cdot j\right) \cdot 27 \]
      4. lift-*.f6481.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) - \left(k \cdot j\right) \cdot 27 \]
    10. Applied rewrites81.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) - \left(k \cdot j\right) \cdot \color{blue}{27} \]
    11. Taylor expanded in y around inf

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

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

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

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

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

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

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

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

    if -4.99999999999999972e118 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e99

    1. Initial program 83.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 rewrites87.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 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 rewrites88.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 1.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 76.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 rewrites82.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. 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-*.f6480.5

        \[\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 rewrites80.5%

      \[\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. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \left(i \cdot x\right) \cdot -4 - \left(k \cdot \color{blue}{j}\right) \cdot 27 \]
      3. lift-*.f6478.5

        \[\leadsto \left(i \cdot x\right) \cdot -4 - \left(k \cdot j\right) \cdot 27 \]
    13. Applied rewrites78.5%

      \[\leadsto \left(i \cdot x\right) \cdot -4 - \color{blue}{\left(k \cdot j\right)} \cdot 27 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18, x, c \cdot b\right) - \left(k \cdot j\right) \cdot 27\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+99}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;\left(i \cdot x\right) \cdot -4 - \left(k \cdot j\right) \cdot 27\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 36.3% 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^{+173}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-52}:\\ \;\;\;\;c \cdot b\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+99}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-27 \cdot k\right) \cdot j\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= t_1 -2e+173)
     (* -27.0 (* k j))
     (if (<= t_1 4e-52)
       (* c b)
       (if (<= t_1 2e+99) (* -4.0 (* a t)) (* (* -27.0 k) j))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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+173) {
		tmp = -27.0 * (k * j);
	} else if (t_1 <= 4e-52) {
		tmp = c * b;
	} else if (t_1 <= 2e+99) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * k) * j;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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+173)) then
        tmp = (-27.0d0) * (k * j)
    else if (t_1 <= 4d-52) then
        tmp = c * b
    else if (t_1 <= 2d+99) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = ((-27.0d0) * k) * j
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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+173) {
		tmp = -27.0 * (k * j);
	} else if (t_1 <= 4e-52) {
		tmp = c * b;
	} else if (t_1 <= 2e+99) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = (-27.0 * k) * j;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * 27.0) * k
	tmp = 0
	if t_1 <= -2e+173:
		tmp = -27.0 * (k * j)
	elif t_1 <= 4e-52:
		tmp = c * b
	elif t_1 <= 2e+99:
		tmp = -4.0 * (a * t)
	else:
		tmp = (-27.0 * k) * j
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
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+173)
		tmp = Float64(-27.0 * Float64(k * j));
	elseif (t_1 <= 4e-52)
		tmp = Float64(c * b);
	elseif (t_1 <= 2e+99)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = Float64(Float64(-27.0 * k) * j);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_1 <= -2e+173)
		tmp = -27.0 * (k * j);
	elseif (t_1 <= 4e-52)
		tmp = c * b;
	elseif (t_1 <= 2e+99)
		tmp = -4.0 * (a * t);
	else
		tmp = (-27.0 * k) * j;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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+173], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-52], N[(c * b), $MachinePrecision], If[LessEqual[t$95$1, 2e+99], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-52}:\\
\;\;\;\;c \cdot b\\

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

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


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

    1. Initial program 68.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-*.f6468.5

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

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

    if -2e173 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4e-52

    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 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-*.f6429.8

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites29.8%

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

    if 4e-52 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e99

    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 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-*.f6434.6

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
    5. Applied rewrites34.6%

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

    if 1.9999999999999999e99 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 76.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 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-*.f6468.0

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    5. Applied rewrites68.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. associate-*r*N/A

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

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-52}:\\
\;\;\;\;c \cdot b\\

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

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


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

    1. Initial program 73.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-*.f6468.2

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

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

    if -2e173 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4e-52

    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 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-*.f6429.8

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites29.8%

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

    if 4e-52 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.9999999999999999e99

    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 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-*.f6434.6

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
    5. Applied rewrites34.6%

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

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

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

\mathbf{elif}\;b \cdot c \leq 10^{-7}:\\
\;\;\;\;\left(i \cdot x\right) \cdot -4 - \left(k \cdot j\right) \cdot 27\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -4.9999999999999997e38

    1. Initial program 77.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} - \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-*.f6465.9

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

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

    if -4.9999999999999997e38 < (*.f64 b c) < -4

    1. Initial program 89.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-*.f6470.9

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right) \cdot t \]
      6. lift-*.f6470.9

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right) \cdot t \]
    8. Applied rewrites70.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t \]
      9. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(y \cdot x\right) \cdot 18\right) \cdot z\right) \cdot t \]
      16. lift-*.f6479.9

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

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

    if -4 < (*.f64 b c) < 9.9999999999999995e-8

    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 rewrites88.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-*.f6486.5

        \[\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 rewrites86.5%

      \[\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. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \left(i \cdot x\right) \cdot -4 - \left(k \cdot \color{blue}{j}\right) \cdot 27 \]
      3. lift-*.f6453.2

        \[\leadsto \left(i \cdot x\right) \cdot -4 - \left(k \cdot j\right) \cdot 27 \]
    13. Applied rewrites53.2%

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

    if 9.9999999999999995e-8 < (*.f64 b c)

    1. Initial program 74.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) \]
      8. lift-*.f6467.1

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

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

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

\mathbf{elif}\;t \leq -2.25 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18, x, c \cdot b\right) - t\_1\\

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

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


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

    1. Initial program 80.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-*.f6476.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15e191 < t < -2.25000000000000005e-69

    1. Initial program 74.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}{\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 rewrites83.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. 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-*.f6483.0

        \[\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 rewrites83.0%

      \[\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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000005e-69 < t < 2.9000000000000001e90

    1. Initial program 83.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000001e90 < t

    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 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-*.f6472.1

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

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

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

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

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


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

    1. Initial program 76.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 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-*.f6466.6

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

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

    if -2e110 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999997e111

    1. Initial program 83.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) \]
      8. lift-*.f6451.2

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

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

    if 4.9999999999999997e111 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 74.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-*.f6470.9

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

      \[\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. associate-*r*N/A

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

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

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

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

Alternative 17: 51.4% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 68.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-*.f6468.5

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

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

    if -2e173 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999997e111

    1. Initial program 84.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i \cdot x, -4, c \cdot b\right) \]
      8. lift-*.f6451.2

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

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

    if 4.9999999999999997e111 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 74.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-*.f6470.9

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

      \[\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. associate-*r*N/A

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

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

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

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

Alternative 18: 36.9% 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^{+173} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+85}\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+173) (not (<= t_1 5e+85))) (* -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+173) || !(t_1 <= 5e+85)) {
		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+173)) .or. (.not. (t_1 <= 5d+85))) 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+173) || !(t_1 <= 5e+85)) {
		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+173) or not (t_1 <= 5e+85):
		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+173) || !(t_1 <= 5e+85))
		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+173) || ~((t_1 <= 5e+85)))
		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+173], N[Not[LessEqual[t$95$1, 5e+85]], $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^{+173} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+85}\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) < -2e173 or 5.0000000000000001e85 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 72.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 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-*.f6464.9

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

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

    if -2e173 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.0000000000000001e85

    1. Initial program 85.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 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-*.f6428.6

        \[\leadsto c \cdot \color{blue}{b} \]
    5. Applied rewrites28.6%

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

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

Alternative 19: 71.0% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 77.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 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-*.f6469.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.00000000000000022e37 < t < 2.9000000000000001e90

    1. Initial program 82.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000001e90 < t

    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 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-*.f6472.1

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

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

Alternative 20: 24.7% 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 81.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 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-*.f6421.9

      \[\leadsto c \cdot \color{blue}{b} \]
  5. Applied rewrites21.9%

    \[\leadsto \color{blue}{c \cdot b} \]
  6. Add Preprocessing

Developer Target 1: 89.3% 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 2025057 
(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)))