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

Percentage Accurate: 85.2% → 92.9%
Time: 6.1s
Alternatives: 21
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 85.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 92.9% accurate, 0.3× speedup?

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

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

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

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


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

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

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot y\right)\right) + -1 \cdot \frac{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)}{z}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot y\right)\right) + -1 \cdot \frac{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)}{z}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -z \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot y\right)\right) + -1 \cdot \frac{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)}{z}\right) \]
      3. *-commutativeN/A

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

        \[\leadsto -\left(-18 \cdot \left(t \cdot \left(x \cdot y\right)\right) + -1 \cdot \frac{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)}{z}\right) \cdot z \]
    4. Applied rewrites88.0%

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

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

    1. Initial program 99.6%

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

    if 1.9999999999999999e298 < (-.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 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\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)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \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) \]
      2. lower-neg.f64N/A

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

        \[\leadsto -\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 \]
      4. lower-*.f64N/A

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

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

    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 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x\right) \cdot \left(\mathsf{fma}\left(-18 \cdot t, z \cdot y, \left(27 \cdot \frac{k}{x}\right) \cdot j\right) - -4 \cdot i\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-x\right) \cdot \left(\mathsf{fma}\left(-18 \cdot t, z \cdot y, \left(27 \cdot \frac{k}{x}\right) \cdot j\right) - -4 \cdot i\right) \]
      2. lift-/.f6474.9

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

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

Alternative 2: 92.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 96.5%

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

    if 1.9999999999999999e298 < (-.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 91.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{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)}{y}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{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)}{y}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -y \cdot \left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{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)}{y}\right) \]
      3. *-commutativeN/A

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

        \[\leadsto -\left(-18 \cdot \left(t \cdot \left(x \cdot z\right)\right) + -1 \cdot \frac{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)}{y}\right) \cdot y \]
    4. Applied rewrites93.7%

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{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-*.f6463.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.0% 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 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(t \cdot 18\right) \cdot z, 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
 (let* ((t_1
         (-
          (-
           (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
           (* (* x 4.0) i))
          (* (* j 27.0) k))))
   (if (<= t_1 INFINITY) t_1 (* (fma (* (* t 18.0) 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 t_1 = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(((t * 18.0) * 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)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(fma(Float64(Float64(t * 18.0) * 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_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(N[(t * 18.0), $MachinePrecision] * z), $MachinePrecision] * y + 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}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot 18\right) \cdot z, 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 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 95.2%

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{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-*.f6463.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot 18\right) \cdot z, 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 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{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-*.f6463.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.4% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -1.00000000000000007e193 or 2.0000000000000001e76 < (-.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 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000007e193 < (-.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)) < 2.0000000000000001e76

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x\right) \cdot \left(\mathsf{fma}\left(-18 \cdot t, z \cdot y, \left(27 \cdot \frac{k}{x}\right) \cdot j\right) - -4 \cdot i\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-x\right) \cdot \left(\mathsf{fma}\left(-18 \cdot t, z \cdot y, \left(27 \cdot \frac{k}{x}\right) \cdot j\right) - -4 \cdot i\right) \]
      2. lift-/.f6474.9

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

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

Alternative 6: 71.7% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.2000000000000001e147 or 3.7999999999999999e58 < t

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000001e147 < t < 3.7999999999999999e58

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 58.2% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.00000000000000046e63 or 5.1000000000000001e51 < t

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000046e63 < t < -1.29999999999999999e34

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - j \cdot \color{blue}{\left(k \cdot 27\right)} \]
      6. lower-*.f6435.7

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

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

    if -1.29999999999999999e34 < t < 5.1000000000000001e51

    1. Initial program 86.3%

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

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

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

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

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

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

Alternative 8: 54.6% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;i \leq -1 \cdot 10^{+22}:\\ \;\;\;\;\left(-4 \cdot i\right) \cdot x - t\_1\\ \mathbf{elif}\;i \leq -1.26 \cdot 10^{-288}:\\ \;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_1\\ \mathbf{elif}\;i \leq 5 \cdot 10^{-29}:\\ \;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\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
 (let* ((t_1 (* (* j 27.0) k)))
   (if (<= i -1e+22)
     (- (* (* -4.0 i) x) t_1)
     (if (<= i -1.26e-288)
       (- (* -4.0 (* a t)) t_1)
       (if (<= i 5e-29)
         (- (* c b) (* j (* k 27.0)))
         (* (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 t_1 = (j * 27.0) * k;
	double tmp;
	if (i <= -1e+22) {
		tmp = ((-4.0 * i) * x) - t_1;
	} else if (i <= -1.26e-288) {
		tmp = (-4.0 * (a * t)) - t_1;
	} else if (i <= 5e-29) {
		tmp = (c * b) - (j * (k * 27.0));
	} 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)
	t_1 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (i <= -1e+22)
		tmp = Float64(Float64(Float64(-4.0 * i) * x) - t_1);
	elseif (i <= -1.26e-288)
		tmp = Float64(Float64(-4.0 * Float64(a * t)) - t_1);
	elseif (i <= 5e-29)
		tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0)));
	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_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[i, -1e+22], N[(N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[i, -1.26e-288], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[i, 5e-29], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $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}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;i \leq -1 \cdot 10^{+22}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x - t\_1\\

\mathbf{elif}\;i \leq -1.26 \cdot 10^{-288}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - t\_1\\

\mathbf{elif}\;i \leq 5 \cdot 10^{-29}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\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 4 regimes
  2. if i < -1e22

    1. Initial program 82.5%

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

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

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

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

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

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

    if -1e22 < i < -1.26e-288

    1. Initial program 88.5%

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

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

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

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

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

    if -1.26e-288 < i < 4.99999999999999986e-29

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - j \cdot \color{blue}{\left(k \cdot 27\right)} \]
      6. lower-*.f6450.1

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

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

    if 4.99999999999999986e-29 < i

    1. Initial program 82.9%

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

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

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

Alternative 9: 54.5% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b\right) \]
    7. Applied rewrites48.8%

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

    if -9.20000000000000042e33 < t < 5.1000000000000001e51

    1. Initial program 86.3%

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

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

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

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

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

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

    if 5.1000000000000001e51 < t

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 50.1% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - j \cdot \color{blue}{\left(k \cdot 27\right)} \]
      6. lower-*.f6458.7

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

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

    if -1.00000000000000005e-4 < (*.f64 b c) < 1.99999999999999989e72

    1. Initial program 87.2%

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

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

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

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

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

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

    if 1.99999999999999989e72 < (*.f64 b c)

    1. Initial program 81.9%

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

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

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

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

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

Alternative 11: 48.7% accurate, 1.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.25e137 or 3.29999999999999989e203 < t

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e137 < t < 4.7e-55

    1. Initial program 86.3%

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

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

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

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

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

    if 4.7e-55 < t < 3.29999999999999989e203

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25e137 or 1.46000000000000003e202 < t

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e137 < t < 1.46000000000000003e202

    1. Initial program 86.6%

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

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

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

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

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

Alternative 13: 47.9% 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}\;t \leq -8.8 \cdot 10^{+137}:\\ \;\;\;\;\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{+202}:\\ \;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t -8.8e+137)
   (* (* (* (* z y) t) 18.0) x)
   (if (<= t 1.46e+202)
     (- (* c b) (* (* j 27.0) k))
     (* (* (* (* y x) t) 18.0) z))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (t <= -8.8e+137) {
		tmp = (((z * y) * t) * 18.0) * x;
	} else if (t <= 1.46e+202) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (((y * x) * t) * 18.0) * z;
	}
	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 (t <= (-8.8d+137)) then
        tmp = (((z * y) * t) * 18.0d0) * x
    else if (t <= 1.46d+202) then
        tmp = (c * b) - ((j * 27.0d0) * k)
    else
        tmp = (((y * x) * t) * 18.0d0) * z
    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 (t <= -8.8e+137) {
		tmp = (((z * y) * t) * 18.0) * x;
	} else if (t <= 1.46e+202) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (((y * x) * t) * 18.0) * z;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if t <= -8.8e+137:
		tmp = (((z * y) * t) * 18.0) * x
	elif t <= 1.46e+202:
		tmp = (c * b) - ((j * 27.0) * k)
	else:
		tmp = (((y * x) * t) * 18.0) * z
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= -8.8e+137)
		tmp = Float64(Float64(Float64(Float64(z * y) * t) * 18.0) * x);
	elseif (t <= 1.46e+202)
		tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k));
	else
		tmp = Float64(Float64(Float64(Float64(y * x) * t) * 18.0) * z);
	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 (t <= -8.8e+137)
		tmp = (((z * y) * t) * 18.0) * x;
	elseif (t <= 1.46e+202)
		tmp = (c * b) - ((j * 27.0) * k);
	else
		tmp = (((y * x) * t) * 18.0) * z;
	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[t, -8.8e+137], N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.46e+202], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+137}:\\
\;\;\;\;\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z\\


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

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

    if -8.80000000000000062e137 < t < 1.46000000000000003e202

    1. Initial program 86.6%

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

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

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

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

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

    if 1.46000000000000003e202 < t

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 47.9% 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}\;t \leq -8.8 \cdot 10^{+137}:\\ \;\;\;\;\left(\left(\left(t \cdot y\right) \cdot z\right) \cdot 18\right) \cdot x\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{+202}:\\ \;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t -8.8e+137)
   (* (* (* (* t y) z) 18.0) x)
   (if (<= t 1.46e+202)
     (- (* c b) (* (* j 27.0) k))
     (* (* (* (* y x) t) 18.0) z))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (t <= -8.8e+137) {
		tmp = (((t * y) * z) * 18.0) * x;
	} else if (t <= 1.46e+202) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (((y * x) * t) * 18.0) * z;
	}
	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 (t <= (-8.8d+137)) then
        tmp = (((t * y) * z) * 18.0d0) * x
    else if (t <= 1.46d+202) then
        tmp = (c * b) - ((j * 27.0d0) * k)
    else
        tmp = (((y * x) * t) * 18.0d0) * z
    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 (t <= -8.8e+137) {
		tmp = (((t * y) * z) * 18.0) * x;
	} else if (t <= 1.46e+202) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (((y * x) * t) * 18.0) * z;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if t <= -8.8e+137:
		tmp = (((t * y) * z) * 18.0) * x
	elif t <= 1.46e+202:
		tmp = (c * b) - ((j * 27.0) * k)
	else:
		tmp = (((y * x) * t) * 18.0) * z
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= -8.8e+137)
		tmp = Float64(Float64(Float64(Float64(t * y) * z) * 18.0) * x);
	elseif (t <= 1.46e+202)
		tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k));
	else
		tmp = Float64(Float64(Float64(Float64(y * x) * t) * 18.0) * z);
	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 (t <= -8.8e+137)
		tmp = (((t * y) * z) * 18.0) * x;
	elseif (t <= 1.46e+202)
		tmp = (c * b) - ((j * 27.0) * k);
	else
		tmp = (((y * x) * t) * 18.0) * z;
	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[t, -8.8e+137], N[(N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.46e+202], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+137}:\\
\;\;\;\;\left(\left(\left(t \cdot y\right) \cdot z\right) \cdot 18\right) \cdot x\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z\\


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

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.80000000000000062e137 < t < 1.46000000000000003e202

    1. Initial program 86.6%

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

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

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

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

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

    if 1.46000000000000003e202 < t

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 47.7% 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} t_1 := \left(\left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z\\ \mathbf{if}\;t \leq -1.25 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{+202}:\\ \;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 (* (* (* (* y x) t) 18.0) z)))
   (if (<= t -1.25e+137)
     t_1
     (if (<= t 1.46e+202) (- (* c b) (* (* j 27.0) k)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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 = (((y * x) * t) * 18.0) * z;
	double tmp;
	if (t <= -1.25e+137) {
		tmp = t_1;
	} else if (t <= 1.46e+202) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.25e137 or 1.46000000000000003e202 < t

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{i \cdot x}{z}, -4, \left(\left(y \cdot x\right) \cdot t\right) \cdot 18\right) \cdot z \]
      12. lower-*.f6444.0

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

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

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

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

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

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

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

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

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

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

    if -1.25e137 < t < 1.46000000000000003e202

    1. Initial program 86.6%

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

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

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

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

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

Alternative 16: 46.3% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [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 -7.8 \cdot 10^{+216}:\\ \;\;\;\;\left(i \cdot x\right) \cdot -4\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{+17}:\\ \;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(-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 (<= i -7.8e+216)
   (* (* i x) -4.0)
   (if (<= i 2.3e+17) (- (* c b) (* (* j 27.0) k)) (* (* -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 (i <= -7.8e+216) {
		tmp = (i * x) * -4.0;
	} else if (i <= 2.3e+17) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (-4.0 * i) * x;
	}
	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 (i <= (-7.8d+216)) then
        tmp = (i * x) * (-4.0d0)
    else if (i <= 2.3d+17) then
        tmp = (c * b) - ((j * 27.0d0) * k)
    else
        tmp = ((-4.0d0) * i) * x
    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 (i <= -7.8e+216) {
		tmp = (i * x) * -4.0;
	} else if (i <= 2.3e+17) {
		tmp = (c * b) - ((j * 27.0) * k);
	} else {
		tmp = (-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])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if i <= -7.8e+216:
		tmp = (i * x) * -4.0
	elif i <= 2.3e+17:
		tmp = (c * b) - ((j * 27.0) * k)
	else:
		tmp = (-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 (i <= -7.8e+216)
		tmp = Float64(Float64(i * x) * -4.0);
	elseif (i <= 2.3e+17)
		tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k));
	else
		tmp = Float64(Float64(-4.0 * i) * x);
	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 (i <= -7.8e+216)
		tmp = (i * x) * -4.0;
	elseif (i <= 2.3e+17)
		tmp = (c * b) - ((j * 27.0) * k);
	else
		tmp = (-4.0 * i) * x;
	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[i, -7.8e+216], N[(N[(i * x), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[i, 2.3e+17], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * i), $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}\;i \leq -7.8 \cdot 10^{+216}:\\
\;\;\;\;\left(i \cdot x\right) \cdot -4\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -7.79999999999999962e216

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot x\right) \cdot \color{blue}{-4} \]
      3. lift-*.f6455.8

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

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

    if -7.79999999999999962e216 < i < 2.3e17

    1. Initial program 86.8%

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

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

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

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

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

    if 2.3e17 < i

    1. Initial program 82.0%

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

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

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

Alternative 17: 46.3% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [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 -7.8 \cdot 10^{+216}:\\ \;\;\;\;\left(i \cdot x\right) \cdot -4\\ \mathbf{elif}\;i \leq 2.3 \cdot 10^{+17}:\\ \;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-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 (<= i -7.8e+216)
   (* (* i x) -4.0)
   (if (<= i 2.3e+17) (- (* c b) (* j (* k 27.0))) (* (* -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 (i <= -7.8e+216) {
		tmp = (i * x) * -4.0;
	} else if (i <= 2.3e+17) {
		tmp = (c * b) - (j * (k * 27.0));
	} else {
		tmp = (-4.0 * i) * x;
	}
	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 (i <= (-7.8d+216)) then
        tmp = (i * x) * (-4.0d0)
    else if (i <= 2.3d+17) then
        tmp = (c * b) - (j * (k * 27.0d0))
    else
        tmp = ((-4.0d0) * i) * x
    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 (i <= -7.8e+216) {
		tmp = (i * x) * -4.0;
	} else if (i <= 2.3e+17) {
		tmp = (c * b) - (j * (k * 27.0));
	} else {
		tmp = (-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])
def code(x, y, z, t, a, b, c, i, j, k):
	tmp = 0
	if i <= -7.8e+216:
		tmp = (i * x) * -4.0
	elif i <= 2.3e+17:
		tmp = (c * b) - (j * (k * 27.0))
	else:
		tmp = (-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 (i <= -7.8e+216)
		tmp = Float64(Float64(i * x) * -4.0);
	elseif (i <= 2.3e+17)
		tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0)));
	else
		tmp = Float64(Float64(-4.0 * i) * x);
	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 (i <= -7.8e+216)
		tmp = (i * x) * -4.0;
	elseif (i <= 2.3e+17)
		tmp = (c * b) - (j * (k * 27.0));
	else
		tmp = (-4.0 * i) * x;
	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[i, -7.8e+216], N[(N[(i * x), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[i, 2.3e+17], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * i), $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}\;i \leq -7.8 \cdot 10^{+216}:\\
\;\;\;\;\left(i \cdot x\right) \cdot -4\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -7.79999999999999962e216

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot x\right) \cdot \color{blue}{-4} \]
      3. lift-*.f6455.8

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

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

    if -7.79999999999999962e216 < i < 2.3e17

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot b - j \cdot \color{blue}{\left(k \cdot 27\right)} \]
      6. lower-*.f6448.0

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

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

    if 2.3e17 < i

    1. Initial program 82.0%

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

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

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

Alternative 18: 36.4% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [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 -100000000000:\\ \;\;\;\;c \cdot b\\ \mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-273}:\\ \;\;\;\;\left(-27 \cdot k\right) \cdot j\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{-202}:\\ \;\;\;\;\left(i \cdot x\right) \cdot -4\\ \mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+52}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) -100000000000.0)
   (* c b)
   (if (<= (* b c) -2e-273)
     (* (* -27.0 k) j)
     (if (<= (* b c) 2e-202)
       (* (* i x) -4.0)
       (if (<= (* b c) 5e+52) (* -27.0 (* k j)) (* c b))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= -2e-273) {
		tmp = (-27.0 * k) * j;
	} else if ((b * c) <= 2e-202) {
		tmp = (i * x) * -4.0;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) <= (-100000000000.0d0)) then
        tmp = c * b
    else if ((b * c) <= (-2d-273)) then
        tmp = ((-27.0d0) * k) * j
    else if ((b * c) <= 2d-202) then
        tmp = (i * x) * (-4.0d0)
    else if ((b * c) <= 5d+52) then
        tmp = (-27.0d0) * (k * j)
    else
        tmp = c * b
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= -2e-273) {
		tmp = (-27.0 * k) * j;
	} else if ((b * c) <= 2e-202) {
		tmp = (i * x) * -4.0;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[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) <= -100000000000.0:
		tmp = c * b
	elif (b * c) <= -2e-273:
		tmp = (-27.0 * k) * j
	elif (b * c) <= 2e-202:
		tmp = (i * x) * -4.0
	elif (b * c) <= 5e+52:
		tmp = -27.0 * (k * j)
	else:
		tmp = c * b
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
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) <= -100000000000.0)
		tmp = Float64(c * b);
	elseif (Float64(b * c) <= -2e-273)
		tmp = Float64(Float64(-27.0 * k) * j);
	elseif (Float64(b * c) <= 2e-202)
		tmp = Float64(Float64(i * x) * -4.0);
	elseif (Float64(b * c) <= 5e+52)
		tmp = Float64(-27.0 * Float64(k * j));
	else
		tmp = Float64(c * b);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
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) <= -100000000000.0)
		tmp = c * b;
	elseif ((b * c) <= -2e-273)
		tmp = (-27.0 * k) * j;
	elseif ((b * c) <= 2e-202)
		tmp = (i * x) * -4.0;
	elseif ((b * c) <= 5e+52)
		tmp = -27.0 * (k * j);
	else
		tmp = c * b;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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], -100000000000.0], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2e-273], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e-202], N[(N[(i * x), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+52], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[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 -100000000000:\\
\;\;\;\;c \cdot b\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -1e11 or 5e52 < (*.f64 b c)

    1. Initial program 82.7%

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

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
    4. Applied rewrites46.1%

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

    if -1e11 < (*.f64 b c) < -2e-273

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

    if -2e-273 < (*.f64 b c) < 2.0000000000000001e-202

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(i \cdot x\right) \cdot \color{blue}{-4} \]
      3. lift-*.f6425.9

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

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

    if 2.0000000000000001e-202 < (*.f64 b c) < 5e52

    1. Initial program 87.3%

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

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

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

Alternative 19: 35.6% 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 -100000000000:\\ \;\;\;\;c \cdot b\\ \mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-273}:\\ \;\;\;\;\left(-27 \cdot k\right) \cdot j\\ \mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{-202}:\\ \;\;\;\;\left(-4 \cdot i\right) \cdot x\\ \mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+52}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) -100000000000.0)
   (* c b)
   (if (<= (* b c) -2e-273)
     (* (* -27.0 k) j)
     (if (<= (* b c) 2e-202)
       (* (* -4.0 i) x)
       (if (<= (* b c) 5e+52) (* -27.0 (* k j)) (* c b))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= -2e-273) {
		tmp = (-27.0 * k) * j;
	} else if ((b * c) <= 2e-202) {
		tmp = (-4.0 * i) * x;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) <= (-100000000000.0d0)) then
        tmp = c * b
    else if ((b * c) <= (-2d-273)) then
        tmp = ((-27.0d0) * k) * j
    else if ((b * c) <= 2d-202) then
        tmp = ((-4.0d0) * i) * x
    else if ((b * c) <= 5d+52) then
        tmp = (-27.0d0) * (k * j)
    else
        tmp = c * b
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= -2e-273) {
		tmp = (-27.0 * k) * j;
	} else if ((b * c) <= 2e-202) {
		tmp = (-4.0 * i) * x;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[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) <= -100000000000.0:
		tmp = c * b
	elif (b * c) <= -2e-273:
		tmp = (-27.0 * k) * j
	elif (b * c) <= 2e-202:
		tmp = (-4.0 * i) * x
	elif (b * c) <= 5e+52:
		tmp = -27.0 * (k * j)
	else:
		tmp = c * b
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
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) <= -100000000000.0)
		tmp = Float64(c * b);
	elseif (Float64(b * c) <= -2e-273)
		tmp = Float64(Float64(-27.0 * k) * j);
	elseif (Float64(b * c) <= 2e-202)
		tmp = Float64(Float64(-4.0 * i) * x);
	elseif (Float64(b * c) <= 5e+52)
		tmp = Float64(-27.0 * Float64(k * j));
	else
		tmp = Float64(c * b);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
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) <= -100000000000.0)
		tmp = c * b;
	elseif ((b * c) <= -2e-273)
		tmp = (-27.0 * k) * j;
	elseif ((b * c) <= 2e-202)
		tmp = (-4.0 * i) * x;
	elseif ((b * c) <= 5e+52)
		tmp = -27.0 * (k * j);
	else
		tmp = c * b;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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], -100000000000.0], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2e-273], N[(N[(-27.0 * k), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e-202], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+52], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[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 -100000000000:\\
\;\;\;\;c \cdot b\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 b c) < -1e11 or 5e52 < (*.f64 b c)

    1. Initial program 82.7%

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

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
    4. Applied rewrites46.1%

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

    if -1e11 < (*.f64 b c) < -2e-273

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

    if -2e-273 < (*.f64 b c) < 2.0000000000000001e-202

    1. Initial program 88.0%

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

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

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

    if 2.0000000000000001e-202 < (*.f64 b c) < 5e52

    1. Initial program 87.3%

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

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

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

Alternative 20: 35.6% accurate, 2.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\ [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 -100000000000:\\ \;\;\;\;c \cdot b\\ \mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+52}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot b\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) -100000000000.0)
   (* c b)
   (if (<= (* b c) 5e+52) (* -27.0 (* k j)) (* c b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) <= (-100000000000.0d0)) then
        tmp = c * b
    else if ((b * c) <= 5d+52) then
        tmp = (-27.0d0) * (k * j)
    else
        tmp = c * b
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
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) <= -100000000000.0) {
		tmp = c * b;
	} else if ((b * c) <= 5e+52) {
		tmp = -27.0 * (k * j);
	} else {
		tmp = c * b;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[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) <= -100000000000.0:
		tmp = c * b
	elif (b * c) <= 5e+52:
		tmp = -27.0 * (k * j)
	else:
		tmp = c * b
	return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
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) <= -100000000000.0)
		tmp = Float64(c * b);
	elseif (Float64(b * c) <= 5e+52)
		tmp = Float64(-27.0 * Float64(k * j));
	else
		tmp = Float64(c * b);
	end
	return tmp
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
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) <= -100000000000.0)
		tmp = c * b;
	elseif ((b * c) <= 5e+52)
		tmp = -27.0 * (k * j);
	else
		tmp = c * b;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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], -100000000000.0], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+52], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[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 -100000000000:\\
\;\;\;\;c \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -1e11 or 5e52 < (*.f64 b c)

    1. Initial program 82.7%

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

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

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

        \[\leadsto c \cdot \color{blue}{b} \]
    4. Applied rewrites46.1%

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

    if -1e11 < (*.f64 b c) < 5e52

    1. Initial program 87.2%

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

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

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

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

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

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

Alternative 21: 23.7% 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])\\ \\ c \cdot b \end{array} \]
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* c b))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = c * b
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return c * b;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	return c * b
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(c * b)
end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = c * b;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(c * b), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
c \cdot b
\end{array}
Derivation
  1. Initial program 85.2%

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

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

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

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

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

Reproduce

?
herbie shell --seed 2025110 
(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)))