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

Percentage Accurate: 85.0% → 91.6%
Time: 12.2s
Alternatives: 21
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 85.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 91.6% accurate, 0.5× speedup?

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

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


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

    1. Initial program 95.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. 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-*.f6495.3

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

      \[\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 +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. Taylor expanded in x around -inf

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

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

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

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

        \[\leadsto -\left(-18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - -4 \cdot i\right) \cdot x \]
      5. 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 \]
      6. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.5× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if +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. Taylor expanded in x around -inf

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

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

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

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

        \[\leadsto -\left(-18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - -4 \cdot i\right) \cdot x \]
      5. 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 \]
      6. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 84.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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999996e-130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.9999999999999998e60

    1. Initial program 87.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6486.3

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

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

    if 3.9999999999999998e60 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.0000000000000001e280

    1. Initial program 85.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. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e280 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 74.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. Taylor expanded in a around inf

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+182}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, t, \mathsf{fma}\left(\left(z \cdot x\right) \cdot t, 18, \frac{c \cdot b}{y}\right) \cdot y\right) - t\_2\\

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


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

    1. Initial program 84.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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999996e-130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.9999999999999998e60

    1. Initial program 87.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6486.3

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

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

    if 3.9999999999999998e60 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999973e182

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999973e182 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 78.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. 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-*.f6478.8

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

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

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

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

        \[\leadsto \left(\left(a \cdot t\right) \cdot \color{blue}{-4} - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right) \]
      3. lower-*.f6474.9

        \[\leadsto \left(\left(a \cdot t\right) \cdot -4 - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right) \]
    6. Applied rewrites74.9%

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

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

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

\mathbf{elif}\;t\_2 \leq 10^{+242}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999996e-130 or 3.9999999999999998e60 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000005e242

    1. Initial program 84.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. Taylor expanded in i around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999996e-130 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 3.9999999999999998e60

    1. Initial program 87.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6486.3

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

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

    if 1.00000000000000005e242 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 84.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. Taylor expanded in a around inf

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

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

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

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

Alternative 6: 78.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.89999999999999991e-98 or 1.85e18 < t

    1. Initial program 84.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.89999999999999991e-98 < t < 1.85e18

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.0999999999999998e-29 or 1.85e18 < t

    1. Initial program 84.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0999999999999998e-29 < t < 1.85e18

    1. Initial program 85.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

Alternative 8: 72.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;t \leq 2.3 \cdot 10^{+67}:\\
\;\;\;\;\left(\left(a \cdot t\right) \cdot -4 - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.99999999999999966e-18 or 2.2999999999999999e67 < t

    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. 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)} \]
    3. 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-*.f6466.8

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

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

    if -5.99999999999999966e-18 < t < 2.9e-73

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

    if 2.9e-73 < t < 2.2999999999999999e67

    1. Initial program 89.5%

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

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

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

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

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

        \[\leadsto \left(\left(a \cdot t\right) \cdot \color{blue}{-4} - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right) \]
      3. lower-*.f6459.1

        \[\leadsto \left(\left(a \cdot t\right) \cdot -4 - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right) \]
    6. Applied rewrites59.1%

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.99999999999999966e-18 or 2.2999999999999999e67 < t

    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. 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)} \]
    3. 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-*.f6466.8

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

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

    if -5.99999999999999966e-18 < t < 2.9e-73

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

    if 2.9e-73 < t < 2.2999999999999999e67

    1. Initial program 89.5%

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot \color{blue}{t}\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    4. Applied rewrites59.3%

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

Alternative 10: 72.0% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.99999999999999966e-18 or 1.7999999999999999e67 < t

    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. 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)} \]
    3. 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-*.f6466.8

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

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

    if -5.99999999999999966e-18 < t < 1.7999999999999999e67

    1. Initial program 86.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

Alternative 11: 72.0% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.99999999999999966e-18 or 1.7999999999999999e67 < t

    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. 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)} \]
    3. 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-*.f6466.8

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

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

    if -5.99999999999999966e-18 < t < 1.7999999999999999e67

    1. Initial program 86.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. 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-*.f6486.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 68.5% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.9999999999999998e249 or 1.99999999999999995e102 < (*.f64 (*.f64 j #s(literal 27 binary64)) k)

    1. Initial program 79.0%

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

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

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

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

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

    if -1.9999999999999998e249 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.99999999999999995e102

    1. Initial program 87.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - \left(j \cdot 27\right) \cdot k\\

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


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      8. lower-*.f6443.9

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot 18\right) \]
      13. lower-*.f6444.1

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot \color{blue}{18}\right) \]
    6. Applied rewrites44.1%

      \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \color{blue}{\left(t \cdot 18\right)} \]

    if -6.6000000000000006e88 < t < 3.99999999999999983e-268

    1. Initial program 85.4%

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

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

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

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

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

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

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

      \[\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)} \]
    4. Taylor expanded in b around inf

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

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

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

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

    if 3.99999999999999983e-268 < t < 5.2000000000000002e51

    1. Initial program 87.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. Taylor expanded in i around inf

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

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

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

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

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

    if 5.2000000000000002e51 < t

    1. Initial program 83.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6477.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      8. lower-*.f6443.9

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot 18\right) \]
      13. lower-*.f6444.1

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot \color{blue}{18}\right) \]
    6. Applied rewrites44.1%

      \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \color{blue}{\left(t \cdot 18\right)} \]

    if -6.6000000000000006e88 < t < 8.5999999999999998e-73

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

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

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

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

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

        \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \color{blue}{\left(k \cdot 27\right)} \]
      6. lower-*.f6485.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)} \]
    3. Applied rewrites85.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)} \]
    4. Taylor expanded in b around inf

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

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

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

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

    if 8.5999999999999998e-73 < t

    1. Initial program 85.4%

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

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

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

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

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

Alternative 15: 49.6% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      8. lower-*.f6443.9

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot 18\right) \]
      13. lower-*.f6444.1

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot \color{blue}{18}\right) \]
    6. Applied rewrites44.1%

      \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \color{blue}{\left(t \cdot 18\right)} \]

    if -6.6000000000000006e88 < t < 5.39999999999999983e51

    1. Initial program 86.4%

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

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

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

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

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

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

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

      \[\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)} \]
    4. Taylor expanded in b around inf

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

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

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

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

    if 5.39999999999999983e51 < t

    1. Initial program 83.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6477.2

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 49.6% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 \]
      8. lower-*.f6443.9

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot 18\right) \]
      13. lower-*.f6444.1

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(t \cdot \color{blue}{18}\right) \]
    6. Applied rewrites44.1%

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

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

        \[\leadsto \left(\left(z \cdot y\right) \cdot x\right) \cdot \left(\color{blue}{t} \cdot 18\right) \]
      3. associate-*l*N/A

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

        \[\leadsto \left(z \cdot \left(y \cdot x\right)\right) \cdot \left(\color{blue}{t} \cdot 18\right) \]
      5. lower-*.f6444.0

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

      \[\leadsto \left(z \cdot \left(y \cdot x\right)\right) \cdot \left(\color{blue}{t} \cdot 18\right) \]

    if -6.6000000000000006e88 < t < 5.39999999999999983e51

    1. Initial program 86.4%

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

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

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

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

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

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

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

      \[\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)} \]
    4. Taylor expanded in b around inf

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

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

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

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

    if 5.39999999999999983e51 < t

    1. Initial program 83.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6477.2

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 49.3% accurate, 2.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3500000000000001e-17 or 5.39999999999999983e51 < t

    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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3500000000000001e-17 < t < 5.39999999999999983e51

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 78.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. Taylor expanded in j around inf

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

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

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

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

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

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

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

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

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

    1. Initial program 87.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. Taylor expanded in j around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right) \]
      15. lower-*.f6480.6

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 37.1% 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}\;b \cdot c \leq -2 \cdot 10^{+53}:\\ \;\;\;\;c \cdot b\\ \mathbf{elif}\;b \cdot c \leq -4 \cdot 10^{-187}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;b \cdot c \leq 10^{+83}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\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
 (if (<= (* b c) -2e+53)
   (* c b)
   (if (<= (* b c) -4e-187)
     (* -27.0 (* k j))
     (if (<= (* b c) 1e+83) (* -4.0 (* a t)) (* 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) <= -2e+53) {
		tmp = c * b;
	} else if ((b * c) <= -4e-187) {
		tmp = -27.0 * (k * j);
	} else if ((b * c) <= 1e+83) {
		tmp = -4.0 * (a * t);
	} 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) :: tmp
    if ((b * c) <= (-2d+53)) then
        tmp = c * b
    else if ((b * c) <= (-4d-187)) then
        tmp = (-27.0d0) * (k * j)
    else if ((b * c) <= 1d+83) then
        tmp = (-4.0d0) * (a * t)
    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 tmp;
	if ((b * c) <= -2e+53) {
		tmp = c * b;
	} else if ((b * c) <= -4e-187) {
		tmp = -27.0 * (k * j);
	} else if ((b * c) <= 1e+83) {
		tmp = -4.0 * (a * t);
	} 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):
	tmp = 0
	if (b * c) <= -2e+53:
		tmp = c * b
	elif (b * c) <= -4e-187:
		tmp = -27.0 * (k * j)
	elif (b * c) <= 1e+83:
		tmp = -4.0 * (a * t)
	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)
	tmp = 0.0
	if (Float64(b * c) <= -2e+53)
		tmp = Float64(c * b);
	elseif (Float64(b * c) <= -4e-187)
		tmp = Float64(-27.0 * Float64(k * j));
	elseif (Float64(b * c) <= 1e+83)
		tmp = Float64(-4.0 * Float64(a * t));
	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)
	tmp = 0.0;
	if ((b * c) <= -2e+53)
		tmp = c * b;
	elseif ((b * c) <= -4e-187)
		tmp = -27.0 * (k * j);
	elseif ((b * c) <= 1e+83)
		tmp = -4.0 * (a * t);
	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_] := If[LessEqual[N[(b * c), $MachinePrecision], -2e+53], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -4e-187], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e+83], N[(-4.0 * N[(a * t), $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}
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+53}:\\
\;\;\;\;c \cdot b\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -2e53 or 1.00000000000000003e83 < (*.f64 b c)

    1. Initial program 82.0%

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

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
    4. Applied rewrites49.9%

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

    if -2e53 < (*.f64 b c) < -4.0000000000000001e-187

    1. Initial program 86.2%

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

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

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

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6428.8

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

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

    if -4.0000000000000001e-187 < (*.f64 b c) < 1.00000000000000003e83

    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. Taylor expanded in a around inf

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

        \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
      2. lower-*.f6426.2

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

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

Alternative 20: 36.0% accurate, 1.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := -27 \cdot \left(k \cdot j\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\ \;\;\;\;c \cdot b\\ \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 -5e+129) t_1 (if (<= t_2 2e+110) (* c b) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = -27.0 * (k * j);
	double t_2 = (j * 27.0) * k;
	double tmp;
	if (t_2 <= -5e+129) {
		tmp = t_1;
	} else if (t_2 <= 2e+110) {
		tmp = c * b;
	} 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 <= (-5d+129)) then
        tmp = t_1
    else if (t_2 <= 2d+110) then
        tmp = c * b
    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 <= -5e+129) {
		tmp = t_1;
	} else if (t_2 <= 2e+110) {
		tmp = c * b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
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 <= -5e+129:
		tmp = t_1
	elif t_2 <= 2e+110:
		tmp = c * b
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(-27.0 * Float64(k * j))
	t_2 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_2 <= -5e+129)
		tmp = t_1;
	elseif (t_2 <= 2e+110)
		tmp = Float64(c * b);
	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 <= -5e+129)
		tmp = t_1;
	elseif (t_2 <= 2e+110)
		tmp = c * b;
	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, -5e+129], t$95$1, If[LessEqual[t$95$2, 2e+110], N[(c * b), $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 -5 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\

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

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


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

    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. Taylor expanded in j around inf

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

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

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6458.1

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

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

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

    1. Initial program 87.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. Taylor expanded in b around inf

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
    4. Applied rewrites27.1%

      \[\leadsto \color{blue}{c \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 23.2% accurate, 11.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ c \cdot b \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* c b))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = c * b
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	return c * b
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(c * b)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = c * b;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(c * b), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
c \cdot b
\end{array}
Derivation
  1. Initial program 85.0%

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

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

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

      \[\leadsto c \cdot \color{blue}{b} \]
  4. Applied rewrites23.2%

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

Reproduce

?
herbie shell --seed 2025117 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))