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

Percentage Accurate: 85.4% → 91.8%
Time: 6.6s
Alternatives: 18
Speedup: 0.9×

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 18 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 91.8% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.00000000000000001e43

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e43 < y

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.6% accurate, 0.6× speedup?

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) \cdot \color{blue}{x} \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

Alternative 3: 90.8% accurate, 0.5× speedup?

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

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


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

    1. Initial program 85.4%

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

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

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

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

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

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) \cdot \color{blue}{x} \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

Alternative 4: 83.2% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.54999999999999992e-64

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.54999999999999992e-64 < i < 1.7999999999999999e46

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

    if 1.7999999999999999e46 < i

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.8% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -9.99999999999999957e110 or 1e13 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999957e110 < (*.f64 b c) < 1e13

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. associate-+r+N/A

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

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

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

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

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

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

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

Alternative 6: 80.6% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.14999999999999997e213 or 3.3000000000000002e257 < x

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) \cdot \color{blue}{x} \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

    if -2.14999999999999997e213 < x < 3.3000000000000002e257

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -2e114 or 5.0000000000000002e-85 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e114 < (*.f64 b c) < 5.0000000000000002e-85

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. associate-+r+N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t + i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      2. distribute-lft-outN/A

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. associate-+r+N/A

        \[\leadsto -\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      6. distribute-lft-outN/A

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

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

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

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

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

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

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

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

        \[\leadsto -\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), 4, \left(k \cdot j\right) \cdot 27\right) \]
      15. lift-*.f6459.1

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.7% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -6.5000000000000003e195 or 1.4500000000000001e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -6.5000000000000003e195 < (*.f64 b c) < -1.8e22

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) \cdot \color{blue}{x} \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

    if -1.8e22 < (*.f64 b c) < 1.4500000000000001e74

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. associate-+r+N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t + i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      2. distribute-lft-outN/A

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. associate-+r+N/A

        \[\leadsto -\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      6. distribute-lft-outN/A

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

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

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

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

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

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

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

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

        \[\leadsto -\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), 4, \left(k \cdot j\right) \cdot 27\right) \]
      15. lift-*.f6459.1

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 51.8% accurate, 0.8× speedup?

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

\mathbf{elif}\;b \cdot c \leq -9 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -6.5000000000000003e195 or 1.4500000000000001e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -6.5000000000000003e195 < (*.f64 b c) < -9e21 or -4.1999999999999998e-146 < (*.f64 b c) < 1.9999999999999988e-309

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) \cdot \color{blue}{x} \]
      3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

    if -9e21 < (*.f64 b c) < -4.1999999999999998e-146 or 1.9999999999999988e-309 < (*.f64 b c) < 8.50000000000000087e-118

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. associate-+r+N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t + i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      2. distribute-lft-outN/A

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. associate-+r+N/A

        \[\leadsto -\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      6. distribute-lft-outN/A

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

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

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

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

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

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

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

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

        \[\leadsto -\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), 4, \left(k \cdot j\right) \cdot 27\right) \]
      15. lift-*.f6459.1

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

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

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*N/A

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

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

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

        \[\leadsto -\mathsf{fma}\left(4 \cdot a, t, 27 \cdot \left(j \cdot k\right)\right) \]
      7. lower-*.f6442.0

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

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

    if 8.50000000000000087e-118 < (*.f64 b c) < 1.4500000000000001e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(i \cdot x\right)\right) \]
    9. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

Alternative 10: 51.6% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -1.2000000000000001e160 or 1.4500000000000001e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -1.2000000000000001e160 < (*.f64 b c) < -1.5e22

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e22 < (*.f64 b c) < 8.50000000000000087e-118

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18 - \left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      10. associate-+r+N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(4 \cdot \left(a \cdot t + i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      2. distribute-lft-outN/A

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)\right) \]
      5. associate-+r+N/A

        \[\leadsto -\left(\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      6. distribute-lft-outN/A

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

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

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

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

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

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

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

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

        \[\leadsto -\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), 4, \left(k \cdot j\right) \cdot 27\right) \]
      15. lift-*.f6459.1

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

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

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

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

        \[\leadsto -\left(4 \cdot \left(a \cdot t\right) + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*N/A

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

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

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

        \[\leadsto -\mathsf{fma}\left(4 \cdot a, t, 27 \cdot \left(j \cdot k\right)\right) \]
      7. lower-*.f6442.0

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

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

    if 8.50000000000000087e-118 < (*.f64 b c) < 1.4500000000000001e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(i \cdot x\right)\right) \]
    9. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

Alternative 11: 51.5% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1.03e161 or 1.4500000000000001e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -1.03e161 < (*.f64 b c) < 1.4500000000000001e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -4 \cdot \left(i \cdot x\right)\right) \]
    9. Step-by-step derivation
      1. associate-*l*N/A

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

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

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

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

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

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

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

\mathbf{elif}\;b \cdot c \leq -7.5 \cdot 10^{+21}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(\left(y \cdot x\right) \cdot z\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -1.14999999999999994e160 or 1.21999999999999989e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -1.14999999999999994e160 < (*.f64 b c) < -7.5e21

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 18 \cdot \left(t \cdot \left(\left(y \cdot x\right) \cdot z\right)\right) \]
    12. Applied rewrites26.7%

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

    if -7.5e21 < (*.f64 b c) < -1.65e-112

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

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

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

    if -1.65e-112 < (*.f64 b c) < 1.21999999999999989e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;b \cdot c \leq 3.5 \cdot 10^{-262}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -1.2000000000000001e127 or 1.21999999999999989e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -1.2000000000000001e127 < (*.f64 b c) < 3.50000000000000011e-262

    1. Initial program 85.4%

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

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

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

        \[\leadsto \left(-4 \cdot i\right) \cdot \color{blue}{x} \]
      3. lower-*.f6421.7

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

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

    if 3.50000000000000011e-262 < (*.f64 b c) < 1.21999999999999989e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      6. lift-*.f6423.8

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -3.99999999999999983e111 or 1.21999999999999989e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -3.99999999999999983e111 < (*.f64 b c) < -1.65e-112

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

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

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

    if -1.65e-112 < (*.f64 b c) < 1.21999999999999989e74

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -3.99999999999999983e111 or 1.21999999999999989e74 < (*.f64 b c)

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

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

    if -3.99999999999999983e111 < (*.f64 b c) < -1.65e-112

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.3%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]

    if -1.65e-112 < (*.f64 b c) < 1.21999999999999989e74

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      2. *-commutativeN/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6423.8

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    4. Applied rewrites23.8%

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(k \cdot j\right)} \]
      2. lift-*.f64N/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. *-commutativeN/A

        \[\leadsto -27 \cdot \left(j \cdot \color{blue}{k}\right) \]
      4. associate-*l*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      5. lower-*.f64N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
      6. lift-*.f6423.8

        \[\leadsto \left(-27 \cdot j\right) \cdot k \]
    6. Applied rewrites23.8%

      \[\leadsto \left(-27 \cdot j\right) \cdot \color{blue}{k} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 36.2% accurate, 1.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} \mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+111}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq -1.65 \cdot 10^{-112}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{elif}\;b \cdot c \leq 1.22 \cdot 10^{+74}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -4e+111)
   (* b c)
   (if (<= (* b c) -1.65e-112)
     (* -4.0 (* a t))
     (if (<= (* b c) 1.22e+74) (* -27.0 (* k j)) (* b c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -4e+111) {
		tmp = b * c;
	} else if ((b * c) <= -1.65e-112) {
		tmp = -4.0 * (a * t);
	} else if ((b * c) <= 1.22e+74) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = b * c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((b * c) <= (-4d+111)) then
        tmp = b * c
    else if ((b * c) <= (-1.65d-112)) then
        tmp = (-4.0d0) * (a * t)
    else if ((b * c) <= 1.22d+74) then
        tmp = (-27.0d0) * (k * j)
    else
        tmp = b * c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -4e+111) {
		tmp = b * c;
	} else if ((b * c) <= -1.65e-112) {
		tmp = -4.0 * (a * t);
	} else if ((b * c) <= 1.22e+74) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = b * c;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -4e+111:
		tmp = b * c
	elif (b * c) <= -1.65e-112:
		tmp = -4.0 * (a * t)
	elif (b * c) <= 1.22e+74:
		tmp = -27.0 * (k * j)
	else:
		tmp = b * c
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -4e+111)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= -1.65e-112)
		tmp = Float64(-4.0 * Float64(a * t));
	elseif (Float64(b * c) <= 1.22e+74)
		tmp = Float64(-27.0 * Float64(k * j));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if ((b * c) <= -4e+111)
		tmp = b * c;
	elseif ((b * c) <= -1.65e-112)
		tmp = -4.0 * (a * t);
	elseif ((b * c) <= 1.22e+74)
		tmp = -27.0 * (k * j);
	else
		tmp = b * c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -4e+111], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.65e-112], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.22e+74], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+111}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;b \cdot c \leq -1.65 \cdot 10^{-112}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

\mathbf{elif}\;b \cdot c \leq 1.22 \cdot 10^{+74}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 b c) < -3.99999999999999983e111 or 1.21999999999999989e74 < (*.f64 b c)

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in j around 0

      \[\leadsto \color{blue}{\left(-27 \cdot \left(j \cdot k\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto -27 \cdot \left(j \cdot k\right) + \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} \]
      2. associate-*r*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot k + \left(\color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)} - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, \color{blue}{k}, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, x \cdot \left(y \cdot z\right), b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
    4. Applied rewrites88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)} \]
    5. Taylor expanded in y around -inf

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -1 \cdot \left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{neg}\left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
    7. Applied rewrites79.4%

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\mathsf{fma}\left(-18 \cdot t, z \cdot x, -\frac{\mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)}{y}\right) \cdot y\right) \]
    8. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

      \[\leadsto \color{blue}{b \cdot c} \]

    if -3.99999999999999983e111 < (*.f64 b c) < -1.65e-112

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in t around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      4. lower-*.f64N/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6442.6

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites42.6%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.3%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]

    if -1.65e-112 < (*.f64 b c) < 1.21999999999999989e74

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in j around inf

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -27 \cdot \color{blue}{\left(j \cdot k\right)} \]
      2. *-commutativeN/A

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
      3. lower-*.f6423.8

        \[\leadsto -27 \cdot \left(k \cdot \color{blue}{j}\right) \]
    4. Applied rewrites23.8%

      \[\leadsto \color{blue}{-27 \cdot \left(k \cdot j\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 34.8% 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])\\\\ [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 -4 \cdot 10^{+111}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 580:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= (* b c) -4e+111)
   (* b c)
   (if (<= (* b c) 580.0) (* -4.0 (* a t)) (* b c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -4e+111) {
		tmp = b * c;
	} else if ((b * c) <= 580.0) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = b * c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((b * c) <= (-4d+111)) then
        tmp = b * c
    else if ((b * c) <= 580.0d0) then
        tmp = (-4.0d0) * (a * t)
    else
        tmp = b * c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if ((b * c) <= -4e+111) {
		tmp = b * c;
	} else if ((b * c) <= 580.0) {
		tmp = -4.0 * (a * t);
	} else {
		tmp = b * c;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if (b * c) <= -4e+111:
		tmp = b * c
	elif (b * c) <= 580.0:
		tmp = -4.0 * (a * t)
	else:
		tmp = b * c
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (Float64(b * c) <= -4e+111)
		tmp = Float64(b * c);
	elseif (Float64(b * c) <= 580.0)
		tmp = Float64(-4.0 * Float64(a * t));
	else
		tmp = Float64(b * c);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0;
	if ((b * c) <= -4e+111)
		tmp = b * c;
	elseif ((b * c) <= 580.0)
		tmp = -4.0 * (a * t);
	else
		tmp = b * c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -4e+111], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 580.0], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -4 \cdot 10^{+111}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;b \cdot c \leq 580:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot c\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -3.99999999999999983e111 or 580 < (*.f64 b c)

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in j around 0

      \[\leadsto \color{blue}{\left(-27 \cdot \left(j \cdot k\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto -27 \cdot \left(j \cdot k\right) + \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} \]
      2. associate-*r*N/A

        \[\leadsto \left(-27 \cdot j\right) \cdot k + \left(\color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)} - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, \color{blue}{k}, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, x \cdot \left(y \cdot z\right), b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
    4. Applied rewrites88.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)} \]
    5. Taylor expanded in y around -inf

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -1 \cdot \left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{neg}\left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
    7. Applied rewrites79.4%

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\mathsf{fma}\left(-18 \cdot t, z \cdot x, -\frac{\mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)}{y}\right) \cdot y\right) \]
    8. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot c} \]
    9. Step-by-step derivation
      1. lower-*.f6423.4

        \[\leadsto b \cdot \color{blue}{c} \]
    10. Applied rewrites23.4%

      \[\leadsto \color{blue}{b \cdot c} \]

    if -3.99999999999999983e111 < (*.f64 b c) < 580

    1. Initial program 85.4%

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Taylor expanded in t around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \]
      3. *-commutativeN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      4. lower-*.f64N/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) \cdot t \]
      5. fp-cancel-sub-sign-invN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(\mathsf{neg}\left(-4\right)\right) \cdot a\right) \cdot t \]
      6. metadata-evalN/A

        \[\leadsto -\left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) + 4 \cdot a\right) \cdot t \]
      7. lower-fma.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, x \cdot \left(y \cdot z\right), 4 \cdot a\right) \cdot t \]
      8. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      9. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(y \cdot z\right) \cdot x, 4 \cdot a\right) \cdot t \]
      10. *-commutativeN/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      11. lower-*.f64N/A

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
      12. lower-*.f6442.6

        \[\leadsto -\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t \]
    4. Applied rewrites42.6%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t} \]
    5. Taylor expanded in x around 0

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -4 \cdot \left(a \cdot \color{blue}{t}\right) \]
      2. lower-*.f6421.3

        \[\leadsto -4 \cdot \left(a \cdot t\right) \]
    7. Applied rewrites21.3%

      \[\leadsto -4 \cdot \color{blue}{\left(a \cdot t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 23.4% 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])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ b \cdot c \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = b * c
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	return b * c
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(b * c)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = b * c;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
b \cdot c
\end{array}
Derivation
  1. Initial program 85.4%

    \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
  2. Taylor expanded in j around 0

    \[\leadsto \color{blue}{\left(-27 \cdot \left(j \cdot k\right) + \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)} \]
  3. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto -27 \cdot \left(j \cdot k\right) + \color{blue}{\left(\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(-27 \cdot j\right) \cdot k + \left(\color{blue}{\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right)} - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
    3. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, \color{blue}{k}, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + b \cdot c\right) - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right) \]
    5. associate--l+N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
    6. associate-*r*N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right) + \left(b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
    7. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, x \cdot \left(y \cdot z\right), b \cdot c - \left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)\right) \]
  4. Applied rewrites88.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)} \]
  5. Taylor expanded in y around -inf

    \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -1 \cdot \left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, \mathsf{neg}\left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right)\right) \]
    2. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
    4. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{b \cdot c - 4 \cdot \left(a \cdot t + i \cdot x\right)}{y}\right) \cdot y\right) \]
  7. Applied rewrites79.4%

    \[\leadsto \mathsf{fma}\left(-27 \cdot j, k, -\mathsf{fma}\left(-18 \cdot t, z \cdot x, -\frac{\mathsf{fma}\left(c, b, -4 \cdot \mathsf{fma}\left(i, x, a \cdot t\right)\right)}{y}\right) \cdot y\right) \]
  8. Taylor expanded in b around inf

    \[\leadsto \color{blue}{b \cdot c} \]
  9. Step-by-step derivation
    1. lower-*.f6423.4

      \[\leadsto b \cdot \color{blue}{c} \]
  10. Applied rewrites23.4%

    \[\leadsto \color{blue}{b \cdot c} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025131 
(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)))