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

Percentage Accurate: 85.1% → 91.4%
Time: 29.3s
Alternatives: 28
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 28 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.1% 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);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 91.4% accurate, 0.5× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([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 - t \cdot \left(a \cdot 4\right)\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}:\\ \;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \end{array} \end{array} \]
NOTE: 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) (* t (* a 4.0))) (* b c))
           (* (* x 4.0) i))
          (* (* j 27.0) k))))
   (if (<= t_1 INFINITY)
     t_1
     (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))))
assert(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) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
	}
	return tmp;
}
assert 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 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))
	return tmp
j, k = sort([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(t * Float64(a * 4.0))) + 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(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))));
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
	end
	tmp_2 = tmp;
end
NOTE: 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[(t * N[(a * 4.0), $MachinePrecision]), $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[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([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 - t \cdot \left(a \cdot 4\right)\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}:\\
\;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\


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

    1. Initial program 95.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 +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) 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 0 33.3%

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

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

      \[\leadsto \color{blue}{b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\ \;\;\;\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \end{array} \]

Alternative 2: 63.5% accurate, 0.5× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := b \cdot c - t_1\\ t_3 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ t_4 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_1 \leq 10^{-68}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+92}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+164}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right) - t_1\\ \end{array} \end{array} \]
NOTE: 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 (- (* b c) t_1))
        (t_3 (+ (* b c) (* (+ (* t a) (* x i)) -4.0)))
        (t_4 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
   (if (<= t_1 -1e+217)
     (+ (* j (* k -27.0)) (* (* x i) -4.0))
     (if (<= t_1 -8e+63)
       t_3
       (if (<= t_1 -2e+25)
         t_2
         (if (<= t_1 -5e-18)
           t_4
           (if (<= t_1 1e-68)
             t_3
             (if (<= t_1 2e+92)
               t_4
               (if (<= t_1 2e+164)
                 t_2
                 (if (<= t_1 2e+224)
                   (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
                   (- (* t (* a -4.0)) t_1)))))))))))
assert(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 = (b * c) - t_1;
	double t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
	double t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	double tmp;
	if (t_1 <= -1e+217) {
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	} else if (t_1 <= -8e+63) {
		tmp = t_3;
	} else if (t_1 <= -2e+25) {
		tmp = t_2;
	} else if (t_1 <= -5e-18) {
		tmp = t_4;
	} else if (t_1 <= 1e-68) {
		tmp = t_3;
	} else if (t_1 <= 2e+92) {
		tmp = t_4;
	} else if (t_1 <= 2e+164) {
		tmp = t_2;
	} else if (t_1 <= 2e+224) {
		tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
	} else {
		tmp = (t * (a * -4.0)) - t_1;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = (j * 27.0d0) * k
    t_2 = (b * c) - t_1
    t_3 = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
    t_4 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
    if (t_1 <= (-1d+217)) then
        tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
    else if (t_1 <= (-8d+63)) then
        tmp = t_3
    else if (t_1 <= (-2d+25)) then
        tmp = t_2
    else if (t_1 <= (-5d-18)) then
        tmp = t_4
    else if (t_1 <= 1d-68) then
        tmp = t_3
    else if (t_1 <= 2d+92) then
        tmp = t_4
    else if (t_1 <= 2d+164) then
        tmp = t_2
    else if (t_1 <= 2d+224) then
        tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
    else
        tmp = (t * (a * (-4.0d0))) - t_1
    end if
    code = tmp
end function
assert 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 = (b * c) - t_1;
	double t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
	double t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	double tmp;
	if (t_1 <= -1e+217) {
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	} else if (t_1 <= -8e+63) {
		tmp = t_3;
	} else if (t_1 <= -2e+25) {
		tmp = t_2;
	} else if (t_1 <= -5e-18) {
		tmp = t_4;
	} else if (t_1 <= 1e-68) {
		tmp = t_3;
	} else if (t_1 <= 2e+92) {
		tmp = t_4;
	} else if (t_1 <= 2e+164) {
		tmp = t_2;
	} else if (t_1 <= 2e+224) {
		tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
	} else {
		tmp = (t * (a * -4.0)) - t_1;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * 27.0) * k
	t_2 = (b * c) - t_1
	t_3 = (b * c) + (((t * a) + (x * i)) * -4.0)
	t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0))
	tmp = 0
	if t_1 <= -1e+217:
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0)
	elif t_1 <= -8e+63:
		tmp = t_3
	elif t_1 <= -2e+25:
		tmp = t_2
	elif t_1 <= -5e-18:
		tmp = t_4
	elif t_1 <= 1e-68:
		tmp = t_3
	elif t_1 <= 2e+92:
		tmp = t_4
	elif t_1 <= 2e+164:
		tmp = t_2
	elif t_1 <= 2e+224:
		tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i))
	else:
		tmp = (t * (a * -4.0)) - t_1
	return tmp
j, k = sort([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(b * c) - t_1)
	t_3 = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0))
	t_4 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))
	tmp = 0.0
	if (t_1 <= -1e+217)
		tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0));
	elseif (t_1 <= -8e+63)
		tmp = t_3;
	elseif (t_1 <= -2e+25)
		tmp = t_2;
	elseif (t_1 <= -5e-18)
		tmp = t_4;
	elseif (t_1 <= 1e-68)
		tmp = t_3;
	elseif (t_1 <= 2e+92)
		tmp = t_4;
	elseif (t_1 <= 2e+164)
		tmp = t_2;
	elseif (t_1 <= 2e+224)
		tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)));
	else
		tmp = Float64(Float64(t * Float64(a * -4.0)) - t_1);
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * 27.0) * k;
	t_2 = (b * c) - t_1;
	t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
	t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	tmp = 0.0;
	if (t_1 <= -1e+217)
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	elseif (t_1 <= -8e+63)
		tmp = t_3;
	elseif (t_1 <= -2e+25)
		tmp = t_2;
	elseif (t_1 <= -5e-18)
		tmp = t_4;
	elseif (t_1 <= 1e-68)
		tmp = t_3;
	elseif (t_1 <= 2e+92)
		tmp = t_4;
	elseif (t_1 <= 2e+164)
		tmp = t_2;
	elseif (t_1 <= 2e+224)
		tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
	else
		tmp = (t * (a * -4.0)) - t_1;
	end
	tmp_2 = tmp;
end
NOTE: 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[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+217], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -8e+63], t$95$3, If[LessEqual[t$95$1, -2e+25], t$95$2, If[LessEqual[t$95$1, -5e-18], t$95$4, If[LessEqual[t$95$1, 1e-68], t$95$3, If[LessEqual[t$95$1, 2e+92], t$95$4, If[LessEqual[t$95$1, 2e+164], t$95$2, If[LessEqual[t$95$1, 2e+224], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
t_3 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
t_4 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\

\mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_1 \leq 10^{-68}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+164}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (*.f64 (*.f64 j 27) k) < -9.9999999999999996e216

    1. Initial program 92.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. Simplified93.0%

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*93.0%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*93.0%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*92.9%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef92.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg93.0%

        \[\leadsto \color{blue}{-\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      2. associate-*r*93.0%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(27 \cdot j\right) \cdot k}\right) \]
      3. *-commutative93.0%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      4. associate-*r*92.9%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      5. distribute-neg-in92.9%

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right) + \left(-j \cdot \left(27 \cdot k\right)\right)} \]
      6. distribute-lft-neg-in92.9%

        \[\leadsto \color{blue}{\left(-4\right) \cdot \left(i \cdot x\right)} + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      7. metadata-eval92.9%

        \[\leadsto \color{blue}{-4} \cdot \left(i \cdot x\right) + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      8. distribute-rgt-neg-in92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      9. *-commutative92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(-\color{blue}{k \cdot 27}\right) \]
      10. distribute-rgt-neg-in92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \color{blue}{\left(k \cdot \left(-27\right)\right)} \]
      11. metadata-eval92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(k \cdot \color{blue}{-27}\right) \]
    8. Simplified92.9%

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

    if -9.9999999999999996e216 < (*.f64 (*.f64 j 27) k) < -8.00000000000000046e63 or -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.00000000000000007e-68

    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 y around 0 78.4%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out78.5%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in78.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right) + b \cdot c} \]

    if -8.00000000000000046e63 < (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k) < 2e164

    1. Initial program 95.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 x around 0 95.8%

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

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

    if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18 or 1.00000000000000007e-68 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92

    1. Initial program 80.4%

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

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

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

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

    if 2e164 < (*.f64 (*.f64 j 27) k) < 1.99999999999999994e224

    1. Initial program 79.8%

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

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

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

    if 1.99999999999999994e224 < (*.f64 (*.f64 j 27) k)

    1. Initial program 71.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 0 71.0%

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} - \left(j \cdot 27\right) \cdot k \]
    4. Step-by-step derivation
      1. associate-*r*90.3%

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

      \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 6 regimes into one program.
  4. Final simplification77.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{+217}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -8 \cdot 10^{+63}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+25}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{-18}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 10^{-68}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+92}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+164}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+224}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 3: 64.0% accurate, 0.6× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ t_2 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ t_3 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\ \;\;\;\;b \cdot c - t_1\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 10^{-68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+94}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right) - t_1\\ \end{array} \end{array} \]
NOTE: 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 (+ (* b c) (* (+ (* t a) (* x i)) -4.0)))
        (t_3 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
   (if (<= t_1 -1e+217)
     (+ (* j (* k -27.0)) (* (* x i) -4.0))
     (if (<= t_1 -8e+63)
       t_2
       (if (<= t_1 -2e+25)
         (- (* b c) t_1)
         (if (<= t_1 -5e-18)
           t_3
           (if (<= t_1 1e-68)
             t_2
             (if (<= t_1 5e+94)
               t_3
               (- (* t (* (* x y) (* 18.0 z))) t_1)))))))))
assert(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 = (b * c) + (((t * a) + (x * i)) * -4.0);
	double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	double tmp;
	if (t_1 <= -1e+217) {
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	} else if (t_1 <= -8e+63) {
		tmp = t_2;
	} else if (t_1 <= -2e+25) {
		tmp = (b * c) - t_1;
	} else if (t_1 <= -5e-18) {
		tmp = t_3;
	} else if (t_1 <= 1e-68) {
		tmp = t_2;
	} else if (t_1 <= 5e+94) {
		tmp = t_3;
	} else {
		tmp = (t * ((x * y) * (18.0 * z))) - t_1;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = (j * 27.0d0) * k
    t_2 = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
    t_3 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
    if (t_1 <= (-1d+217)) then
        tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
    else if (t_1 <= (-8d+63)) then
        tmp = t_2
    else if (t_1 <= (-2d+25)) then
        tmp = (b * c) - t_1
    else if (t_1 <= (-5d-18)) then
        tmp = t_3
    else if (t_1 <= 1d-68) then
        tmp = t_2
    else if (t_1 <= 5d+94) then
        tmp = t_3
    else
        tmp = (t * ((x * y) * (18.0d0 * z))) - t_1
    end if
    code = tmp
end function
assert 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 = (b * c) + (((t * a) + (x * i)) * -4.0);
	double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	double tmp;
	if (t_1 <= -1e+217) {
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	} else if (t_1 <= -8e+63) {
		tmp = t_2;
	} else if (t_1 <= -2e+25) {
		tmp = (b * c) - t_1;
	} else if (t_1 <= -5e-18) {
		tmp = t_3;
	} else if (t_1 <= 1e-68) {
		tmp = t_2;
	} else if (t_1 <= 5e+94) {
		tmp = t_3;
	} else {
		tmp = (t * ((x * y) * (18.0 * z))) - t_1;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (j * 27.0) * k
	t_2 = (b * c) + (((t * a) + (x * i)) * -4.0)
	t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0))
	tmp = 0
	if t_1 <= -1e+217:
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0)
	elif t_1 <= -8e+63:
		tmp = t_2
	elif t_1 <= -2e+25:
		tmp = (b * c) - t_1
	elif t_1 <= -5e-18:
		tmp = t_3
	elif t_1 <= 1e-68:
		tmp = t_2
	elif t_1 <= 5e+94:
		tmp = t_3
	else:
		tmp = (t * ((x * y) * (18.0 * z))) - t_1
	return tmp
j, k = sort([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(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0))
	t_3 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))
	tmp = 0.0
	if (t_1 <= -1e+217)
		tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0));
	elseif (t_1 <= -8e+63)
		tmp = t_2;
	elseif (t_1 <= -2e+25)
		tmp = Float64(Float64(b * c) - t_1);
	elseif (t_1 <= -5e-18)
		tmp = t_3;
	elseif (t_1 <= 1e-68)
		tmp = t_2;
	elseif (t_1 <= 5e+94)
		tmp = t_3;
	else
		tmp = Float64(Float64(t * Float64(Float64(x * y) * Float64(18.0 * z))) - t_1);
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (j * 27.0) * k;
	t_2 = (b * c) + (((t * a) + (x * i)) * -4.0);
	t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
	tmp = 0.0;
	if (t_1 <= -1e+217)
		tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
	elseif (t_1 <= -8e+63)
		tmp = t_2;
	elseif (t_1 <= -2e+25)
		tmp = (b * c) - t_1;
	elseif (t_1 <= -5e-18)
		tmp = t_3;
	elseif (t_1 <= 1e-68)
		tmp = t_2;
	elseif (t_1 <= 5e+94)
		tmp = t_3;
	else
		tmp = (t * ((x * y) * (18.0 * z))) - t_1;
	end
	tmp_2 = tmp;
end
NOTE: 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[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+217], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -8e+63], t$95$2, If[LessEqual[t$95$1, -2e+25], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -5e-18], t$95$3, If[LessEqual[t$95$1, 1e-68], t$95$2, If[LessEqual[t$95$1, 5e+94], t$95$3, N[(N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
t_3 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\

\mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;b \cdot c - t_1\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_1 \leq 10^{-68}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+94}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 (*.f64 j 27) k) < -9.9999999999999996e216

    1. Initial program 92.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. Simplified93.0%

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*93.0%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*93.0%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*92.9%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef92.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg93.0%

        \[\leadsto \color{blue}{-\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      2. associate-*r*93.0%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(27 \cdot j\right) \cdot k}\right) \]
      3. *-commutative93.0%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      4. associate-*r*92.9%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      5. distribute-neg-in92.9%

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right) + \left(-j \cdot \left(27 \cdot k\right)\right)} \]
      6. distribute-lft-neg-in92.9%

        \[\leadsto \color{blue}{\left(-4\right) \cdot \left(i \cdot x\right)} + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      7. metadata-eval92.9%

        \[\leadsto \color{blue}{-4} \cdot \left(i \cdot x\right) + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      8. distribute-rgt-neg-in92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      9. *-commutative92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(-\color{blue}{k \cdot 27}\right) \]
      10. distribute-rgt-neg-in92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \color{blue}{\left(k \cdot \left(-27\right)\right)} \]
      11. metadata-eval92.9%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(k \cdot \color{blue}{-27}\right) \]
    8. Simplified92.9%

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

    if -9.9999999999999996e216 < (*.f64 (*.f64 j 27) k) < -8.00000000000000046e63 or -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.00000000000000007e-68

    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 y around 0 78.4%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out78.5%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in78.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right) + b \cdot c} \]

    if -8.00000000000000046e63 < (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25

    1. Initial program 92.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 0 99.9%

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

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

    if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18 or 1.00000000000000007e-68 < (*.f64 (*.f64 j 27) k) < 5.0000000000000001e94

    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 0 78.8%

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

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

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

    if 5.0000000000000001e94 < (*.f64 (*.f64 j 27) k)

    1. Initial program 78.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 x around 0 76.5%

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Step-by-step derivation
      1. *-commutative75.9%

        \[\leadsto \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot 18} - \left(j \cdot 27\right) \cdot k \]
      2. associate-*l*75.9%

        \[\leadsto \color{blue}{t \cdot \left(\left(x \cdot \left(y \cdot z\right)\right) \cdot 18\right)} - \left(j \cdot 27\right) \cdot k \]
      3. associate-*r*77.7%

        \[\leadsto t \cdot \left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \cdot 18\right) - \left(j \cdot 27\right) \cdot k \]
      4. associate-*l*75.7%

        \[\leadsto t \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot \left(z \cdot 18\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Simplified75.7%

      \[\leadsto \color{blue}{t \cdot \left(\left(x \cdot y\right) \cdot \left(z \cdot 18\right)\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 5 regimes into one program.
  4. Final simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{+217}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -8 \cdot 10^{+63}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+25}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{-18}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 10^{-68}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{+94}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 4: 67.0% accurate, 0.7× speedup?

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

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (*.f64 (*.f64 j 27) k) < -2e20

    1. Initial program 87.8%

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

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

    if -2e20 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18

    1. Initial program 90.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 x around 0 74.2%

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

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

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

    if -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 4.9999999999999999e-86

    1. Initial program 92.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 y around 0 80.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out80.9%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in80.9%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative80.9%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right) + b \cdot c} \]

    if 4.9999999999999999e-86 < (*.f64 (*.f64 j 27) k) < 5.00000000000000036e-18

    1. Initial program 73.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. Simplified73.8%

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

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

    if 5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102

    1. Initial program 79.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 x around 0 65.4%

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

    if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k)

    1. Initial program 77.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 0 76.0%

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Step-by-step derivation
      1. *-commutative77.4%

        \[\leadsto \color{blue}{\left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot 18} - \left(j \cdot 27\right) \cdot k \]
      2. associate-*l*77.4%

        \[\leadsto \color{blue}{t \cdot \left(\left(x \cdot \left(y \cdot z\right)\right) \cdot 18\right)} - \left(j \cdot 27\right) \cdot k \]
      3. associate-*r*79.2%

        \[\leadsto t \cdot \left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \cdot 18\right) - \left(j \cdot 27\right) \cdot k \]
      4. associate-*l*77.2%

        \[\leadsto t \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot \left(z \cdot 18\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    6. Simplified77.2%

      \[\leadsto \color{blue}{t \cdot \left(\left(x \cdot y\right) \cdot \left(z \cdot 18\right)\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 6 regimes into one program.
  4. Final simplification78.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+20}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{-18}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{-86}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 5 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+102}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 5: 80.9% accurate, 0.7× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := x \cdot \left(4 \cdot i\right)\\ t_2 := \left(b \cdot c + \left(18 \cdot \left(y \cdot z\right)\right) \cdot \left(x \cdot t\right)\right) - \left(t_1 + j \cdot \left(27 \cdot k\right)\right)\\ t_3 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+92}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - t_1\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+232}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_3\\ \end{array} \end{array} \]
NOTE: 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
         (- (+ (* b c) (* (* 18.0 (* y z)) (* x t))) (+ t_1 (* j (* 27.0 k)))))
        (t_3 (* (* j 27.0) k)))
   (if (<= t_3 -5e+33)
     t_2
     (if (<= t_3 2e+92)
       (- (+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0)))) t_1)
       (if (<= t_3 2e+232)
         t_2
         (- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_3))))))
assert(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 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
	double t_3 = (j * 27.0) * k;
	double tmp;
	if (t_3 <= -5e+33) {
		tmp = t_2;
	} else if (t_3 <= 2e+92) {
		tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
	} else if (t_3 <= 2e+232) {
		tmp = t_2;
	} else {
		tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = x * (4.0d0 * i)
    t_2 = ((b * c) + ((18.0d0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0d0 * k)))
    t_3 = (j * 27.0d0) * k
    if (t_3 <= (-5d+33)) then
        tmp = t_2
    else if (t_3 <= 2d+92) then
        tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - t_1
    else if (t_3 <= 2d+232) then
        tmp = t_2
    else
        tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_3
    end if
    code = tmp
end function
assert 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 = x * (4.0 * i);
	double t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
	double t_3 = (j * 27.0) * k;
	double tmp;
	if (t_3 <= -5e+33) {
		tmp = t_2;
	} else if (t_3 <= 2e+92) {
		tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
	} else if (t_3 <= 2e+232) {
		tmp = t_2;
	} else {
		tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = x * (4.0 * i)
	t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)))
	t_3 = (j * 27.0) * k
	tmp = 0
	if t_3 <= -5e+33:
		tmp = t_2
	elif t_3 <= 2e+92:
		tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1
	elif t_3 <= 2e+232:
		tmp = t_2
	else:
		tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(x * Float64(4.0 * i))
	t_2 = Float64(Float64(Float64(b * c) + Float64(Float64(18.0 * Float64(y * z)) * Float64(x * t))) - Float64(t_1 + Float64(j * Float64(27.0 * k))))
	t_3 = Float64(Float64(j * 27.0) * k)
	tmp = 0.0
	if (t_3 <= -5e+33)
		tmp = t_2;
	elseif (t_3 <= 2e+92)
		tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - t_1);
	elseif (t_3 <= 2e+232)
		tmp = t_2;
	else
		tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_3);
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = x * (4.0 * i);
	t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
	t_3 = (j * 27.0) * k;
	tmp = 0.0;
	if (t_3 <= -5e+33)
		tmp = t_2;
	elseif (t_3 <= 2e+92)
		tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
	elseif (t_3 <= 2e+232)
		tmp = t_2;
	else
		tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
	end
	tmp_2 = tmp;
end
NOTE: 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[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + N[(N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+33], t$95$2, If[LessEqual[t$95$3, 2e+92], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 2e+232], t$95$2, N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(4 \cdot i\right)\\
t_2 := \left(b \cdot c + \left(18 \cdot \left(y \cdot z\right)\right) \cdot \left(x \cdot t\right)\right) - \left(t_1 + j \cdot \left(27 \cdot k\right)\right)\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+33}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - t_1\\

\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+232}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j 27) k) < -4.99999999999999973e33 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k) < 2.00000000000000011e232

    1. Initial program 89.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. Simplified89.6%

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

      \[\leadsto \left(\color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} + b \cdot c\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right) \]
    4. Step-by-step derivation
      1. *-commutative85.9%

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

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

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

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

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

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

    if -4.99999999999999973e33 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92

    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. Simplified91.4%

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

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

        \[\leadsto \left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + b \cdot c\right) - \color{blue}{\left(4 \cdot i\right) \cdot x} \]
      2. *-commutative90.1%

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

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

    if 2.00000000000000011e232 < (*.f64 (*.f64 j 27) k)

    1. Initial program 70.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 x around 0 70.1%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{+33}:\\ \;\;\;\;\left(b \cdot c + \left(18 \cdot \left(y \cdot z\right)\right) \cdot \left(x \cdot t\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+92}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+232}:\\ \;\;\;\;\left(b \cdot c + \left(18 \cdot \left(y \cdot z\right)\right) \cdot \left(x \cdot t\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 6: 53.4% accurate, 0.8× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ t_3 := b \cdot c - t_2\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{+25}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{-18}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{-57}:\\ \;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+92}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: 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 (- (* b c) (* 4.0 (* t a))))
        (t_2 (* (* j 27.0) k))
        (t_3 (- (* b c) t_2)))
   (if (<= t_2 -2e+25)
     t_3
     (if (<= t_2 -5e-18)
       (* 18.0 (* t (* x (* y z))))
       (if (<= t_2 -1e-44)
         t_1
         (if (<= t_2 2e-57)
           (- (* b c) (* x (* 4.0 i)))
           (if (<= t_2 2e+92) t_1 t_3)))))))
assert(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 = (b * c) - (4.0 * (t * a));
	double t_2 = (j * 27.0) * k;
	double t_3 = (b * c) - t_2;
	double tmp;
	if (t_2 <= -2e+25) {
		tmp = t_3;
	} else if (t_2 <= -5e-18) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (t_2 <= -1e-44) {
		tmp = t_1;
	} else if (t_2 <= 2e-57) {
		tmp = (b * c) - (x * (4.0 * i));
	} else if (t_2 <= 2e+92) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = (b * c) - (4.0d0 * (t * a))
    t_2 = (j * 27.0d0) * k
    t_3 = (b * c) - t_2
    if (t_2 <= (-2d+25)) then
        tmp = t_3
    else if (t_2 <= (-5d-18)) then
        tmp = 18.0d0 * (t * (x * (y * z)))
    else if (t_2 <= (-1d-44)) then
        tmp = t_1
    else if (t_2 <= 2d-57) then
        tmp = (b * c) - (x * (4.0d0 * i))
    else if (t_2 <= 2d+92) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
assert 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 = (b * c) - (4.0 * (t * a));
	double t_2 = (j * 27.0) * k;
	double t_3 = (b * c) - t_2;
	double tmp;
	if (t_2 <= -2e+25) {
		tmp = t_3;
	} else if (t_2 <= -5e-18) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (t_2 <= -1e-44) {
		tmp = t_1;
	} else if (t_2 <= 2e-57) {
		tmp = (b * c) - (x * (4.0 * i));
	} else if (t_2 <= 2e+92) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (b * c) - (4.0 * (t * a))
	t_2 = (j * 27.0) * k
	t_3 = (b * c) - t_2
	tmp = 0
	if t_2 <= -2e+25:
		tmp = t_3
	elif t_2 <= -5e-18:
		tmp = 18.0 * (t * (x * (y * z)))
	elif t_2 <= -1e-44:
		tmp = t_1
	elif t_2 <= 2e-57:
		tmp = (b * c) - (x * (4.0 * i))
	elif t_2 <= 2e+92:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a)))
	t_2 = Float64(Float64(j * 27.0) * k)
	t_3 = Float64(Float64(b * c) - t_2)
	tmp = 0.0
	if (t_2 <= -2e+25)
		tmp = t_3;
	elseif (t_2 <= -5e-18)
		tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))));
	elseif (t_2 <= -1e-44)
		tmp = t_1;
	elseif (t_2 <= 2e-57)
		tmp = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)));
	elseif (t_2 <= 2e+92)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (b * c) - (4.0 * (t * a));
	t_2 = (j * 27.0) * k;
	t_3 = (b * c) - t_2;
	tmp = 0.0;
	if (t_2 <= -2e+25)
		tmp = t_3;
	elseif (t_2 <= -5e-18)
		tmp = 18.0 * (t * (x * (y * z)));
	elseif (t_2 <= -1e-44)
		tmp = t_1;
	elseif (t_2 <= 2e-57)
		tmp = (b * c) - (x * (4.0 * i));
	elseif (t_2 <= 2e+92)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: 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[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+25], t$95$3, If[LessEqual[t$95$2, -5e-18], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-44], t$95$1, If[LessEqual[t$95$2, 2e-57], N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+92], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := b \cdot c - t_2\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-44}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k)

    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 x around 0 81.7%

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

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

    if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18

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

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

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

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

    if -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < -9.99999999999999953e-45 or 1.99999999999999991e-57 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92

    1. Initial program 80.4%

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

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

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

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

    if -9.99999999999999953e-45 < (*.f64 (*.f64 j 27) k) < 1.99999999999999991e-57

    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. Simplified93.4%

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*55.7%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*55.7%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*55.7%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef55.7%

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

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

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

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

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

      \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(i \cdot x\right)} \]
    7. Step-by-step derivation
      1. associate-*r*53.7%

        \[\leadsto b \cdot c - \color{blue}{\left(4 \cdot i\right) \cdot x} \]
      2. *-commutative53.7%

        \[\leadsto b \cdot c - \color{blue}{x \cdot \left(4 \cdot i\right)} \]
      3. *-commutative53.7%

        \[\leadsto b \cdot c - x \cdot \color{blue}{\left(i \cdot 4\right)} \]
    8. Simplified53.7%

      \[\leadsto b \cdot c - \color{blue}{x \cdot \left(i \cdot 4\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -2 \cdot 10^{+25}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{-18}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq -1 \cdot 10^{-44}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{-57}:\\ \;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+92}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 7: 86.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 j 27) < -1.00000000000000002e-91

    1. Initial program 92.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. Simplified89.3%

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

    if -1.00000000000000002e-91 < (*.f64 j 27) < 2.0000000000000001e76

    1. Initial program 87.0%

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

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

    if 2.0000000000000001e76 < (*.f64 j 27)

    1. Initial program 76.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. Simplified84.2%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative47.0%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*47.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \cdot 27 \leq -1 \cdot 10^{-91}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{elif}\;j \cdot 27 \leq 2 \cdot 10^{+76}:\\ \;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 8: 79.0% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j 27) k) < -4.99999999999999973e33

    1. Initial program 88.9%

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

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

    if -4.99999999999999973e33 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102

    1. Initial program 88.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 x around 0 91.0%

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

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

    if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k)

    1. Initial program 77.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 0 76.0%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -5 \cdot 10^{+33}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+102}:\\ \;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 9: 79.1% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j 27) k) < -3.99999999999999988e224

    1. Initial program 92.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. Simplified92.4%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative96.1%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*96.0%

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

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

    if -3.99999999999999988e224 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102

    1. Initial program 88.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. Simplified91.2%

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

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

        \[\leadsto \left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + b \cdot c\right) - \color{blue}{\left(4 \cdot i\right) \cdot x} \]
      2. *-commutative86.5%

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

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

    if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k)

    1. Initial program 77.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 0 76.0%

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -4 \cdot 10^{+224}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+102}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 10: 78.9% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 j 27) k) < -3.99999999999999988e224

    1. Initial program 92.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. Simplified92.4%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative96.1%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*96.0%

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

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

    if -3.99999999999999988e224 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102

    1. Initial program 88.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. Simplified91.2%

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

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

        \[\leadsto \left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + b \cdot c\right) - \color{blue}{\left(4 \cdot i\right) \cdot x} \]
      2. *-commutative86.5%

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

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

    if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k)

    1. Initial program 77.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 t around -inf 79.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)\right)} - \left(j \cdot 27\right) \cdot k \]
    3. Step-by-step derivation
      1. associate-*r*79.4%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right)} - \left(j \cdot 27\right) \cdot k \]
      2. neg-mul-179.4%

        \[\leadsto \color{blue}{\left(-t\right)} \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - -4 \cdot a\right) - \left(j \cdot 27\right) \cdot k \]
      3. cancel-sign-sub-inv79.4%

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

        \[\leadsto \left(-t\right) \cdot \left(\color{blue}{\left(x \cdot \left(y \cdot z\right)\right) \cdot -18} + \left(--4\right) \cdot a\right) - \left(j \cdot 27\right) \cdot k \]
      5. metadata-eval79.4%

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

      \[\leadsto \color{blue}{\left(-t\right) \cdot \left(\left(x \cdot \left(y \cdot z\right)\right) \cdot -18 + 4 \cdot a\right)} - \left(j \cdot 27\right) \cdot k \]
    5. Step-by-step derivation
      1. distribute-rgt-in79.4%

        \[\leadsto \color{blue}{\left(\left(\left(x \cdot \left(y \cdot z\right)\right) \cdot -18\right) \cdot \left(-t\right) + \left(4 \cdot a\right) \cdot \left(-t\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. associate-*r*81.2%

        \[\leadsto \left(\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \cdot -18\right) \cdot \left(-t\right) + \left(4 \cdot a\right) \cdot \left(-t\right)\right) - \left(j \cdot 27\right) \cdot k \]
    6. Applied egg-rr81.2%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot y\right) \cdot z\right) \cdot -18\right) \cdot \left(-t\right) + \left(4 \cdot a\right) \cdot \left(-t\right)\right)} - \left(j \cdot 27\right) \cdot k \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq -4 \cdot 10^{+224}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+102}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(\left(z \cdot \left(x \cdot y\right)\right) \cdot \left(--18\right)\right) - t \cdot \left(a \cdot 4\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 11: 86.8% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 j 27) k) < 2e295

    1. Initial program 89.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. Simplified91.0%

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

    if 2e295 < (*.f64 (*.f64 j 27) k)

    1. Initial program 62.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. Simplified66.7%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative87.9%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*87.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+295}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 12: 32.7% accurate, 1.1× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ t_2 := t \cdot \left(a \cdot -4\right)\\ t_3 := j \cdot \left(k \cdot -27\right)\\ t_4 := \left(x \cdot i\right) \cdot -4\\ \mathbf{if}\;j \leq -1.4 \cdot 10^{+55}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -1.85 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -1.35 \cdot 10^{-182}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;j \leq -5.8 \cdot 10^{-207}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -8 \cdot 10^{-243}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 4 \cdot 10^{-306}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;j \leq 1.4 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: 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 (* 18.0 (* t (* x (* y z)))))
        (t_2 (* t (* a -4.0)))
        (t_3 (* j (* k -27.0)))
        (t_4 (* (* x i) -4.0)))
   (if (<= j -1.4e+55)
     t_3
     (if (<= j -1.4e+29)
       t_2
       (if (<= j -1.85e-31)
         (* b c)
         (if (<= j -8.2e-126)
           t_1
           (if (<= j -1.35e-182)
             t_4
             (if (<= j -5.8e-207)
               t_2
               (if (<= j -8e-243)
                 t_1
                 (if (<= j 4e-306) t_4 (if (<= j 1.4e+85) t_1 t_3)))))))))))
assert(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 = 18.0 * (t * (x * (y * z)));
	double t_2 = t * (a * -4.0);
	double t_3 = j * (k * -27.0);
	double t_4 = (x * i) * -4.0;
	double tmp;
	if (j <= -1.4e+55) {
		tmp = t_3;
	} else if (j <= -1.4e+29) {
		tmp = t_2;
	} else if (j <= -1.85e-31) {
		tmp = b * c;
	} else if (j <= -8.2e-126) {
		tmp = t_1;
	} else if (j <= -1.35e-182) {
		tmp = t_4;
	} else if (j <= -5.8e-207) {
		tmp = t_2;
	} else if (j <= -8e-243) {
		tmp = t_1;
	} else if (j <= 4e-306) {
		tmp = t_4;
	} else if (j <= 1.4e+85) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = 18.0d0 * (t * (x * (y * z)))
    t_2 = t * (a * (-4.0d0))
    t_3 = j * (k * (-27.0d0))
    t_4 = (x * i) * (-4.0d0)
    if (j <= (-1.4d+55)) then
        tmp = t_3
    else if (j <= (-1.4d+29)) then
        tmp = t_2
    else if (j <= (-1.85d-31)) then
        tmp = b * c
    else if (j <= (-8.2d-126)) then
        tmp = t_1
    else if (j <= (-1.35d-182)) then
        tmp = t_4
    else if (j <= (-5.8d-207)) then
        tmp = t_2
    else if (j <= (-8d-243)) then
        tmp = t_1
    else if (j <= 4d-306) then
        tmp = t_4
    else if (j <= 1.4d+85) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
assert 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 = 18.0 * (t * (x * (y * z)));
	double t_2 = t * (a * -4.0);
	double t_3 = j * (k * -27.0);
	double t_4 = (x * i) * -4.0;
	double tmp;
	if (j <= -1.4e+55) {
		tmp = t_3;
	} else if (j <= -1.4e+29) {
		tmp = t_2;
	} else if (j <= -1.85e-31) {
		tmp = b * c;
	} else if (j <= -8.2e-126) {
		tmp = t_1;
	} else if (j <= -1.35e-182) {
		tmp = t_4;
	} else if (j <= -5.8e-207) {
		tmp = t_2;
	} else if (j <= -8e-243) {
		tmp = t_1;
	} else if (j <= 4e-306) {
		tmp = t_4;
	} else if (j <= 1.4e+85) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = 18.0 * (t * (x * (y * z)))
	t_2 = t * (a * -4.0)
	t_3 = j * (k * -27.0)
	t_4 = (x * i) * -4.0
	tmp = 0
	if j <= -1.4e+55:
		tmp = t_3
	elif j <= -1.4e+29:
		tmp = t_2
	elif j <= -1.85e-31:
		tmp = b * c
	elif j <= -8.2e-126:
		tmp = t_1
	elif j <= -1.35e-182:
		tmp = t_4
	elif j <= -5.8e-207:
		tmp = t_2
	elif j <= -8e-243:
		tmp = t_1
	elif j <= 4e-306:
		tmp = t_4
	elif j <= 1.4e+85:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))
	t_2 = Float64(t * Float64(a * -4.0))
	t_3 = Float64(j * Float64(k * -27.0))
	t_4 = Float64(Float64(x * i) * -4.0)
	tmp = 0.0
	if (j <= -1.4e+55)
		tmp = t_3;
	elseif (j <= -1.4e+29)
		tmp = t_2;
	elseif (j <= -1.85e-31)
		tmp = Float64(b * c);
	elseif (j <= -8.2e-126)
		tmp = t_1;
	elseif (j <= -1.35e-182)
		tmp = t_4;
	elseif (j <= -5.8e-207)
		tmp = t_2;
	elseif (j <= -8e-243)
		tmp = t_1;
	elseif (j <= 4e-306)
		tmp = t_4;
	elseif (j <= 1.4e+85)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = 18.0 * (t * (x * (y * z)));
	t_2 = t * (a * -4.0);
	t_3 = j * (k * -27.0);
	t_4 = (x * i) * -4.0;
	tmp = 0.0;
	if (j <= -1.4e+55)
		tmp = t_3;
	elseif (j <= -1.4e+29)
		tmp = t_2;
	elseif (j <= -1.85e-31)
		tmp = b * c;
	elseif (j <= -8.2e-126)
		tmp = t_1;
	elseif (j <= -1.35e-182)
		tmp = t_4;
	elseif (j <= -5.8e-207)
		tmp = t_2;
	elseif (j <= -8e-243)
		tmp = t_1;
	elseif (j <= 4e-306)
		tmp = t_4;
	elseif (j <= 1.4e+85)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: 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[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -1.4e+55], t$95$3, If[LessEqual[j, -1.4e+29], t$95$2, If[LessEqual[j, -1.85e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -8.2e-126], t$95$1, If[LessEqual[j, -1.35e-182], t$95$4, If[LessEqual[j, -5.8e-207], t$95$2, If[LessEqual[j, -8e-243], t$95$1, If[LessEqual[j, 4e-306], t$95$4, If[LessEqual[j, 1.4e+85], t$95$1, t$95$3]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -1.4 \cdot 10^{+55}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -1.85 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -1.35 \cdot 10^{-182}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;j \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -8 \cdot 10^{-243}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq 4 \cdot 10^{-306}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;j \leq 1.4 \cdot 10^{+85}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if j < -1.4e55 or 1.4e85 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*51.6%

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

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

    if -1.4e55 < j < -1.4e29 or -1.35e-182 < j < -5.80000000000000022e-207

    1. Initial program 99.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 y around 0 90.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out90.3%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in90.3%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative90.3%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*56.9%

        \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} \]
    7. Simplified56.9%

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

    if -1.4e29 < j < -1.8499999999999999e-31

    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. Simplified83.9%

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

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

    if -1.8499999999999999e-31 < j < -8.1999999999999995e-126 or -5.80000000000000022e-207 < j < -7.99999999999999996e-243 or 4.00000000000000011e-306 < j < 1.4e85

    1. Initial program 88.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. Simplified91.7%

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

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

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

    if -8.1999999999999995e-126 < j < -1.35e-182 or -7.99999999999999996e-243 < j < 4.00000000000000011e-306

    1. Initial program 85.9%

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative53.5%

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

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -1.4 \cdot 10^{+55}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -1.85 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -1.35 \cdot 10^{-182}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq -5.8 \cdot 10^{-207}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -8 \cdot 10^{-243}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 4 \cdot 10^{-306}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 1.4 \cdot 10^{+85}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 13: 32.7% accurate, 1.1× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := 18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ t_2 := t \cdot \left(a \cdot -4\right)\\ t_3 := j \cdot \left(k \cdot -27\right)\\ t_4 := \left(x \cdot i\right) \cdot -4\\ \mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -2.9 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -9 \cdot 10^{-126}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -6.6 \cdot 10^{-183}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;j \leq -6 \cdot 10^{-207}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 6.3 \cdot 10^{-307}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;j \leq 2 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: 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 (* 18.0 (* (* y z) (* x t))))
        (t_2 (* t (* a -4.0)))
        (t_3 (* j (* k -27.0)))
        (t_4 (* (* x i) -4.0)))
   (if (<= j -4.2e+50)
     t_3
     (if (<= j -3e+29)
       t_2
       (if (<= j -2.9e-31)
         (* b c)
         (if (<= j -9e-126)
           t_1
           (if (<= j -6.6e-183)
             t_4
             (if (<= j -6e-207)
               t_2
               (if (<= j -5.2e-243)
                 (* 18.0 (* t (* x (* y z))))
                 (if (<= j 6.3e-307) t_4 (if (<= j 2e+80) t_1 t_3)))))))))))
assert(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 = 18.0 * ((y * z) * (x * t));
	double t_2 = t * (a * -4.0);
	double t_3 = j * (k * -27.0);
	double t_4 = (x * i) * -4.0;
	double tmp;
	if (j <= -4.2e+50) {
		tmp = t_3;
	} else if (j <= -3e+29) {
		tmp = t_2;
	} else if (j <= -2.9e-31) {
		tmp = b * c;
	} else if (j <= -9e-126) {
		tmp = t_1;
	} else if (j <= -6.6e-183) {
		tmp = t_4;
	} else if (j <= -6e-207) {
		tmp = t_2;
	} else if (j <= -5.2e-243) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (j <= 6.3e-307) {
		tmp = t_4;
	} else if (j <= 2e+80) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = 18.0d0 * ((y * z) * (x * t))
    t_2 = t * (a * (-4.0d0))
    t_3 = j * (k * (-27.0d0))
    t_4 = (x * i) * (-4.0d0)
    if (j <= (-4.2d+50)) then
        tmp = t_3
    else if (j <= (-3d+29)) then
        tmp = t_2
    else if (j <= (-2.9d-31)) then
        tmp = b * c
    else if (j <= (-9d-126)) then
        tmp = t_1
    else if (j <= (-6.6d-183)) then
        tmp = t_4
    else if (j <= (-6d-207)) then
        tmp = t_2
    else if (j <= (-5.2d-243)) then
        tmp = 18.0d0 * (t * (x * (y * z)))
    else if (j <= 6.3d-307) then
        tmp = t_4
    else if (j <= 2d+80) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
assert 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 = 18.0 * ((y * z) * (x * t));
	double t_2 = t * (a * -4.0);
	double t_3 = j * (k * -27.0);
	double t_4 = (x * i) * -4.0;
	double tmp;
	if (j <= -4.2e+50) {
		tmp = t_3;
	} else if (j <= -3e+29) {
		tmp = t_2;
	} else if (j <= -2.9e-31) {
		tmp = b * c;
	} else if (j <= -9e-126) {
		tmp = t_1;
	} else if (j <= -6.6e-183) {
		tmp = t_4;
	} else if (j <= -6e-207) {
		tmp = t_2;
	} else if (j <= -5.2e-243) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (j <= 6.3e-307) {
		tmp = t_4;
	} else if (j <= 2e+80) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = 18.0 * ((y * z) * (x * t))
	t_2 = t * (a * -4.0)
	t_3 = j * (k * -27.0)
	t_4 = (x * i) * -4.0
	tmp = 0
	if j <= -4.2e+50:
		tmp = t_3
	elif j <= -3e+29:
		tmp = t_2
	elif j <= -2.9e-31:
		tmp = b * c
	elif j <= -9e-126:
		tmp = t_1
	elif j <= -6.6e-183:
		tmp = t_4
	elif j <= -6e-207:
		tmp = t_2
	elif j <= -5.2e-243:
		tmp = 18.0 * (t * (x * (y * z)))
	elif j <= 6.3e-307:
		tmp = t_4
	elif j <= 2e+80:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)))
	t_2 = Float64(t * Float64(a * -4.0))
	t_3 = Float64(j * Float64(k * -27.0))
	t_4 = Float64(Float64(x * i) * -4.0)
	tmp = 0.0
	if (j <= -4.2e+50)
		tmp = t_3;
	elseif (j <= -3e+29)
		tmp = t_2;
	elseif (j <= -2.9e-31)
		tmp = Float64(b * c);
	elseif (j <= -9e-126)
		tmp = t_1;
	elseif (j <= -6.6e-183)
		tmp = t_4;
	elseif (j <= -6e-207)
		tmp = t_2;
	elseif (j <= -5.2e-243)
		tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))));
	elseif (j <= 6.3e-307)
		tmp = t_4;
	elseif (j <= 2e+80)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = 18.0 * ((y * z) * (x * t));
	t_2 = t * (a * -4.0);
	t_3 = j * (k * -27.0);
	t_4 = (x * i) * -4.0;
	tmp = 0.0;
	if (j <= -4.2e+50)
		tmp = t_3;
	elseif (j <= -3e+29)
		tmp = t_2;
	elseif (j <= -2.9e-31)
		tmp = b * c;
	elseif (j <= -9e-126)
		tmp = t_1;
	elseif (j <= -6.6e-183)
		tmp = t_4;
	elseif (j <= -6e-207)
		tmp = t_2;
	elseif (j <= -5.2e-243)
		tmp = 18.0 * (t * (x * (y * z)));
	elseif (j <= 6.3e-307)
		tmp = t_4;
	elseif (j <= 2e+80)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: 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[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -4.2e+50], t$95$3, If[LessEqual[j, -3e+29], t$95$2, If[LessEqual[j, -2.9e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -9e-126], t$95$1, If[LessEqual[j, -6.6e-183], t$95$4, If[LessEqual[j, -6e-207], t$95$2, If[LessEqual[j, -5.2e-243], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.3e-307], t$95$4, If[LessEqual[j, 2e+80], t$95$1, t$95$3]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -2.9 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -9 \cdot 10^{-126}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -6.6 \cdot 10^{-183}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;j \leq -6 \cdot 10^{-207}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq 6.3 \cdot 10^{-307}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;j \leq 2 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if j < -4.1999999999999999e50 or 2e80 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*51.6%

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

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

    if -4.1999999999999999e50 < j < -2.9999999999999999e29 or -6.5999999999999999e-183 < j < -5.9999999999999999e-207

    1. Initial program 99.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 y around 0 90.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out90.3%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in90.3%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative90.3%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*56.9%

        \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} \]
    7. Simplified56.9%

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

    if -2.9999999999999999e29 < j < -2.9000000000000001e-31

    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. Simplified83.9%

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

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

    if -2.9000000000000001e-31 < j < -9.0000000000000005e-126 or 6.3000000000000003e-307 < j < 2e80

    1. Initial program 89.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 x around 0 91.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 35.0%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*36.8%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified36.8%

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

    if -9.0000000000000005e-126 < j < -6.5999999999999999e-183 or -5.1999999999999995e-243 < j < 6.3000000000000003e-307

    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. Simplified85.2%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.2%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified51.2%

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

    if -5.9999999999999999e-207 < j < -5.1999999999999995e-243

    1. Initial program 80.1%

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

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -2.9 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -9 \cdot 10^{-126}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;j \leq -6.6 \cdot 10^{-183}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq -6 \cdot 10^{-207}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 6.3 \cdot 10^{-307}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 2 \cdot 10^{+80}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 14: 32.8% accurate, 1.1× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := j \cdot \left(k \cdot -27\right)\\ t_3 := \left(x \cdot i\right) \cdot -4\\ \mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -1.45 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -2.3 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -3.1 \cdot 10^{-183}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq -4.9 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -5.5 \cdot 10^{-243}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 3.2 \cdot 10^{-306}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq 5.8 \cdot 10^{+76}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: 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 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
   (if (<= j -4.2e+50)
     t_2
     (if (<= j -1.45e+29)
       t_1
       (if (<= j -2.3e-31)
         (* b c)
         (if (<= j -7.5e-126)
           (* t (* 18.0 (* y (* x z))))
           (if (<= j -3.1e-183)
             t_3
             (if (<= j -4.9e-207)
               t_1
               (if (<= j -5.5e-243)
                 (* 18.0 (* t (* x (* y z))))
                 (if (<= j 3.2e-306)
                   t_3
                   (if (<= j 5.8e+76)
                     (* 18.0 (* (* y z) (* x t)))
                     t_2)))))))))))
assert(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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -4.2e+50) {
		tmp = t_2;
	} else if (j <= -1.45e+29) {
		tmp = t_1;
	} else if (j <= -2.3e-31) {
		tmp = b * c;
	} else if (j <= -7.5e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -3.1e-183) {
		tmp = t_3;
	} else if (j <= -4.9e-207) {
		tmp = t_1;
	} else if (j <= -5.5e-243) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (j <= 3.2e-306) {
		tmp = t_3;
	} else if (j <= 5.8e+76) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = t * (a * (-4.0d0))
    t_2 = j * (k * (-27.0d0))
    t_3 = (x * i) * (-4.0d0)
    if (j <= (-4.2d+50)) then
        tmp = t_2
    else if (j <= (-1.45d+29)) then
        tmp = t_1
    else if (j <= (-2.3d-31)) then
        tmp = b * c
    else if (j <= (-7.5d-126)) then
        tmp = t * (18.0d0 * (y * (x * z)))
    else if (j <= (-3.1d-183)) then
        tmp = t_3
    else if (j <= (-4.9d-207)) then
        tmp = t_1
    else if (j <= (-5.5d-243)) then
        tmp = 18.0d0 * (t * (x * (y * z)))
    else if (j <= 3.2d-306) then
        tmp = t_3
    else if (j <= 5.8d+76) then
        tmp = 18.0d0 * ((y * z) * (x * t))
    else
        tmp = t_2
    end if
    code = tmp
end function
assert 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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -4.2e+50) {
		tmp = t_2;
	} else if (j <= -1.45e+29) {
		tmp = t_1;
	} else if (j <= -2.3e-31) {
		tmp = b * c;
	} else if (j <= -7.5e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -3.1e-183) {
		tmp = t_3;
	} else if (j <= -4.9e-207) {
		tmp = t_1;
	} else if (j <= -5.5e-243) {
		tmp = 18.0 * (t * (x * (y * z)));
	} else if (j <= 3.2e-306) {
		tmp = t_3;
	} else if (j <= 5.8e+76) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = t * (a * -4.0)
	t_2 = j * (k * -27.0)
	t_3 = (x * i) * -4.0
	tmp = 0
	if j <= -4.2e+50:
		tmp = t_2
	elif j <= -1.45e+29:
		tmp = t_1
	elif j <= -2.3e-31:
		tmp = b * c
	elif j <= -7.5e-126:
		tmp = t * (18.0 * (y * (x * z)))
	elif j <= -3.1e-183:
		tmp = t_3
	elif j <= -4.9e-207:
		tmp = t_1
	elif j <= -5.5e-243:
		tmp = 18.0 * (t * (x * (y * z)))
	elif j <= 3.2e-306:
		tmp = t_3
	elif j <= 5.8e+76:
		tmp = 18.0 * ((y * z) * (x * t))
	else:
		tmp = t_2
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * Float64(a * -4.0))
	t_2 = Float64(j * Float64(k * -27.0))
	t_3 = Float64(Float64(x * i) * -4.0)
	tmp = 0.0
	if (j <= -4.2e+50)
		tmp = t_2;
	elseif (j <= -1.45e+29)
		tmp = t_1;
	elseif (j <= -2.3e-31)
		tmp = Float64(b * c);
	elseif (j <= -7.5e-126)
		tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z))));
	elseif (j <= -3.1e-183)
		tmp = t_3;
	elseif (j <= -4.9e-207)
		tmp = t_1;
	elseif (j <= -5.5e-243)
		tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z))));
	elseif (j <= 3.2e-306)
		tmp = t_3;
	elseif (j <= 5.8e+76)
		tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)));
	else
		tmp = t_2;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = t * (a * -4.0);
	t_2 = j * (k * -27.0);
	t_3 = (x * i) * -4.0;
	tmp = 0.0;
	if (j <= -4.2e+50)
		tmp = t_2;
	elseif (j <= -1.45e+29)
		tmp = t_1;
	elseif (j <= -2.3e-31)
		tmp = b * c;
	elseif (j <= -7.5e-126)
		tmp = t * (18.0 * (y * (x * z)));
	elseif (j <= -3.1e-183)
		tmp = t_3;
	elseif (j <= -4.9e-207)
		tmp = t_1;
	elseif (j <= -5.5e-243)
		tmp = 18.0 * (t * (x * (y * z)));
	elseif (j <= 3.2e-306)
		tmp = t_3;
	elseif (j <= 5.8e+76)
		tmp = 18.0 * ((y * z) * (x * t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: 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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -4.2e+50], t$95$2, If[LessEqual[j, -1.45e+29], t$95$1, If[LessEqual[j, -2.3e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -7.5e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.1e-183], t$95$3, If[LessEqual[j, -4.9e-207], t$95$1, If[LessEqual[j, -5.5e-243], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.2e-306], t$95$3, If[LessEqual[j, 5.8e+76], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -1.45 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -2.3 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq -3.1 \cdot 10^{-183}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq -4.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -5.5 \cdot 10^{-243}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq 3.2 \cdot 10^{-306}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq 5.8 \cdot 10^{+76}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if j < -4.1999999999999999e50 or 5.8000000000000003e76 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*51.6%

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

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

    if -4.1999999999999999e50 < j < -1.45e29 or -3.1e-183 < j < -4.9e-207

    1. Initial program 99.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 y around 0 90.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out90.3%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in90.3%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative90.3%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*56.9%

        \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} \]
    7. Simplified56.9%

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

    if -1.45e29 < j < -2.2999999999999998e-31

    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. Simplified83.9%

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

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

    if -2.2999999999999998e-31 < j < -7.49999999999999976e-126

    1. Initial program 93.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 0 74.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 34.6%

      \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative34.6%

        \[\leadsto t \cdot \left(18 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot x\right)}\right) \]
      2. associate-*l*34.6%

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

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

    if -7.49999999999999976e-126 < j < -3.1e-183 or -5.50000000000000004e-243 < j < 3.19999999999999971e-306

    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. Simplified85.2%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.2%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified51.2%

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

    if -4.9e-207 < j < -5.50000000000000004e-243

    1. Initial program 80.1%

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

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

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

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

    if 3.19999999999999971e-306 < j < 5.8000000000000003e76

    1. Initial program 88.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 x around 0 94.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 35.0%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*37.2%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified37.2%

      \[\leadsto \color{blue}{18 \cdot \left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -1.45 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -2.3 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -3.1 \cdot 10^{-183}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq -4.9 \cdot 10^{-207}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -5.5 \cdot 10^{-243}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 3.2 \cdot 10^{-306}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 5.8 \cdot 10^{+76}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 15: 32.8% accurate, 1.1× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := j \cdot \left(k \cdot -27\right)\\ t_3 := \left(x \cdot i\right) \cdot -4\\ \mathbf{if}\;j \leq -1.8 \cdot 10^{+55}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -2.5 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -2.3 \cdot 10^{-183}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq -2.9 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\ \mathbf{elif}\;j \leq 6.2 \cdot 10^{-307}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq 1.45 \cdot 10^{+77}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: 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 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
   (if (<= j -1.8e+55)
     t_2
     (if (<= j -3e+29)
       t_1
       (if (<= j -2.5e-31)
         (* b c)
         (if (<= j -8.2e-126)
           (* t (* 18.0 (* y (* x z))))
           (if (<= j -2.3e-183)
             t_3
             (if (<= j -2.9e-207)
               t_1
               (if (<= j -5.2e-243)
                 (* (* x (* y z)) (* 18.0 t))
                 (if (<= j 6.2e-307)
                   t_3
                   (if (<= j 1.45e+77)
                     (* 18.0 (* (* y z) (* x t)))
                     t_2)))))))))))
assert(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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -1.8e+55) {
		tmp = t_2;
	} else if (j <= -3e+29) {
		tmp = t_1;
	} else if (j <= -2.5e-31) {
		tmp = b * c;
	} else if (j <= -8.2e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -2.3e-183) {
		tmp = t_3;
	} else if (j <= -2.9e-207) {
		tmp = t_1;
	} else if (j <= -5.2e-243) {
		tmp = (x * (y * z)) * (18.0 * t);
	} else if (j <= 6.2e-307) {
		tmp = t_3;
	} else if (j <= 1.45e+77) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = t * (a * (-4.0d0))
    t_2 = j * (k * (-27.0d0))
    t_3 = (x * i) * (-4.0d0)
    if (j <= (-1.8d+55)) then
        tmp = t_2
    else if (j <= (-3d+29)) then
        tmp = t_1
    else if (j <= (-2.5d-31)) then
        tmp = b * c
    else if (j <= (-8.2d-126)) then
        tmp = t * (18.0d0 * (y * (x * z)))
    else if (j <= (-2.3d-183)) then
        tmp = t_3
    else if (j <= (-2.9d-207)) then
        tmp = t_1
    else if (j <= (-5.2d-243)) then
        tmp = (x * (y * z)) * (18.0d0 * t)
    else if (j <= 6.2d-307) then
        tmp = t_3
    else if (j <= 1.45d+77) then
        tmp = 18.0d0 * ((y * z) * (x * t))
    else
        tmp = t_2
    end if
    code = tmp
end function
assert 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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -1.8e+55) {
		tmp = t_2;
	} else if (j <= -3e+29) {
		tmp = t_1;
	} else if (j <= -2.5e-31) {
		tmp = b * c;
	} else if (j <= -8.2e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -2.3e-183) {
		tmp = t_3;
	} else if (j <= -2.9e-207) {
		tmp = t_1;
	} else if (j <= -5.2e-243) {
		tmp = (x * (y * z)) * (18.0 * t);
	} else if (j <= 6.2e-307) {
		tmp = t_3;
	} else if (j <= 1.45e+77) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = t * (a * -4.0)
	t_2 = j * (k * -27.0)
	t_3 = (x * i) * -4.0
	tmp = 0
	if j <= -1.8e+55:
		tmp = t_2
	elif j <= -3e+29:
		tmp = t_1
	elif j <= -2.5e-31:
		tmp = b * c
	elif j <= -8.2e-126:
		tmp = t * (18.0 * (y * (x * z)))
	elif j <= -2.3e-183:
		tmp = t_3
	elif j <= -2.9e-207:
		tmp = t_1
	elif j <= -5.2e-243:
		tmp = (x * (y * z)) * (18.0 * t)
	elif j <= 6.2e-307:
		tmp = t_3
	elif j <= 1.45e+77:
		tmp = 18.0 * ((y * z) * (x * t))
	else:
		tmp = t_2
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * Float64(a * -4.0))
	t_2 = Float64(j * Float64(k * -27.0))
	t_3 = Float64(Float64(x * i) * -4.0)
	tmp = 0.0
	if (j <= -1.8e+55)
		tmp = t_2;
	elseif (j <= -3e+29)
		tmp = t_1;
	elseif (j <= -2.5e-31)
		tmp = Float64(b * c);
	elseif (j <= -8.2e-126)
		tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z))));
	elseif (j <= -2.3e-183)
		tmp = t_3;
	elseif (j <= -2.9e-207)
		tmp = t_1;
	elseif (j <= -5.2e-243)
		tmp = Float64(Float64(x * Float64(y * z)) * Float64(18.0 * t));
	elseif (j <= 6.2e-307)
		tmp = t_3;
	elseif (j <= 1.45e+77)
		tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)));
	else
		tmp = t_2;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = t * (a * -4.0);
	t_2 = j * (k * -27.0);
	t_3 = (x * i) * -4.0;
	tmp = 0.0;
	if (j <= -1.8e+55)
		tmp = t_2;
	elseif (j <= -3e+29)
		tmp = t_1;
	elseif (j <= -2.5e-31)
		tmp = b * c;
	elseif (j <= -8.2e-126)
		tmp = t * (18.0 * (y * (x * z)));
	elseif (j <= -2.3e-183)
		tmp = t_3;
	elseif (j <= -2.9e-207)
		tmp = t_1;
	elseif (j <= -5.2e-243)
		tmp = (x * (y * z)) * (18.0 * t);
	elseif (j <= 6.2e-307)
		tmp = t_3;
	elseif (j <= 1.45e+77)
		tmp = 18.0 * ((y * z) * (x * t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: 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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -1.8e+55], t$95$2, If[LessEqual[j, -3e+29], t$95$1, If[LessEqual[j, -2.5e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -8.2e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -2.3e-183], t$95$3, If[LessEqual[j, -2.9e-207], t$95$1, If[LessEqual[j, -5.2e-243], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.2e-307], t$95$3, If[LessEqual[j, 1.45e+77], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -1.8 \cdot 10^{+55}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -2.5 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq -2.3 \cdot 10^{-183}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq -2.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\

\mathbf{elif}\;j \leq 6.2 \cdot 10^{-307}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq 1.45 \cdot 10^{+77}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if j < -1.79999999999999994e55 or 1.4500000000000001e77 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*51.6%

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

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

    if -1.79999999999999994e55 < j < -2.9999999999999999e29 or -2.30000000000000016e-183 < j < -2.90000000000000011e-207

    1. Initial program 99.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 y around 0 90.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out90.3%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in90.3%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative90.3%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*56.9%

        \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} \]
    7. Simplified56.9%

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

    if -2.9999999999999999e29 < j < -2.5e-31

    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. Simplified83.9%

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

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

    if -2.5e-31 < j < -8.1999999999999995e-126

    1. Initial program 93.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 0 74.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 34.6%

      \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative34.6%

        \[\leadsto t \cdot \left(18 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot x\right)}\right) \]
      2. associate-*l*34.6%

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

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

    if -8.1999999999999995e-126 < j < -2.30000000000000016e-183 or -5.1999999999999995e-243 < j < 6.1999999999999996e-307

    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. Simplified85.2%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.2%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified51.2%

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

    if -2.90000000000000011e-207 < j < -5.1999999999999995e-243

    1. Initial program 80.1%

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

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*57.8%

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

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

    if 6.1999999999999996e-307 < j < 1.4500000000000001e77

    1. Initial program 88.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 x around 0 94.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 35.0%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*37.2%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified37.2%

      \[\leadsto \color{blue}{18 \cdot \left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -1.8 \cdot 10^{+55}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -2.5 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -2.3 \cdot 10^{-183}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq -2.9 \cdot 10^{-207}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\ \mathbf{elif}\;j \leq 6.2 \cdot 10^{-307}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 1.45 \cdot 10^{+77}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 16: 32.8% accurate, 1.1× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := j \cdot \left(k \cdot -27\right)\\ t_3 := \left(x \cdot i\right) \cdot -4\\ \mathbf{if}\;j \leq -7.5 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -1.8 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -2.7 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -3.8 \cdot 10^{-183}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq -3.9 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -6 \cdot 10^{-243}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 1.18 \cdot 10^{-306}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;j \leq 3.8 \cdot 10^{+79}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: 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 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
   (if (<= j -7.5e+50)
     t_2
     (if (<= j -1.8e+29)
       t_1
       (if (<= j -2.7e-31)
         (* b c)
         (if (<= j -7.5e-126)
           (* t (* 18.0 (* y (* x z))))
           (if (<= j -3.8e-183)
             t_3
             (if (<= j -3.9e-207)
               t_1
               (if (<= j -6e-243)
                 (* (* x y) (* z (* 18.0 t)))
                 (if (<= j 1.18e-306)
                   t_3
                   (if (<= j 3.8e+79)
                     (* 18.0 (* (* y z) (* x t)))
                     t_2)))))))))))
assert(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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -7.5e+50) {
		tmp = t_2;
	} else if (j <= -1.8e+29) {
		tmp = t_1;
	} else if (j <= -2.7e-31) {
		tmp = b * c;
	} else if (j <= -7.5e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -3.8e-183) {
		tmp = t_3;
	} else if (j <= -3.9e-207) {
		tmp = t_1;
	} else if (j <= -6e-243) {
		tmp = (x * y) * (z * (18.0 * t));
	} else if (j <= 1.18e-306) {
		tmp = t_3;
	} else if (j <= 3.8e+79) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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) :: t_3
    real(8) :: tmp
    t_1 = t * (a * (-4.0d0))
    t_2 = j * (k * (-27.0d0))
    t_3 = (x * i) * (-4.0d0)
    if (j <= (-7.5d+50)) then
        tmp = t_2
    else if (j <= (-1.8d+29)) then
        tmp = t_1
    else if (j <= (-2.7d-31)) then
        tmp = b * c
    else if (j <= (-7.5d-126)) then
        tmp = t * (18.0d0 * (y * (x * z)))
    else if (j <= (-3.8d-183)) then
        tmp = t_3
    else if (j <= (-3.9d-207)) then
        tmp = t_1
    else if (j <= (-6d-243)) then
        tmp = (x * y) * (z * (18.0d0 * t))
    else if (j <= 1.18d-306) then
        tmp = t_3
    else if (j <= 3.8d+79) then
        tmp = 18.0d0 * ((y * z) * (x * t))
    else
        tmp = t_2
    end if
    code = tmp
end function
assert 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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double t_3 = (x * i) * -4.0;
	double tmp;
	if (j <= -7.5e+50) {
		tmp = t_2;
	} else if (j <= -1.8e+29) {
		tmp = t_1;
	} else if (j <= -2.7e-31) {
		tmp = b * c;
	} else if (j <= -7.5e-126) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= -3.8e-183) {
		tmp = t_3;
	} else if (j <= -3.9e-207) {
		tmp = t_1;
	} else if (j <= -6e-243) {
		tmp = (x * y) * (z * (18.0 * t));
	} else if (j <= 1.18e-306) {
		tmp = t_3;
	} else if (j <= 3.8e+79) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = t * (a * -4.0)
	t_2 = j * (k * -27.0)
	t_3 = (x * i) * -4.0
	tmp = 0
	if j <= -7.5e+50:
		tmp = t_2
	elif j <= -1.8e+29:
		tmp = t_1
	elif j <= -2.7e-31:
		tmp = b * c
	elif j <= -7.5e-126:
		tmp = t * (18.0 * (y * (x * z)))
	elif j <= -3.8e-183:
		tmp = t_3
	elif j <= -3.9e-207:
		tmp = t_1
	elif j <= -6e-243:
		tmp = (x * y) * (z * (18.0 * t))
	elif j <= 1.18e-306:
		tmp = t_3
	elif j <= 3.8e+79:
		tmp = 18.0 * ((y * z) * (x * t))
	else:
		tmp = t_2
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * Float64(a * -4.0))
	t_2 = Float64(j * Float64(k * -27.0))
	t_3 = Float64(Float64(x * i) * -4.0)
	tmp = 0.0
	if (j <= -7.5e+50)
		tmp = t_2;
	elseif (j <= -1.8e+29)
		tmp = t_1;
	elseif (j <= -2.7e-31)
		tmp = Float64(b * c);
	elseif (j <= -7.5e-126)
		tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z))));
	elseif (j <= -3.8e-183)
		tmp = t_3;
	elseif (j <= -3.9e-207)
		tmp = t_1;
	elseif (j <= -6e-243)
		tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t)));
	elseif (j <= 1.18e-306)
		tmp = t_3;
	elseif (j <= 3.8e+79)
		tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)));
	else
		tmp = t_2;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = t * (a * -4.0);
	t_2 = j * (k * -27.0);
	t_3 = (x * i) * -4.0;
	tmp = 0.0;
	if (j <= -7.5e+50)
		tmp = t_2;
	elseif (j <= -1.8e+29)
		tmp = t_1;
	elseif (j <= -2.7e-31)
		tmp = b * c;
	elseif (j <= -7.5e-126)
		tmp = t * (18.0 * (y * (x * z)));
	elseif (j <= -3.8e-183)
		tmp = t_3;
	elseif (j <= -3.9e-207)
		tmp = t_1;
	elseif (j <= -6e-243)
		tmp = (x * y) * (z * (18.0 * t));
	elseif (j <= 1.18e-306)
		tmp = t_3;
	elseif (j <= 3.8e+79)
		tmp = 18.0 * ((y * z) * (x * t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: 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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -7.5e+50], t$95$2, If[LessEqual[j, -1.8e+29], t$95$1, If[LessEqual[j, -2.7e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -7.5e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.8e-183], t$95$3, If[LessEqual[j, -3.9e-207], t$95$1, If[LessEqual[j, -6e-243], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.18e-306], t$95$3, If[LessEqual[j, 3.8e+79], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -7.5 \cdot 10^{+50}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -1.8 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -2.7 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq -3.8 \cdot 10^{-183}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq -3.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -6 \cdot 10^{-243}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\

\mathbf{elif}\;j \leq 1.18 \cdot 10^{-306}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;j \leq 3.8 \cdot 10^{+79}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if j < -7.4999999999999999e50 or 3.8000000000000002e79 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.6%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*51.6%

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

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

    if -7.4999999999999999e50 < j < -1.79999999999999988e29 or -3.7999999999999996e-183 < j < -3.90000000000000021e-207

    1. Initial program 99.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 y around 0 90.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out90.3%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in90.3%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative90.3%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*56.9%

        \[\leadsto \color{blue}{\left(-4 \cdot a\right) \cdot t} \]
    7. Simplified56.9%

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

    if -1.79999999999999988e29 < j < -2.70000000000000014e-31

    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. Simplified83.9%

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

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

    if -2.70000000000000014e-31 < j < -7.49999999999999976e-126

    1. Initial program 93.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 0 74.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 34.6%

      \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative34.6%

        \[\leadsto t \cdot \left(18 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot x\right)}\right) \]
      2. associate-*l*34.6%

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

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

    if -7.49999999999999976e-126 < j < -3.7999999999999996e-183 or -6.0000000000000002e-243 < j < 1.17999999999999999e-306

    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. Simplified85.2%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative51.2%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified51.2%

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

    if -3.90000000000000021e-207 < j < -6.0000000000000002e-243

    1. Initial program 80.1%

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

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*57.8%

        \[\leadsto \color{blue}{\left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
      2. associate-*r*57.6%

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. *-commutative57.6%

        \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \left(18 \cdot t\right)} \]
      4. associate-*l*57.5%

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

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

    if 1.17999999999999999e-306 < j < 3.8000000000000002e79

    1. Initial program 88.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 x around 0 94.1%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 35.0%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*37.2%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified37.2%

      \[\leadsto \color{blue}{18 \cdot \left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -7.5 \cdot 10^{+50}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -1.8 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -2.7 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq -3.8 \cdot 10^{-183}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq -3.9 \cdot 10^{-207}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -6 \cdot 10^{-243}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 1.18 \cdot 10^{-306}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 3.8 \cdot 10^{+79}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 17: 43.8% accurate, 1.3× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{if}\;j \leq -5.3 \cdot 10^{+131}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;j \leq -2.4 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -1.15 \cdot 10^{-114}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 2.5 \cdot 10^{-208}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 3.6 \cdot 10^{-75}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 2.8 \cdot 10^{+78}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \end{array} \]
NOTE: 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 (- (* b c) (* x (* 4.0 i)))))
   (if (<= j -5.3e+131)
     (* -27.0 (* j k))
     (if (<= j -2.4e-55)
       t_1
       (if (<= j -1.15e-114)
         (* t (* 18.0 (* y (* x z))))
         (if (<= j 2.5e-208)
           t_1
           (if (<= j 2.15e-158)
             (* 18.0 (* (* y z) (* x t)))
             (if (<= j 3.6e-75)
               t_1
               (if (<= j 2.8e+78)
                 (* (* x y) (* z (* 18.0 t)))
                 (* j (* k -27.0)))))))))))
assert(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 = (b * c) - (x * (4.0 * i));
	double tmp;
	if (j <= -5.3e+131) {
		tmp = -27.0 * (j * k);
	} else if (j <= -2.4e-55) {
		tmp = t_1;
	} else if (j <= -1.15e-114) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= 2.5e-208) {
		tmp = t_1;
	} else if (j <= 2.15e-158) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else if (j <= 3.6e-75) {
		tmp = t_1;
	} else if (j <= 2.8e+78) {
		tmp = (x * y) * (z * (18.0 * t));
	} else {
		tmp = j * (k * -27.0);
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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 = (b * c) - (x * (4.0d0 * i))
    if (j <= (-5.3d+131)) then
        tmp = (-27.0d0) * (j * k)
    else if (j <= (-2.4d-55)) then
        tmp = t_1
    else if (j <= (-1.15d-114)) then
        tmp = t * (18.0d0 * (y * (x * z)))
    else if (j <= 2.5d-208) then
        tmp = t_1
    else if (j <= 2.15d-158) then
        tmp = 18.0d0 * ((y * z) * (x * t))
    else if (j <= 3.6d-75) then
        tmp = t_1
    else if (j <= 2.8d+78) then
        tmp = (x * y) * (z * (18.0d0 * t))
    else
        tmp = j * (k * (-27.0d0))
    end if
    code = tmp
end function
assert 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 = (b * c) - (x * (4.0 * i));
	double tmp;
	if (j <= -5.3e+131) {
		tmp = -27.0 * (j * k);
	} else if (j <= -2.4e-55) {
		tmp = t_1;
	} else if (j <= -1.15e-114) {
		tmp = t * (18.0 * (y * (x * z)));
	} else if (j <= 2.5e-208) {
		tmp = t_1;
	} else if (j <= 2.15e-158) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else if (j <= 3.6e-75) {
		tmp = t_1;
	} else if (j <= 2.8e+78) {
		tmp = (x * y) * (z * (18.0 * t));
	} else {
		tmp = j * (k * -27.0);
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (b * c) - (x * (4.0 * i))
	tmp = 0
	if j <= -5.3e+131:
		tmp = -27.0 * (j * k)
	elif j <= -2.4e-55:
		tmp = t_1
	elif j <= -1.15e-114:
		tmp = t * (18.0 * (y * (x * z)))
	elif j <= 2.5e-208:
		tmp = t_1
	elif j <= 2.15e-158:
		tmp = 18.0 * ((y * z) * (x * t))
	elif j <= 3.6e-75:
		tmp = t_1
	elif j <= 2.8e+78:
		tmp = (x * y) * (z * (18.0 * t))
	else:
		tmp = j * (k * -27.0)
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)))
	tmp = 0.0
	if (j <= -5.3e+131)
		tmp = Float64(-27.0 * Float64(j * k));
	elseif (j <= -2.4e-55)
		tmp = t_1;
	elseif (j <= -1.15e-114)
		tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z))));
	elseif (j <= 2.5e-208)
		tmp = t_1;
	elseif (j <= 2.15e-158)
		tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)));
	elseif (j <= 3.6e-75)
		tmp = t_1;
	elseif (j <= 2.8e+78)
		tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t)));
	else
		tmp = Float64(j * Float64(k * -27.0));
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (b * c) - (x * (4.0 * i));
	tmp = 0.0;
	if (j <= -5.3e+131)
		tmp = -27.0 * (j * k);
	elseif (j <= -2.4e-55)
		tmp = t_1;
	elseif (j <= -1.15e-114)
		tmp = t * (18.0 * (y * (x * z)));
	elseif (j <= 2.5e-208)
		tmp = t_1;
	elseif (j <= 2.15e-158)
		tmp = 18.0 * ((y * z) * (x * t));
	elseif (j <= 3.6e-75)
		tmp = t_1;
	elseif (j <= 2.8e+78)
		tmp = (x * y) * (z * (18.0 * t));
	else
		tmp = j * (k * -27.0);
	end
	tmp_2 = tmp;
end
NOTE: 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[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.3e+131], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -2.4e-55], t$95$1, If[LessEqual[j, -1.15e-114], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.5e-208], t$95$1, If[LessEqual[j, 2.15e-158], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.6e-75], t$95$1, If[LessEqual[j, 2.8e+78], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{if}\;j \leq -5.3 \cdot 10^{+131}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

\mathbf{elif}\;j \leq -2.4 \cdot 10^{-55}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -1.15 \cdot 10^{-114}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\

\mathbf{elif}\;j \leq 2.5 \cdot 10^{-208}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\

\mathbf{elif}\;j \leq 3.6 \cdot 10^{-75}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq 2.8 \cdot 10^{+78}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if j < -5.2999999999999997e131

    1. Initial program 94.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. Simplified86.3%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative61.6%

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

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

    if -5.2999999999999997e131 < j < -2.39999999999999991e-55 or -1.15e-114 < j < 2.49999999999999981e-208 or 2.1499999999999998e-158 < j < 3.6e-75

    1. Initial program 87.0%

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

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*57.3%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*57.3%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*56.4%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef56.4%

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

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

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

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

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

      \[\leadsto b \cdot c - \color{blue}{4 \cdot \left(i \cdot x\right)} \]
    7. Step-by-step derivation
      1. associate-*r*48.3%

        \[\leadsto b \cdot c - \color{blue}{\left(4 \cdot i\right) \cdot x} \]
      2. *-commutative48.3%

        \[\leadsto b \cdot c - \color{blue}{x \cdot \left(4 \cdot i\right)} \]
      3. *-commutative48.3%

        \[\leadsto b \cdot c - x \cdot \color{blue}{\left(i \cdot 4\right)} \]
    8. Simplified48.3%

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

    if -2.39999999999999991e-55 < j < -1.15e-114

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 38.7%

      \[\leadsto t \cdot \color{blue}{\left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative38.7%

        \[\leadsto t \cdot \left(18 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot x\right)}\right) \]
      2. associate-*l*38.7%

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

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

    if 2.49999999999999981e-208 < j < 2.1499999999999998e-158

    1. Initial program 73.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 x around 0 93.2%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 28.8%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*34.9%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified34.9%

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

    if 3.6e-75 < j < 2.8000000000000001e78

    1. Initial program 93.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. Simplified90.7%

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

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

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*29.6%

        \[\leadsto \color{blue}{\left(18 \cdot t\right) \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
      2. associate-*r*29.6%

        \[\leadsto \left(18 \cdot t\right) \cdot \color{blue}{\left(\left(x \cdot y\right) \cdot z\right)} \]
      3. *-commutative29.6%

        \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \left(18 \cdot t\right)} \]
      4. associate-*l*32.5%

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

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

    if 2.8000000000000001e78 < j

    1. Initial program 76.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. Simplified84.2%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative47.0%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*47.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -5.3 \cdot 10^{+131}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;j \leq -2.4 \cdot 10^{-55}:\\ \;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;j \leq -1.15 \cdot 10^{-114}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 2.5 \cdot 10^{-208}:\\ \;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 3.6 \cdot 10^{-75}:\\ \;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\ \mathbf{elif}\;j \leq 2.8 \cdot 10^{+78}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 18: 72.4% accurate, 1.3× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -7 \cdot 10^{+187}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+78} \lor \neg \left(x \leq 2.5 \cdot 10^{+55}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \end{array} \]
NOTE: 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 (* t (* y z))) (* 4.0 i)))))
   (if (<= x -3.6e+219)
     t_1
     (if (<= x -7e+187)
       (+ (* b c) (* (+ (* t a) (* x i)) -4.0))
       (if (or (<= x -1.9e+78) (not (<= x 2.5e+55)))
         t_1
         (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k)))))))
assert(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 * (t * (y * z))) - (4.0 * i));
	double tmp;
	if (x <= -3.6e+219) {
		tmp = t_1;
	} else if (x <= -7e+187) {
		tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
	} else if ((x <= -1.9e+78) || !(x <= 2.5e+55)) {
		tmp = t_1;
	} else {
		tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
    if (x <= (-3.6d+219)) then
        tmp = t_1
    else if (x <= (-7d+187)) then
        tmp = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
    else if ((x <= (-1.9d+78)) .or. (.not. (x <= 2.5d+55))) then
        tmp = t_1
    else
        tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
    end if
    code = tmp
end function
assert 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
	double tmp;
	if (x <= -3.6e+219) {
		tmp = t_1;
	} else if (x <= -7e+187) {
		tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
	} else if ((x <= -1.9e+78) || !(x <= 2.5e+55)) {
		tmp = t_1;
	} else {
		tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i))
	tmp = 0
	if x <= -3.6e+219:
		tmp = t_1
	elif x <= -7e+187:
		tmp = (b * c) + (((t * a) + (x * i)) * -4.0)
	elif (x <= -1.9e+78) or not (x <= 2.5e+55):
		tmp = t_1
	else:
		tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k)
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))
	tmp = 0.0
	if (x <= -3.6e+219)
		tmp = t_1;
	elseif (x <= -7e+187)
		tmp = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0));
	elseif ((x <= -1.9e+78) || !(x <= 2.5e+55))
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k));
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
	tmp = 0.0;
	if (x <= -3.6e+219)
		tmp = t_1;
	elseif (x <= -7e+187)
		tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
	elseif ((x <= -1.9e+78) || ~((x <= 2.5e+55)))
		tmp = t_1;
	else
		tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
	end
	tmp_2 = tmp;
end
NOTE: 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[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+219], t$95$1, If[LessEqual[x, -7e+187], N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.9e+78], N[Not[LessEqual[x, 2.5e+55]], $MachinePrecision]], t$95$1, N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+219}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -7 \cdot 10^{+187}:\\
\;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\

\mathbf{elif}\;x \leq -1.9 \cdot 10^{+78} \lor \neg \left(x \leq 2.5 \cdot 10^{+55}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.60000000000000006e219 or -6.9999999999999995e187 < x < -1.9e78 or 2.50000000000000023e55 < x

    1. Initial program 77.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. Simplified82.0%

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

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

    if -3.60000000000000006e219 < x < -6.9999999999999995e187

    1. Initial program 83.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out100.0%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in100.0%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative100.0%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t + i \cdot x\right) + b \cdot c} \]

    if -1.9e78 < x < 2.50000000000000023e55

    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 x around 0 71.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+219}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{elif}\;x \leq -7 \cdot 10^{+187}:\\ \;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+78} \lor \neg \left(x \leq 2.5 \cdot 10^{+55}\right):\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 19: 74.6% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.14999999999999998e-91 or 4.89999999999999977e-59 < t

    1. Initial program 85.2%

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

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

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

    if -1.14999999999999998e-91 < t < 4.89999999999999977e-59

    1. Initial program 88.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 86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.15 \cdot 10^{-91} \lor \neg \left(t \leq 4.9 \cdot 10^{-59}\right):\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 20: 79.2% accurate, 1.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000033e-38 or 1.9500000000000001e34 < t

    1. Initial program 85.2%

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

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

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

    if -5.00000000000000033e-38 < t < 1.9500000000000001e34

    1. Initial program 87.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 y around 0 87.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-38} \lor \neg \left(t \leq 1.95 \cdot 10^{+34}\right):\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 21: 76.4% accurate, 1.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5e8 or 2.70000000000000019e53 < x

    1. Initial program 80.4%

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

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

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

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

    if -7.5e8 < x < 2.70000000000000019e53

    1. Initial program 91.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -750000000 \lor \neg \left(x \leq 2.7 \cdot 10^{+53}\right):\\ \;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\ \end{array} \]

Alternative 22: 59.5% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;t \leq 1.15 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c - \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 < -3.3000000000000001e-12 or 1.15e17 < t

    1. Initial program 84.9%

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

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

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

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

    if -3.3000000000000001e-12 < t < 1.15e-210

    1. Initial program 84.4%

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

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*82.1%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*82.1%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*82.1%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef84.6%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg62.5%

        \[\leadsto \color{blue}{-\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      2. associate-*r*62.5%

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

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      4. associate-*r*62.5%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      5. distribute-neg-in62.5%

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right) + \left(-j \cdot \left(27 \cdot k\right)\right)} \]
      6. distribute-lft-neg-in62.5%

        \[\leadsto \color{blue}{\left(-4\right) \cdot \left(i \cdot x\right)} + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      7. metadata-eval62.5%

        \[\leadsto \color{blue}{-4} \cdot \left(i \cdot x\right) + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      8. distribute-rgt-neg-in62.5%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      9. *-commutative62.5%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(-\color{blue}{k \cdot 27}\right) \]
      10. distribute-rgt-neg-in62.5%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \color{blue}{\left(k \cdot \left(-27\right)\right)} \]
      11. metadata-eval62.5%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(k \cdot \color{blue}{-27}\right) \]
    8. Simplified62.5%

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

    if 1.15e-210 < t < 1.15e17

    1. Initial program 94.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 x around 0 92.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-12}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-210}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+17}:\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\ \end{array} \]

Alternative 23: 52.5% accurate, 1.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -6.3999999999999995e135 or 2.20000000000000021e-65 < (*.f64 b c)

    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 x around 0 86.7%

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

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

    if -6.3999999999999995e135 < (*.f64 b c) < 2.20000000000000021e-65

    1. Initial program 89.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. Simplified91.9%

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

      \[\leadsto \color{blue}{b \cdot c - \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*59.0%

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

        \[\leadsto b \cdot c - \left(\color{blue}{x \cdot \left(4 \cdot i\right)} + 27 \cdot \left(j \cdot k\right)\right) \]
      3. associate-*r*59.0%

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

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      5. associate-*r*58.3%

        \[\leadsto b \cdot c - \left(x \cdot \left(4 \cdot i\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      6. fma-udef59.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg54.8%

        \[\leadsto \color{blue}{-\left(4 \cdot \left(i \cdot x\right) + 27 \cdot \left(j \cdot k\right)\right)} \]
      2. associate-*r*54.8%

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

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{\left(j \cdot 27\right)} \cdot k\right) \]
      4. associate-*r*54.2%

        \[\leadsto -\left(4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(27 \cdot k\right)}\right) \]
      5. distribute-neg-in54.2%

        \[\leadsto \color{blue}{\left(-4 \cdot \left(i \cdot x\right)\right) + \left(-j \cdot \left(27 \cdot k\right)\right)} \]
      6. distribute-lft-neg-in54.2%

        \[\leadsto \color{blue}{\left(-4\right) \cdot \left(i \cdot x\right)} + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      7. metadata-eval54.2%

        \[\leadsto \color{blue}{-4} \cdot \left(i \cdot x\right) + \left(-j \cdot \left(27 \cdot k\right)\right) \]
      8. distribute-rgt-neg-in54.2%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + \color{blue}{j \cdot \left(-27 \cdot k\right)} \]
      9. *-commutative54.2%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(-\color{blue}{k \cdot 27}\right) \]
      10. distribute-rgt-neg-in54.2%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \color{blue}{\left(k \cdot \left(-27\right)\right)} \]
      11. metadata-eval54.2%

        \[\leadsto -4 \cdot \left(i \cdot x\right) + j \cdot \left(k \cdot \color{blue}{-27}\right) \]
    8. Simplified54.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -6.4 \cdot 10^{+135} \lor \neg \left(b \cdot c \leq 2.2 \cdot 10^{-65}\right):\\ \;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\ \end{array} \]

Alternative 24: 31.9% accurate, 1.8× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := j \cdot \left(k \cdot -27\right)\\ \mathbf{if}\;j \leq -4.7 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -1.85 \cdot 10^{-16}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8 \cdot 10^{-126}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 2.4 \cdot 10^{-176}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 2.2 \cdot 10^{+40}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: 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 (* t (* a -4.0))) (t_2 (* j (* k -27.0))))
   (if (<= j -4.7e+50)
     t_2
     (if (<= j -1.4e+29)
       t_1
       (if (<= j -1.85e-16)
         (* b c)
         (if (<= j -8e-126)
           t_1
           (if (<= j 2.4e-176)
             (* (* x i) -4.0)
             (if (<= j 2.2e+40) (* b c) t_2))))))))
assert(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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double tmp;
	if (j <= -4.7e+50) {
		tmp = t_2;
	} else if (j <= -1.4e+29) {
		tmp = t_1;
	} else if (j <= -1.85e-16) {
		tmp = b * c;
	} else if (j <= -8e-126) {
		tmp = t_1;
	} else if (j <= 2.4e-176) {
		tmp = (x * i) * -4.0;
	} else if (j <= 2.2e+40) {
		tmp = b * c;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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 = t * (a * (-4.0d0))
    t_2 = j * (k * (-27.0d0))
    if (j <= (-4.7d+50)) then
        tmp = t_2
    else if (j <= (-1.4d+29)) then
        tmp = t_1
    else if (j <= (-1.85d-16)) then
        tmp = b * c
    else if (j <= (-8d-126)) then
        tmp = t_1
    else if (j <= 2.4d-176) then
        tmp = (x * i) * (-4.0d0)
    else if (j <= 2.2d+40) then
        tmp = b * c
    else
        tmp = t_2
    end if
    code = tmp
end function
assert 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 = t * (a * -4.0);
	double t_2 = j * (k * -27.0);
	double tmp;
	if (j <= -4.7e+50) {
		tmp = t_2;
	} else if (j <= -1.4e+29) {
		tmp = t_1;
	} else if (j <= -1.85e-16) {
		tmp = b * c;
	} else if (j <= -8e-126) {
		tmp = t_1;
	} else if (j <= 2.4e-176) {
		tmp = (x * i) * -4.0;
	} else if (j <= 2.2e+40) {
		tmp = b * c;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = t * (a * -4.0)
	t_2 = j * (k * -27.0)
	tmp = 0
	if j <= -4.7e+50:
		tmp = t_2
	elif j <= -1.4e+29:
		tmp = t_1
	elif j <= -1.85e-16:
		tmp = b * c
	elif j <= -8e-126:
		tmp = t_1
	elif j <= 2.4e-176:
		tmp = (x * i) * -4.0
	elif j <= 2.2e+40:
		tmp = b * c
	else:
		tmp = t_2
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(t * Float64(a * -4.0))
	t_2 = Float64(j * Float64(k * -27.0))
	tmp = 0.0
	if (j <= -4.7e+50)
		tmp = t_2;
	elseif (j <= -1.4e+29)
		tmp = t_1;
	elseif (j <= -1.85e-16)
		tmp = Float64(b * c);
	elseif (j <= -8e-126)
		tmp = t_1;
	elseif (j <= 2.4e-176)
		tmp = Float64(Float64(x * i) * -4.0);
	elseif (j <= 2.2e+40)
		tmp = Float64(b * c);
	else
		tmp = t_2;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = t * (a * -4.0);
	t_2 = j * (k * -27.0);
	tmp = 0.0;
	if (j <= -4.7e+50)
		tmp = t_2;
	elseif (j <= -1.4e+29)
		tmp = t_1;
	elseif (j <= -1.85e-16)
		tmp = b * c;
	elseif (j <= -8e-126)
		tmp = t_1;
	elseif (j <= 2.4e-176)
		tmp = (x * i) * -4.0;
	elseif (j <= 2.2e+40)
		tmp = b * c;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: 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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -4.7e+50], t$95$2, If[LessEqual[j, -1.4e+29], t$95$1, If[LessEqual[j, -1.85e-16], N[(b * c), $MachinePrecision], If[LessEqual[j, -8e-126], t$95$1, If[LessEqual[j, 2.4e-176], N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[j, 2.2e+40], N[(b * c), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;j \leq -4.7 \cdot 10^{+50}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -1.85 \cdot 10^{-16}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq -8 \cdot 10^{-126}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq 2.4 \cdot 10^{-176}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4\\

\mathbf{elif}\;j \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;b \cdot c\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if j < -4.69999999999999974e50 or 2.1999999999999999e40 < j

    1. Initial program 84.3%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative48.4%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*48.5%

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

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

    if -4.69999999999999974e50 < j < -1.4e29 or -1.85e-16 < j < -7.9999999999999996e-126

    1. Initial program 95.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 y around 0 79.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, -\left(4 \cdot \left(a \cdot t\right) + 4 \cdot \left(i \cdot x\right)\right)\right)} - \left(j \cdot 27\right) \cdot k \]
      2. distribute-lft-out79.6%

        \[\leadsto \mathsf{fma}\left(b, c, -\color{blue}{4 \cdot \left(a \cdot t + i \cdot x\right)}\right) - \left(j \cdot 27\right) \cdot k \]
      3. distribute-lft-neg-in79.6%

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

        \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{-4} \cdot \left(a \cdot t + i \cdot x\right)\right) - \left(j \cdot 27\right) \cdot k \]
      5. *-commutative79.6%

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

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

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(a \cdot t\right)} \]
    6. Step-by-step derivation
      1. associate-*r*37.4%

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

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

    if -1.4e29 < j < -1.85e-16 or 2.40000000000000006e-176 < j < 2.1999999999999999e40

    1. Initial program 89.6%

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

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

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

    if -7.9999999999999996e-126 < j < 2.40000000000000006e-176

    1. Initial program 84.5%

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

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative32.0%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified32.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -4.7 \cdot 10^{+50}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq -1.85 \cdot 10^{-16}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -8 \cdot 10^{-126}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;j \leq 2.4 \cdot 10^{-176}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 2.2 \cdot 10^{+40}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 25: 45.8% accurate, 1.8× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;j \leq -1.8 \cdot 10^{+112}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;j \leq 3.25 \cdot 10^{-208}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 8.2 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \end{array} \]
NOTE: 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 (- (* b c) (* 4.0 (* t a)))))
   (if (<= j -1.8e+112)
     (* -27.0 (* j k))
     (if (<= j 3.25e-208)
       t_1
       (if (<= j 2.15e-158)
         (* 18.0 (* (* y z) (* x t)))
         (if (<= j 8.2e+42) t_1 (* j (* k -27.0))))))))
assert(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 = (b * c) - (4.0 * (t * a));
	double tmp;
	if (j <= -1.8e+112) {
		tmp = -27.0 * (j * k);
	} else if (j <= 3.25e-208) {
		tmp = t_1;
	} else if (j <= 2.15e-158) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else if (j <= 8.2e+42) {
		tmp = t_1;
	} else {
		tmp = j * (k * -27.0);
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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 = (b * c) - (4.0d0 * (t * a))
    if (j <= (-1.8d+112)) then
        tmp = (-27.0d0) * (j * k)
    else if (j <= 3.25d-208) then
        tmp = t_1
    else if (j <= 2.15d-158) then
        tmp = 18.0d0 * ((y * z) * (x * t))
    else if (j <= 8.2d+42) then
        tmp = t_1
    else
        tmp = j * (k * (-27.0d0))
    end if
    code = tmp
end function
assert 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 = (b * c) - (4.0 * (t * a));
	double tmp;
	if (j <= -1.8e+112) {
		tmp = -27.0 * (j * k);
	} else if (j <= 3.25e-208) {
		tmp = t_1;
	} else if (j <= 2.15e-158) {
		tmp = 18.0 * ((y * z) * (x * t));
	} else if (j <= 8.2e+42) {
		tmp = t_1;
	} else {
		tmp = j * (k * -27.0);
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = (b * c) - (4.0 * (t * a))
	tmp = 0
	if j <= -1.8e+112:
		tmp = -27.0 * (j * k)
	elif j <= 3.25e-208:
		tmp = t_1
	elif j <= 2.15e-158:
		tmp = 18.0 * ((y * z) * (x * t))
	elif j <= 8.2e+42:
		tmp = t_1
	else:
		tmp = j * (k * -27.0)
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a)))
	tmp = 0.0
	if (j <= -1.8e+112)
		tmp = Float64(-27.0 * Float64(j * k));
	elseif (j <= 3.25e-208)
		tmp = t_1;
	elseif (j <= 2.15e-158)
		tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)));
	elseif (j <= 8.2e+42)
		tmp = t_1;
	else
		tmp = Float64(j * Float64(k * -27.0));
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = (b * c) - (4.0 * (t * a));
	tmp = 0.0;
	if (j <= -1.8e+112)
		tmp = -27.0 * (j * k);
	elseif (j <= 3.25e-208)
		tmp = t_1;
	elseif (j <= 2.15e-158)
		tmp = 18.0 * ((y * z) * (x * t));
	elseif (j <= 8.2e+42)
		tmp = t_1;
	else
		tmp = j * (k * -27.0);
	end
	tmp_2 = tmp;
end
NOTE: 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[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.8e+112], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.25e-208], t$95$1, If[LessEqual[j, 2.15e-158], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 8.2e+42], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;j \leq -1.8 \cdot 10^{+112}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\

\mathbf{elif}\;j \leq 3.25 \cdot 10^{-208}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\

\mathbf{elif}\;j \leq 8.2 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if j < -1.8e112

    1. Initial program 92.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. Simplified87.5%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative56.7%

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

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

    if -1.8e112 < j < 3.2499999999999999e-208 or 2.1499999999999998e-158 < j < 8.2000000000000001e42

    1. Initial program 89.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 x around 0 89.2%

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

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

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

    if 3.2499999999999999e-208 < j < 2.1499999999999998e-158

    1. Initial program 73.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 x around 0 93.2%

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

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

      \[\leadsto \color{blue}{t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)} \]
    5. Taylor expanded in x around inf 28.8%

      \[\leadsto \color{blue}{18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*34.9%

        \[\leadsto 18 \cdot \color{blue}{\left(\left(t \cdot x\right) \cdot \left(y \cdot z\right)\right)} \]
    7. Simplified34.9%

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

    if 8.2000000000000001e42 < j

    1. Initial program 77.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. Simplified84.4%

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative41.5%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*41.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -1.8 \cdot 10^{+112}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;j \leq 3.25 \cdot 10^{-208}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\ \;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\ \mathbf{elif}\;j \leq 8.2 \cdot 10^{+42}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 26: 31.8% accurate, 2.3× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} t_1 := j \cdot \left(k \cdot -27\right)\\ \mathbf{if}\;j \leq -9.2 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -1.16 \cdot 10^{-14}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq 1.5 \cdot 10^{-176}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 4.8 \cdot 10^{+50}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: 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 (* k -27.0))))
   (if (<= j -9.2e+51)
     t_1
     (if (<= j -1.16e-14)
       (* b c)
       (if (<= j 1.5e-176)
         (* (* x i) -4.0)
         (if (<= j 4.8e+50) (* b c) t_1))))))
assert(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 * (k * -27.0);
	double tmp;
	if (j <= -9.2e+51) {
		tmp = t_1;
	} else if (j <= -1.16e-14) {
		tmp = b * c;
	} else if (j <= 1.5e-176) {
		tmp = (x * i) * -4.0;
	} else if (j <= 4.8e+50) {
		tmp = b * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    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 * (k * (-27.0d0))
    if (j <= (-9.2d+51)) then
        tmp = t_1
    else if (j <= (-1.16d-14)) then
        tmp = b * c
    else if (j <= 1.5d-176) then
        tmp = (x * i) * (-4.0d0)
    else if (j <= 4.8d+50) then
        tmp = b * c
    else
        tmp = t_1
    end if
    code = tmp
end function
assert 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 * (k * -27.0);
	double tmp;
	if (j <= -9.2e+51) {
		tmp = t_1;
	} else if (j <= -1.16e-14) {
		tmp = b * c;
	} else if (j <= 1.5e-176) {
		tmp = (x * i) * -4.0;
	} else if (j <= 4.8e+50) {
		tmp = b * c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = j * (k * -27.0)
	tmp = 0
	if j <= -9.2e+51:
		tmp = t_1
	elif j <= -1.16e-14:
		tmp = b * c
	elif j <= 1.5e-176:
		tmp = (x * i) * -4.0
	elif j <= 4.8e+50:
		tmp = b * c
	else:
		tmp = t_1
	return tmp
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(j * Float64(k * -27.0))
	tmp = 0.0
	if (j <= -9.2e+51)
		tmp = t_1;
	elseif (j <= -1.16e-14)
		tmp = Float64(b * c);
	elseif (j <= 1.5e-176)
		tmp = Float64(Float64(x * i) * -4.0);
	elseif (j <= 4.8e+50)
		tmp = Float64(b * c);
	else
		tmp = t_1;
	end
	return tmp
end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = j * (k * -27.0);
	tmp = 0.0;
	if (j <= -9.2e+51)
		tmp = t_1;
	elseif (j <= -1.16e-14)
		tmp = b * c;
	elseif (j <= 1.5e-176)
		tmp = (x * i) * -4.0;
	elseif (j <= 4.8e+50)
		tmp = b * c;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: 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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -9.2e+51], t$95$1, If[LessEqual[j, -1.16e-14], N[(b * c), $MachinePrecision], If[LessEqual[j, 1.5e-176], N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[j, 4.8e+50], N[(b * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;j \leq -9.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;j \leq -1.16 \cdot 10^{-14}:\\
\;\;\;\;b \cdot c\\

\mathbf{elif}\;j \leq 1.5 \cdot 10^{-176}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4\\

\mathbf{elif}\;j \leq 4.8 \cdot 10^{+50}:\\
\;\;\;\;b \cdot c\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -9.2000000000000002e51 or 4.8000000000000004e50 < j

    1. Initial program 84.1%

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

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

      \[\leadsto \color{blue}{-27 \cdot \left(j \cdot k\right)} \]
    4. Step-by-step derivation
      1. *-commutative48.9%

        \[\leadsto \color{blue}{\left(j \cdot k\right) \cdot -27} \]
      2. associate-*l*48.9%

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

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

    if -9.2000000000000002e51 < j < -1.16000000000000007e-14 or 1.5e-176 < j < 4.8000000000000004e50

    1. Initial program 90.5%

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

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

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

    if -1.16000000000000007e-14 < j < 1.5e-176

    1. Initial program 86.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. Simplified91.6%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative32.3%

        \[\leadsto -4 \cdot \color{blue}{\left(x \cdot i\right)} \]
    5. Simplified32.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -9.2 \cdot 10^{+51}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;j \leq -1.16 \cdot 10^{-14}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq 1.5 \cdot 10^{-176}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{elif}\;j \leq 4.8 \cdot 10^{+50}:\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]

Alternative 27: 34.9% accurate, 2.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 b c) < -2.69999999999999985e135 or 1e71 < (*.f64 b c)

    1. Initial program 83.2%

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

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

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

    if -2.69999999999999985e135 < (*.f64 b c) < 1e71

    1. Initial program 88.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. Simplified90.8%

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

      \[\leadsto \color{blue}{-4 \cdot \left(i \cdot x\right)} \]
    4. Step-by-step derivation
      1. *-commutative29.5%

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

      \[\leadsto \color{blue}{-4 \cdot \left(x \cdot i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot c \leq -2.7 \cdot 10^{+135}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \cdot c \leq 10^{+71}:\\ \;\;\;\;\left(x \cdot i\right) \cdot -4\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]

Alternative 28: 23.6% accurate, 10.3× speedup?

\[\begin{array}{l} [j, k] = \mathsf{sort}([j, k])\\ \\ b \cdot c \end{array} \]
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = b * c
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return b * c;
}
[j, k] = sort([j, k])
def code(x, y, z, t, a, b, c, i, j, k):
	return b * c
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(b * c)
end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = b * c;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Derivation
  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. Simplified88.7%

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

    \[\leadsto \color{blue}{b \cdot c} \]
  4. Final simplification19.5%

    \[\leadsto b \cdot c \]

Developer target: 88.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\ t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
        (t_2
         (-
          (- (* (* 18.0 t) (* (* x y) z)) t_1)
          (- (* (* k j) 27.0) (* c b)))))
   (if (< t -1.6210815397541398e-69)
     t_2
     (if (< t 165.68027943805222)
       (+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
       t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((a * t) + (i * x)) * 4.0d0
    t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
    if (t < (-1.6210815397541398d-69)) then
        tmp = t_2
    else if (t < 165.68027943805222d0) then
        tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = ((a * t) + (i * x)) * 4.0;
	double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	double tmp;
	if (t < -1.6210815397541398e-69) {
		tmp = t_2;
	} else if (t < 165.68027943805222) {
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = ((a * t) + (i * x)) * 4.0
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b))
	tmp = 0
	if t < -1.6210815397541398e-69:
		tmp = t_2
	elif t < 165.68027943805222:
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0)
	t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b)))
	tmp = 0.0
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = ((a * t) + (i * x)) * 4.0;
	t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
	tmp = 0.0;
	if (t < -1.6210815397541398e-69)
		tmp = t_2;
	elseif (t < 165.68027943805222)
		tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023271 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64

  :herbie-target
  (if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))

  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))