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

Percentage Accurate: 95.8% → 98.5%
Time: 12.1s
Alternatives: 15
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\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 15 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: 95.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}

Alternative 1: 98.5% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-14}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -5e-14)
   (fma a (* 27.0 b) (- (* x 2.0) (* y (* t (* z 9.0)))))
   (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -5e-14) {
		tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (t * (z * 9.0)))));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
	}
	return tmp;
}
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -5e-14)
		tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(z * 9.0)))));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5e-14], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.0000000000000002e-14

    1. Initial program 93.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around 0 91.2%

      \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(t \cdot z\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \color{blue}{\left(\left(t \cdot z\right) \cdot y\right)}\right) \]
      2. *-commutative91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(\color{blue}{\left(z \cdot t\right)} \cdot y\right)\right) \]
      3. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot \left(z \cdot t\right)\right) \cdot y}\right) \]
      4. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{y \cdot \left(9 \cdot \left(z \cdot t\right)\right)}\right) \]
      5. associate-*r*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \color{blue}{\left(\left(9 \cdot z\right) \cdot t\right)}\right) \]
      6. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \color{blue}{\left(t \cdot \left(9 \cdot z\right)\right)}\right) \]
      7. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(t \cdot \color{blue}{\left(z \cdot 9\right)}\right)\right) \]
    6. Simplified91.1%

      \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{y \cdot \left(t \cdot \left(z \cdot 9\right)\right)}\right) \]

    if -5.0000000000000002e-14 < z

    1. Initial program 97.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-14}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 2: 98.4% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-122}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1e-122)
   (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t)))))
   (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1e-122) {
		tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
	}
	return tmp;
}
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1e-122)
		tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1e-122], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-122}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.00000000000000006e-122

    1. Initial program 94.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.9%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*94.9%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def95.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]

    if -1.00000000000000006e-122 < z

    1. Initial program 96.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-122}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 3: 96.9% accurate, 0.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+303}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t_1\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* t (* z (* y 9.0)))))
   (if (<= t_1 -2e+303)
     (- (* x 2.0) (* 9.0 (* y (* z t))))
     (+ (- (* x 2.0) t_1) (* b (* a 27.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (z * (y * 9.0));
	double tmp;
	if (t_1 <= -2e+303) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = ((x * 2.0) - t_1) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = t * (z * (y * 9.0d0))
    if (t_1 <= (-2d+303)) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else
        tmp = ((x * 2.0d0) - t_1) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (z * (y * 9.0));
	double tmp;
	if (t_1 <= -2e+303) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = ((x * 2.0) - t_1) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = t * (z * (y * 9.0))
	tmp = 0
	if t_1 <= -2e+303:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	else:
		tmp = ((x * 2.0) - t_1) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(t * Float64(z * Float64(y * 9.0)))
	tmp = 0.0
	if (t_1 <= -2e+303)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - t_1) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t * (z * (y * 9.0));
	tmp = 0.0;
	if (t_1 <= -2e+303)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	else
		tmp = ((x * 2.0) - t_1) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+303], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+303}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t_1\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 y 9) z) t) < -2e303

    1. Initial program 77.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative77.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*77.6%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def81.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*96.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative96.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*96.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified96.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around 0 96.6%

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

    if -2e303 < (*.f64 (*.f64 (*.f64 y 9) z) t)

    1. Initial program 98.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot \left(z \cdot \left(y \cdot 9\right)\right) \leq -2 \cdot 10^{+303}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 4: 45.0% accurate, 0.8× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{if}\;b \leq -4.2 \cdot 10^{-112}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -1.35 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.38 \cdot 10^{-158}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.32 \cdot 10^{-105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 3.95 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (* y (* z t)) -9.0)))
   (if (<= b -4.2e-112)
     (* b (* a 27.0))
     (if (<= b -1.35e-290)
       (* x 2.0)
       (if (<= b 1.38e-158)
         t_1
         (if (<= b 1.32e-105)
           (* x 2.0)
           (if (<= b 5.5e-63)
             t_1
             (if (<= b 2.3e+20)
               (* x 2.0)
               (if (<= b 4.4e+79)
                 t_1
                 (if (<= b 3.95e+118) (* x 2.0) (* 27.0 (* a b))))))))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * (z * t)) * -9.0;
	double tmp;
	if (b <= -4.2e-112) {
		tmp = b * (a * 27.0);
	} else if (b <= -1.35e-290) {
		tmp = x * 2.0;
	} else if (b <= 1.38e-158) {
		tmp = t_1;
	} else if (b <= 1.32e-105) {
		tmp = x * 2.0;
	} else if (b <= 5.5e-63) {
		tmp = t_1;
	} else if (b <= 2.3e+20) {
		tmp = x * 2.0;
	} else if (b <= 4.4e+79) {
		tmp = t_1;
	} else if (b <= 3.95e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = (y * (z * t)) * (-9.0d0)
    if (b <= (-4.2d-112)) then
        tmp = b * (a * 27.0d0)
    else if (b <= (-1.35d-290)) then
        tmp = x * 2.0d0
    else if (b <= 1.38d-158) then
        tmp = t_1
    else if (b <= 1.32d-105) then
        tmp = x * 2.0d0
    else if (b <= 5.5d-63) then
        tmp = t_1
    else if (b <= 2.3d+20) then
        tmp = x * 2.0d0
    else if (b <= 4.4d+79) then
        tmp = t_1
    else if (b <= 3.95d+118) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * (z * t)) * -9.0;
	double tmp;
	if (b <= -4.2e-112) {
		tmp = b * (a * 27.0);
	} else if (b <= -1.35e-290) {
		tmp = x * 2.0;
	} else if (b <= 1.38e-158) {
		tmp = t_1;
	} else if (b <= 1.32e-105) {
		tmp = x * 2.0;
	} else if (b <= 5.5e-63) {
		tmp = t_1;
	} else if (b <= 2.3e+20) {
		tmp = x * 2.0;
	} else if (b <= 4.4e+79) {
		tmp = t_1;
	} else if (b <= 3.95e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = (y * (z * t)) * -9.0
	tmp = 0
	if b <= -4.2e-112:
		tmp = b * (a * 27.0)
	elif b <= -1.35e-290:
		tmp = x * 2.0
	elif b <= 1.38e-158:
		tmp = t_1
	elif b <= 1.32e-105:
		tmp = x * 2.0
	elif b <= 5.5e-63:
		tmp = t_1
	elif b <= 2.3e+20:
		tmp = x * 2.0
	elif b <= 4.4e+79:
		tmp = t_1
	elif b <= 3.95e+118:
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y * Float64(z * t)) * -9.0)
	tmp = 0.0
	if (b <= -4.2e-112)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (b <= -1.35e-290)
		tmp = Float64(x * 2.0);
	elseif (b <= 1.38e-158)
		tmp = t_1;
	elseif (b <= 1.32e-105)
		tmp = Float64(x * 2.0);
	elseif (b <= 5.5e-63)
		tmp = t_1;
	elseif (b <= 2.3e+20)
		tmp = Float64(x * 2.0);
	elseif (b <= 4.4e+79)
		tmp = t_1;
	elseif (b <= 3.95e+118)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (y * (z * t)) * -9.0;
	tmp = 0.0;
	if (b <= -4.2e-112)
		tmp = b * (a * 27.0);
	elseif (b <= -1.35e-290)
		tmp = x * 2.0;
	elseif (b <= 1.38e-158)
		tmp = t_1;
	elseif (b <= 1.32e-105)
		tmp = x * 2.0;
	elseif (b <= 5.5e-63)
		tmp = t_1;
	elseif (b <= 2.3e+20)
		tmp = x * 2.0;
	elseif (b <= 4.4e+79)
		tmp = t_1;
	elseif (b <= 3.95e+118)
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[b, -4.2e-112], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.35e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.38e-158], t$95$1, If[LessEqual[b, 1.32e-105], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.5e-63], t$95$1, If[LessEqual[b, 2.3e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.4e+79], t$95$1, If[LessEqual[b, 3.95e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-112}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;b \leq -1.35 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 1.38 \cdot 10^{-158}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.32 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 5.5 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 4.4 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 3.95 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -4.2000000000000001e-112

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.2%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 51.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.2%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative51.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. *-commutative51.2%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative51.2%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    6. Simplified51.2%

      \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]

    if -4.2000000000000001e-112 < b < -1.34999999999999999e-290 or 1.37999999999999997e-158 < b < 1.32000000000000006e-105 or 5.50000000000000043e-63 < b < 2.3e20 or 4.3999999999999998e79 < b < 3.9500000000000002e118

    1. Initial program 94.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*94.6%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*97.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around inf 48.7%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -1.34999999999999999e-290 < b < 1.37999999999999997e-158 or 1.32000000000000006e-105 < b < 5.50000000000000043e-63 or 2.3e20 < b < 4.3999999999999998e79

    1. Initial program 95.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*95.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def95.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 49.0%

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

    if 3.9500000000000002e118 < b

    1. Initial program 97.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 61.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{-112}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -1.35 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.38 \cdot 10^{-158}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 1.32 \cdot 10^{-105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-63}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{+79}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 3.95 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 5: 45.1% accurate, 0.8× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-157}:\\ \;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\ \mathbf{elif}\;b \leq 3.45 \cdot 10^{-105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (* y (* z t)) -9.0)))
   (if (<= b -1.45e-111)
     (* b (* a 27.0))
     (if (<= b -1.9e-290)
       (* x 2.0)
       (if (<= b 4.3e-157)
         (* y (* (* z t) -9.0))
         (if (<= b 3.45e-105)
           (* x 2.0)
           (if (<= b 6.5e-62)
             t_1
             (if (<= b 1.95e+20)
               (* x 2.0)
               (if (<= b 1.35e+79)
                 t_1
                 (if (<= b 3.2e+118) (* x 2.0) (* 27.0 (* a b))))))))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * (z * t)) * -9.0;
	double tmp;
	if (b <= -1.45e-111) {
		tmp = b * (a * 27.0);
	} else if (b <= -1.9e-290) {
		tmp = x * 2.0;
	} else if (b <= 4.3e-157) {
		tmp = y * ((z * t) * -9.0);
	} else if (b <= 3.45e-105) {
		tmp = x * 2.0;
	} else if (b <= 6.5e-62) {
		tmp = t_1;
	} else if (b <= 1.95e+20) {
		tmp = x * 2.0;
	} else if (b <= 1.35e+79) {
		tmp = t_1;
	} else if (b <= 3.2e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = (y * (z * t)) * (-9.0d0)
    if (b <= (-1.45d-111)) then
        tmp = b * (a * 27.0d0)
    else if (b <= (-1.9d-290)) then
        tmp = x * 2.0d0
    else if (b <= 4.3d-157) then
        tmp = y * ((z * t) * (-9.0d0))
    else if (b <= 3.45d-105) then
        tmp = x * 2.0d0
    else if (b <= 6.5d-62) then
        tmp = t_1
    else if (b <= 1.95d+20) then
        tmp = x * 2.0d0
    else if (b <= 1.35d+79) then
        tmp = t_1
    else if (b <= 3.2d+118) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * (z * t)) * -9.0;
	double tmp;
	if (b <= -1.45e-111) {
		tmp = b * (a * 27.0);
	} else if (b <= -1.9e-290) {
		tmp = x * 2.0;
	} else if (b <= 4.3e-157) {
		tmp = y * ((z * t) * -9.0);
	} else if (b <= 3.45e-105) {
		tmp = x * 2.0;
	} else if (b <= 6.5e-62) {
		tmp = t_1;
	} else if (b <= 1.95e+20) {
		tmp = x * 2.0;
	} else if (b <= 1.35e+79) {
		tmp = t_1;
	} else if (b <= 3.2e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = (y * (z * t)) * -9.0
	tmp = 0
	if b <= -1.45e-111:
		tmp = b * (a * 27.0)
	elif b <= -1.9e-290:
		tmp = x * 2.0
	elif b <= 4.3e-157:
		tmp = y * ((z * t) * -9.0)
	elif b <= 3.45e-105:
		tmp = x * 2.0
	elif b <= 6.5e-62:
		tmp = t_1
	elif b <= 1.95e+20:
		tmp = x * 2.0
	elif b <= 1.35e+79:
		tmp = t_1
	elif b <= 3.2e+118:
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y * Float64(z * t)) * -9.0)
	tmp = 0.0
	if (b <= -1.45e-111)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (b <= -1.9e-290)
		tmp = Float64(x * 2.0);
	elseif (b <= 4.3e-157)
		tmp = Float64(y * Float64(Float64(z * t) * -9.0));
	elseif (b <= 3.45e-105)
		tmp = Float64(x * 2.0);
	elseif (b <= 6.5e-62)
		tmp = t_1;
	elseif (b <= 1.95e+20)
		tmp = Float64(x * 2.0);
	elseif (b <= 1.35e+79)
		tmp = t_1;
	elseif (b <= 3.2e+118)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (y * (z * t)) * -9.0;
	tmp = 0.0;
	if (b <= -1.45e-111)
		tmp = b * (a * 27.0);
	elseif (b <= -1.9e-290)
		tmp = x * 2.0;
	elseif (b <= 4.3e-157)
		tmp = y * ((z * t) * -9.0);
	elseif (b <= 3.45e-105)
		tmp = x * 2.0;
	elseif (b <= 6.5e-62)
		tmp = t_1;
	elseif (b <= 1.95e+20)
		tmp = x * 2.0;
	elseif (b <= 1.35e+79)
		tmp = t_1;
	elseif (b <= 3.2e+118)
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[b, -1.45e-111], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.9e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.3e-157], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.45e-105], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.5e-62], t$95$1, If[LessEqual[b, 1.95e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.35e+79], t$95$1, If[LessEqual[b, 3.2e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;b \leq -1.9 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 4.3 \cdot 10^{-157}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\

\mathbf{elif}\;b \leq 3.45 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.95 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.45000000000000001e-111

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.2%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 51.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.2%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative51.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. *-commutative51.2%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative51.2%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    6. Simplified51.2%

      \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]

    if -1.45000000000000001e-111 < b < -1.89999999999999988e-290 or 4.2999999999999998e-157 < b < 3.45000000000000014e-105 or 6.50000000000000026e-62 < b < 1.95e20 or 1.35e79 < b < 3.20000000000000016e118

    1. Initial program 94.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*94.6%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*97.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around inf 48.7%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -1.89999999999999988e-290 < b < 4.2999999999999998e-157

    1. Initial program 93.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.2%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def93.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 52.1%

      \[\leadsto \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutative52.1%

        \[\leadsto -9 \cdot \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \]
      2. *-commutative52.1%

        \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot t\right)\right) \cdot -9} \]
      3. associate-*l*52.0%

        \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot t\right) \cdot -9\right)} \]
      4. *-commutative52.0%

        \[\leadsto y \cdot \left(\color{blue}{\left(t \cdot z\right)} \cdot -9\right) \]
      5. *-commutative52.0%

        \[\leadsto y \cdot \color{blue}{\left(-9 \cdot \left(t \cdot z\right)\right)} \]
    6. Simplified52.0%

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

    if 3.45000000000000014e-105 < b < 6.50000000000000026e-62 or 1.95e20 < b < 1.35e79

    1. Initial program 99.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*99.9%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 43.7%

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

    if 3.20000000000000016e118 < b

    1. Initial program 97.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 61.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-157}:\\ \;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\ \mathbf{elif}\;b \leq 3.45 \cdot 10^{-105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{-62}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+79}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 6: 45.1% accurate, 0.8× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\ \mathbf{if}\;b \leq -1.15 \cdot 10^{-112}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 6.4 \cdot 10^{-99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{-61}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.55 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (* z (* t -9.0)))))
   (if (<= b -1.15e-112)
     (* b (* a 27.0))
     (if (<= b -2.3e-290)
       (* x 2.0)
       (if (<= b 8.5e-162)
         t_1
         (if (<= b 6.4e-99)
           (* x 2.0)
           (if (<= b 2.15e-61)
             (* (* y (* z t)) -9.0)
             (if (<= b 4.1e+20)
               (* x 2.0)
               (if (<= b 1.55e+80)
                 t_1
                 (if (<= b 3.2e+118) (* x 2.0) (* 27.0 (* a b))))))))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (z * (t * -9.0));
	double tmp;
	if (b <= -1.15e-112) {
		tmp = b * (a * 27.0);
	} else if (b <= -2.3e-290) {
		tmp = x * 2.0;
	} else if (b <= 8.5e-162) {
		tmp = t_1;
	} else if (b <= 6.4e-99) {
		tmp = x * 2.0;
	} else if (b <= 2.15e-61) {
		tmp = (y * (z * t)) * -9.0;
	} else if (b <= 4.1e+20) {
		tmp = x * 2.0;
	} else if (b <= 1.55e+80) {
		tmp = t_1;
	} else if (b <= 3.2e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = y * (z * (t * (-9.0d0)))
    if (b <= (-1.15d-112)) then
        tmp = b * (a * 27.0d0)
    else if (b <= (-2.3d-290)) then
        tmp = x * 2.0d0
    else if (b <= 8.5d-162) then
        tmp = t_1
    else if (b <= 6.4d-99) then
        tmp = x * 2.0d0
    else if (b <= 2.15d-61) then
        tmp = (y * (z * t)) * (-9.0d0)
    else if (b <= 4.1d+20) then
        tmp = x * 2.0d0
    else if (b <= 1.55d+80) then
        tmp = t_1
    else if (b <= 3.2d+118) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (z * (t * -9.0));
	double tmp;
	if (b <= -1.15e-112) {
		tmp = b * (a * 27.0);
	} else if (b <= -2.3e-290) {
		tmp = x * 2.0;
	} else if (b <= 8.5e-162) {
		tmp = t_1;
	} else if (b <= 6.4e-99) {
		tmp = x * 2.0;
	} else if (b <= 2.15e-61) {
		tmp = (y * (z * t)) * -9.0;
	} else if (b <= 4.1e+20) {
		tmp = x * 2.0;
	} else if (b <= 1.55e+80) {
		tmp = t_1;
	} else if (b <= 3.2e+118) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = y * (z * (t * -9.0))
	tmp = 0
	if b <= -1.15e-112:
		tmp = b * (a * 27.0)
	elif b <= -2.3e-290:
		tmp = x * 2.0
	elif b <= 8.5e-162:
		tmp = t_1
	elif b <= 6.4e-99:
		tmp = x * 2.0
	elif b <= 2.15e-61:
		tmp = (y * (z * t)) * -9.0
	elif b <= 4.1e+20:
		tmp = x * 2.0
	elif b <= 1.55e+80:
		tmp = t_1
	elif b <= 3.2e+118:
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(z * Float64(t * -9.0)))
	tmp = 0.0
	if (b <= -1.15e-112)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (b <= -2.3e-290)
		tmp = Float64(x * 2.0);
	elseif (b <= 8.5e-162)
		tmp = t_1;
	elseif (b <= 6.4e-99)
		tmp = Float64(x * 2.0);
	elseif (b <= 2.15e-61)
		tmp = Float64(Float64(y * Float64(z * t)) * -9.0);
	elseif (b <= 4.1e+20)
		tmp = Float64(x * 2.0);
	elseif (b <= 1.55e+80)
		tmp = t_1;
	elseif (b <= 3.2e+118)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (z * (t * -9.0));
	tmp = 0.0;
	if (b <= -1.15e-112)
		tmp = b * (a * 27.0);
	elseif (b <= -2.3e-290)
		tmp = x * 2.0;
	elseif (b <= 8.5e-162)
		tmp = t_1;
	elseif (b <= 6.4e-99)
		tmp = x * 2.0;
	elseif (b <= 2.15e-61)
		tmp = (y * (z * t)) * -9.0;
	elseif (b <= 4.1e+20)
		tmp = x * 2.0;
	elseif (b <= 1.55e+80)
		tmp = t_1;
	elseif (b <= 3.2e+118)
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e-112], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.3e-290], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 8.5e-162], t$95$1, If[LessEqual[b, 6.4e-99], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.15e-61], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision], If[LessEqual[b, 4.1e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.55e+80], t$95$1, If[LessEqual[b, 3.2e+118], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{-112}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-290}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 6.4 \cdot 10^{-99}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{-61}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\

\mathbf{elif}\;b \leq 4.1 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 1.55 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.14999999999999995e-112

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.2%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 51.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.2%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative51.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. *-commutative51.2%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative51.2%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    6. Simplified51.2%

      \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]

    if -1.14999999999999995e-112 < b < -2.3000000000000001e-290 or 8.49999999999999955e-162 < b < 6.4000000000000001e-99 or 2.1500000000000002e-61 < b < 4.1e20 or 1.54999999999999994e80 < b < 3.20000000000000016e118

    1. Initial program 94.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*94.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative97.3%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*97.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around inf 49.4%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -2.3000000000000001e-290 < b < 8.49999999999999955e-162 or 4.1e20 < b < 1.54999999999999994e80

    1. Initial program 95.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*95.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def95.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 49.5%

      \[\leadsto \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutative49.5%

        \[\leadsto \color{blue}{\left(y \cdot \left(t \cdot z\right)\right) \cdot -9} \]
      2. *-commutative49.5%

        \[\leadsto \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \cdot -9 \]
      3. associate-*l*49.4%

        \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot t\right) \cdot -9\right)} \]
      4. associate-*r*49.5%

        \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(t \cdot -9\right)\right)} \]
    6. Simplified49.5%

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

    if 6.4000000000000001e-99 < b < 2.1500000000000002e-61

    1. Initial program 100.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*100.0%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 51.3%

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

    if 3.20000000000000016e118 < b

    1. Initial program 97.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 61.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification51.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-112}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-290}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\ \mathbf{elif}\;b \leq 6.4 \cdot 10^{-99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{-61}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{+20}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 1.55 \cdot 10^{+80}:\\ \;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 7: 98.2% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-129}:\\ \;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4e-129)
   (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* y 9.0) (* z t))))
   (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4e-129) {
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-4d-129)) then
        tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((y * 9.0d0) * (z * t)))
    else
        tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4e-129) {
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4e-129:
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)))
	else:
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4e-129)
		tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(y * 9.0) * Float64(z * t))));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4e-129)
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
	else
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4e-129], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-129}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.9999999999999997e-129

    1. Initial program 94.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-94.9%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg94.9%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-194.9%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval94.9%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval94.9%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv94.9%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval94.9%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity94.9%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*92.1%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*92.1%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified92.1%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]

    if -3.9999999999999997e-129 < z

    1. Initial program 96.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

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

Alternative 8: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{-23}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-52}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.02e-23)
   (- (* x 2.0) (* 9.0 (* y (* z t))))
   (if (<= z 5.8e-52)
     (- (* x 2.0) (* a (* b -27.0)))
     (+ (* -9.0 (* t (* z y))) (* b (* a 27.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.02e-23) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 5.8e-52) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (-9.0 * (t * (z * y))) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-1.02d-23)) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else if (z <= 5.8d-52) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = ((-9.0d0) * (t * (z * y))) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.02e-23) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 5.8e-52) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (-9.0 * (t * (z * y))) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -1.02e-23:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	elif z <= 5.8e-52:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = (-9.0 * (t * (z * y))) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.02e-23)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	elseif (z <= 5.8e-52)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(Float64(-9.0 * Float64(t * Float64(z * y))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -1.02e-23)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	elseif (z <= 5.8e-52)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = (-9.0 * (t * (z * y))) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.02e-23], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-52], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-23}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\

\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.02000000000000005e-23

    1. Initial program 93.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around 0 74.9%

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

    if -1.02000000000000005e-23 < z < 5.8000000000000003e-52

    1. Initial program 97.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-97.3%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg97.3%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-197.3%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval97.3%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval97.3%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv97.3%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval97.3%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity97.3%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]
    4. Taylor expanded in y around 0 81.9%

      \[\leadsto x \cdot 2 - \color{blue}{-27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. *-commutative81.9%

        \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
      2. associate-*r*81.9%

        \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    6. Simplified81.9%

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]

    if 5.8000000000000003e-52 < z

    1. Initial program 96.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*96.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def96.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around 0 68.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv68.2%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
      2. associate-*r*68.3%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      3. metadata-eval68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{-9} \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      4. *-commutative68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \]
      5. associate-*r*72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
    6. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b + -9 \cdot \left(\left(y \cdot z\right) \cdot t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{-23}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-52}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 9: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-47}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -3.1e-24)
   (- (* x 2.0) (* 9.0 (* y (* z t))))
   (if (<= z 7.6e-47)
     (- (* x 2.0) (* a (* b -27.0)))
     (+ (* t (* y (* z -9.0))) (* b (* a 27.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -3.1e-24) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 7.6e-47) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-3.1d-24)) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else if (z <= 7.6d-47) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = (t * (y * (z * (-9.0d0)))) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -3.1e-24) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 7.6e-47) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -3.1e-24:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	elif z <= 7.6e-47:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -3.1e-24)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	elseif (z <= 7.6e-47)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(Float64(t * Float64(y * Float64(z * -9.0))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -3.1e-24)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	elseif (z <= 7.6e-47)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.1e-24], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e-47], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-47}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.1e-24

    1. Initial program 93.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around 0 74.9%

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

    if -3.1e-24 < z < 7.60000000000000029e-47

    1. Initial program 97.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-97.4%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg97.4%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-197.4%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval97.4%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval97.4%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv97.4%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval97.4%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity97.4%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]
    4. Taylor expanded in y around 0 81.4%

      \[\leadsto x \cdot 2 - \color{blue}{-27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. *-commutative81.4%

        \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
      2. associate-*r*81.3%

        \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    6. Simplified81.3%

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]

    if 7.60000000000000029e-47 < z

    1. Initial program 96.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*96.6%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def96.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*90.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative90.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*90.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified90.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around 0 67.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv67.2%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
      2. associate-*r*67.3%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      3. metadata-eval67.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{-9} \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      4. *-commutative67.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \]
      5. associate-*r*71.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
    6. Applied egg-rr71.6%

      \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b + -9 \cdot \left(\left(y \cdot z\right) \cdot t\right)} \]
    7. Taylor expanded in y around 0 67.3%

      \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*67.2%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(-9 \cdot y\right) \cdot \left(t \cdot z\right)} \]
      2. *-commutative67.2%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \left(-9 \cdot y\right) \cdot \color{blue}{\left(z \cdot t\right)} \]
      3. associate-*r*71.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(\left(-9 \cdot y\right) \cdot z\right) \cdot t} \]
      4. associate-*r*71.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(-9 \cdot \left(y \cdot z\right)\right)} \cdot t \]
      5. *-commutative71.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(\left(y \cdot z\right) \cdot -9\right)} \cdot t \]
      6. *-commutative71.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot -9\right)} \]
      7. associate-*l*71.7%

        \[\leadsto \left(27 \cdot a\right) \cdot b + t \cdot \color{blue}{\left(y \cdot \left(z \cdot -9\right)\right)} \]
    9. Simplified71.7%

      \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{t \cdot \left(y \cdot \left(z \cdot -9\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-47}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 10: 81.7% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-30}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-51}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.3e-30)
   (- (* 27.0 (* a b)) (* 9.0 (* y (* z t))))
   (if (<= z 5e-51)
     (- (* x 2.0) (* a (* b -27.0)))
     (+ (* t (* y (* z -9.0))) (* b (* a 27.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.3e-30) {
		tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
	} else if (z <= 5e-51) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-4.3d-30)) then
        tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
    else if (z <= 5d-51) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = (t * (y * (z * (-9.0d0)))) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.3e-30) {
		tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
	} else if (z <= 5e-51) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.3e-30:
		tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)))
	elif z <= 5e-51:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.3e-30)
		tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t))));
	elseif (z <= 5e-51)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(Float64(t * Float64(y * Float64(z * -9.0))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.3e-30)
		tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
	elseif (z <= 5e-51)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = (t * (y * (z * -9.0))) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.3e-30], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-51], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-30}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-51}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.29999999999999966e-30

    1. Initial program 93.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.6%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around 0 66.9%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]

    if -4.29999999999999966e-30 < z < 5.00000000000000004e-51

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-97.2%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg97.2%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-197.2%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval97.2%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval97.2%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv97.2%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval97.2%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity97.2%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]
    4. Taylor expanded in y around 0 81.6%

      \[\leadsto x \cdot 2 - \color{blue}{-27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. *-commutative81.6%

        \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
      2. associate-*r*81.6%

        \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    6. Simplified81.6%

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]

    if 5.00000000000000004e-51 < z

    1. Initial program 96.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*96.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def96.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around 0 68.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv68.2%

        \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
      2. associate-*r*68.3%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} + \left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      3. metadata-eval68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{-9} \cdot \left(y \cdot \left(t \cdot z\right)\right) \]
      4. *-commutative68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \]
      5. associate-*r*72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + -9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
    6. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b + -9 \cdot \left(\left(y \cdot z\right) \cdot t\right)} \]
    7. Taylor expanded in y around 0 68.3%

      \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(-9 \cdot y\right) \cdot \left(t \cdot z\right)} \]
      2. *-commutative68.3%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \left(-9 \cdot y\right) \cdot \color{blue}{\left(z \cdot t\right)} \]
      3. associate-*r*72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(\left(-9 \cdot y\right) \cdot z\right) \cdot t} \]
      4. associate-*r*72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(-9 \cdot \left(y \cdot z\right)\right)} \cdot t \]
      5. *-commutative72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{\left(\left(y \cdot z\right) \cdot -9\right)} \cdot t \]
      6. *-commutative72.5%

        \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{t \cdot \left(\left(y \cdot z\right) \cdot -9\right)} \]
      7. associate-*l*72.6%

        \[\leadsto \left(27 \cdot a\right) \cdot b + t \cdot \color{blue}{\left(y \cdot \left(z \cdot -9\right)\right)} \]
    9. Simplified72.6%

      \[\leadsto \left(27 \cdot a\right) \cdot b + \color{blue}{t \cdot \left(y \cdot \left(z \cdot -9\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-30}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-51}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 11: 74.3% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\ \mathbf{elif}\;z \leq 10^{-34}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.7e-23)
   (* y (* (* z t) -9.0))
   (if (<= z 1e-34) (- (* x 2.0) (* a (* b -27.0))) (* (* y (* z t)) -9.0))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.7e-23) {
		tmp = y * ((z * t) * -9.0);
	} else if (z <= 1e-34) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (y * (z * t)) * -9.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-1.7d-23)) then
        tmp = y * ((z * t) * (-9.0d0))
    else if (z <= 1d-34) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = (y * (z * t)) * (-9.0d0)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.7e-23) {
		tmp = y * ((z * t) * -9.0);
	} else if (z <= 1e-34) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = (y * (z * t)) * -9.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -1.7e-23:
		tmp = y * ((z * t) * -9.0)
	elif z <= 1e-34:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = (y * (z * t)) * -9.0
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.7e-23)
		tmp = Float64(y * Float64(Float64(z * t) * -9.0));
	elseif (z <= 1e-34)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(Float64(y * Float64(z * t)) * -9.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -1.7e-23)
		tmp = y * ((z * t) * -9.0);
	elseif (z <= 1e-34)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = (y * (z * t)) * -9.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.7e-23], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-34], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\

\mathbf{elif}\;z \leq 10^{-34}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e-23

    1. Initial program 93.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*93.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*91.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified91.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 51.1%

      \[\leadsto \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutative51.1%

        \[\leadsto -9 \cdot \left(y \cdot \color{blue}{\left(z \cdot t\right)}\right) \]
      2. *-commutative51.1%

        \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot t\right)\right) \cdot -9} \]
      3. associate-*l*51.1%

        \[\leadsto \color{blue}{y \cdot \left(\left(z \cdot t\right) \cdot -9\right)} \]
      4. *-commutative51.1%

        \[\leadsto y \cdot \left(\color{blue}{\left(t \cdot z\right)} \cdot -9\right) \]
      5. *-commutative51.1%

        \[\leadsto y \cdot \color{blue}{\left(-9 \cdot \left(t \cdot z\right)\right)} \]
    6. Simplified51.1%

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

    if -1.7e-23 < z < 9.99999999999999928e-35

    1. Initial program 97.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-97.4%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg97.4%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-197.4%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval97.4%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval97.4%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv97.4%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval97.4%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity97.4%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*99.8%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]
    4. Taylor expanded in y around 0 81.2%

      \[\leadsto x \cdot 2 - \color{blue}{-27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. *-commutative81.2%

        \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
      2. associate-*r*81.2%

        \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    6. Simplified81.2%

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]

    if 9.99999999999999928e-35 < z

    1. Initial program 96.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*96.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def96.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*90.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative90.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*90.2%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified90.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 39.8%

      \[\leadsto \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-23}:\\ \;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\ \mathbf{elif}\;z \leq 10^{-34}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \end{array} \]

Alternative 12: 78.0% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := y \cdot \left(z \cdot t\right)\\ \mathbf{if}\;y \leq -3.7 \cdot 10^{+76}:\\ \;\;\;\;x \cdot 2 - 9 \cdot t_1\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot -9\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (* z t))))
   (if (<= y -3.7e+76)
     (- (* x 2.0) (* 9.0 t_1))
     (if (<= y 1.5e-109) (- (* x 2.0) (* a (* b -27.0))) (* t_1 -9.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (z * t);
	double tmp;
	if (y <= -3.7e+76) {
		tmp = (x * 2.0) - (9.0 * t_1);
	} else if (y <= 1.5e-109) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = t_1 * -9.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = y * (z * t)
    if (y <= (-3.7d+76)) then
        tmp = (x * 2.0d0) - (9.0d0 * t_1)
    else if (y <= 1.5d-109) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = t_1 * (-9.0d0)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (z * t);
	double tmp;
	if (y <= -3.7e+76) {
		tmp = (x * 2.0) - (9.0 * t_1);
	} else if (y <= 1.5e-109) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = t_1 * -9.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = y * (z * t)
	tmp = 0
	if y <= -3.7e+76:
		tmp = (x * 2.0) - (9.0 * t_1)
	elif y <= 1.5e-109:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = t_1 * -9.0
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(z * t))
	tmp = 0.0
	if (y <= -3.7e+76)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * t_1));
	elseif (y <= 1.5e-109)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(t_1 * -9.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (z * t);
	tmp = 0.0;
	if (y <= -3.7e+76)
		tmp = (x * 2.0) - (9.0 * t_1);
	elseif (y <= 1.5e-109)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = t_1 * -9.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e+76], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-109], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * -9.0), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+76}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t_1\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot -9\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.6999999999999999e76

    1. Initial program 99.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*99.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*99.8%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around 0 77.9%

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

    if -3.6999999999999999e76 < y < 1.50000000000000011e-109

    1. Initial program 96.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-96.9%

        \[\leadsto \color{blue}{x \cdot 2 - \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      2. sub-neg96.9%

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)\right)} \]
      3. neg-mul-196.9%

        \[\leadsto x \cdot 2 + \color{blue}{-1 \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      4. metadata-eval96.9%

        \[\leadsto x \cdot 2 + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      5. metadata-eval96.9%

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      6. cancel-sign-sub-inv96.9%

        \[\leadsto \color{blue}{x \cdot 2 - \left(--1\right) \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      7. metadata-eval96.9%

        \[\leadsto x \cdot 2 - \color{blue}{1} \cdot \left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right) \]
      8. *-lft-identity96.9%

        \[\leadsto x \cdot 2 - \color{blue}{\left(\left(\left(y \cdot 9\right) \cdot z\right) \cdot t - \left(a \cdot 27\right) \cdot b\right)} \]
      9. associate-*l*91.4%

        \[\leadsto x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)} - \left(a \cdot 27\right) \cdot b\right) \]
      10. associate-*l*91.4%

        \[\leadsto x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - \color{blue}{a \cdot \left(27 \cdot b\right)}\right) \]
    3. Simplified91.4%

      \[\leadsto \color{blue}{x \cdot 2 - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - a \cdot \left(27 \cdot b\right)\right)} \]
    4. Taylor expanded in y around 0 77.7%

      \[\leadsto x \cdot 2 - \color{blue}{-27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. *-commutative77.7%

        \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
      2. associate-*r*77.7%

        \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    6. Simplified77.7%

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]

    if 1.50000000000000011e-109 < y

    1. Initial program 92.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative92.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*92.7%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def92.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*97.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative97.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*97.7%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in y around inf 50.5%

      \[\leadsto \color{blue}{-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+76}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\ \end{array} \]

Alternative 13: 45.3% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-111} \lor \neg \left(b \leq 3.2 \cdot 10^{+118}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= b -1.45e-111) (not (<= b 3.2e+118))) (* 27.0 (* a b)) (* x 2.0)))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.45e-111) || !(b <= 3.2e+118)) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((b <= (-1.45d-111)) .or. (.not. (b <= 3.2d+118))) then
        tmp = 27.0d0 * (a * b)
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.45e-111) || !(b <= 3.2e+118)) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -1.45e-111) or not (b <= 3.2e+118):
		tmp = 27.0 * (a * b)
	else:
		tmp = x * 2.0
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -1.45e-111) || !(b <= 3.2e+118))
		tmp = Float64(27.0 * Float64(a * b));
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((b <= -1.45e-111) || ~((b <= 3.2e+118)))
		tmp = 27.0 * (a * b);
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.45e-111], N[Not[LessEqual[b, 3.2e+118]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-111} \lor \neg \left(b \leq 3.2 \cdot 10^{+118}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.45000000000000001e-111 or 3.20000000000000016e118 < b

    1. Initial program 97.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.1%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def98.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.9%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.9%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.9%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 54.5%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]

    if -1.45000000000000001e-111 < b < 3.20000000000000016e118

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.1%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*95.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def95.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around inf 40.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-111} \lor \neg \left(b \leq 3.2 \cdot 10^{+118}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 14: 45.2% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 6.3 \cdot 10^{+119}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.45e-111)
   (* b (* a 27.0))
   (if (<= b 6.3e+119) (* x 2.0) (* 27.0 (* a b)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.45e-111) {
		tmp = b * (a * 27.0);
	} else if (b <= 6.3e+119) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-1.45d-111)) then
        tmp = b * (a * 27.0d0)
    else if (b <= 6.3d+119) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.45e-111) {
		tmp = b * (a * 27.0);
	} else if (b <= 6.3e+119) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.45e-111:
		tmp = b * (a * 27.0)
	elif b <= 6.3e+119:
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.45e-111)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (b <= 6.3e+119)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -1.45e-111)
		tmp = b * (a * 27.0);
	elseif (b <= 6.3e+119)
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.45e-111], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.3e+119], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;b \leq 6.3 \cdot 10^{+119}:\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.45000000000000001e-111

    1. Initial program 97.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.2%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*93.5%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 51.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.2%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative51.2%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. *-commutative51.2%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative51.2%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    6. Simplified51.2%

      \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]

    if -1.45000000000000001e-111 < b < 6.2999999999999998e119

    1. Initial program 95.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.1%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*95.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def95.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*96.0%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in x around inf 40.8%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if 6.2999999999999998e119 < b

    1. Initial program 97.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      2. associate-*l*97.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
      3. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      4. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      5. *-commutative94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
      6. associate-*l*94.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
    3. Simplified94.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
    4. Taylor expanded in a around inf 61.2%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-111}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 6.3 \cdot 10^{+119}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 15: 31.4% accurate, 5.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ x \cdot 2 \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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
    code = x * 2.0d0
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	return x * 2.0
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 96.0%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Step-by-step derivation
    1. +-commutative96.0%

      \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    2. associate-*l*96.0%

      \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) \]
    3. fma-def96.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
    4. associate-*l*95.1%

      \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
    5. *-commutative95.1%

      \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) \]
    6. associate-*l*95.1%

      \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{9 \cdot \left(y \cdot \left(z \cdot t\right)\right)}\right) \]
  3. Simplified95.1%

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)} \]
  4. Taylor expanded in x around inf 33.2%

    \[\leadsto \color{blue}{2 \cdot x} \]
  5. Final simplification33.2%

    \[\leadsto x \cdot 2 \]

Developer target: 95.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (< y 7.590524218811189e-161)
   (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y < 7.590524218811189d-161) then
        tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y < 7.590524218811189e-161:
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y < 7.590524218811189e-161)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y < 7.590524218811189e-161)
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023221 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))

  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))