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

Percentage Accurate: 95.8% → 97.4%
Time: 11.2s
Alternatives: 12
Speedup: 0.7×

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 12 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: 97.4% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+234}:\\ \;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, \left(a \cdot 27\right) \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\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 (<= (* (* y 9.0) z) 5e+234)
   (fma x 2.0 (fma t (* (* y z) -9.0) (* (* a 27.0) b)))
   (- (* x 2.0) (* 9.0 (* y (* z t))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * 9.0) * z) <= 5e+234) {
		tmp = fma(x, 2.0, fma(t, ((y * z) * -9.0), ((a * 27.0) * b)));
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	}
	return tmp;
}
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * 9.0) * z) <= 5e+234)
		tmp = fma(x, 2.0, fma(t, Float64(Float64(y * z) * -9.0), Float64(Float64(a * 27.0) * b)));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	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[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+234], N[(x * 2.0 + N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+234}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, \left(a \cdot 27\right) \cdot b\right)\right)\\

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


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

    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. fma-neg96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e234 < (*.f64 (*.f64 y 9) z)

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

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

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

Alternative 2: 96.5% accurate, 0.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 2 \cdot 10^{+174}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\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 (<= (* (* y 9.0) z) 2e+174)
   (+ (* (* a 27.0) b) (- (* x 2.0) (* t (* y (* 9.0 z)))))
   (- (* x 2.0) (* 9.0 (* y (* z t))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * 9.0) * z) <= 2e+174) {
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (y * (9.0 * z))));
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	}
	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 (((y * 9.0d0) * z) <= 2d+174) then
        tmp = ((a * 27.0d0) * b) + ((x * 2.0d0) - (t * (y * (9.0d0 * z))))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    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 (((y * 9.0) * z) <= 2e+174) {
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (y * (9.0 * z))));
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if ((y * 9.0) * z) <= 2e+174:
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (y * (9.0 * z))))
	else:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * 9.0) * z) <= 2e+174)
		tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	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 (((y * 9.0) * z) <= 2e+174)
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (y * (9.0 * z))));
	else
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	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[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 2e+174], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 2 \cdot 10^{+174}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right)\\

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


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

    1. Initial program 96.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 96.8%

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

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

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

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

    if 2.00000000000000014e174 < (*.f64 (*.f64 y 9) z)

    1. Initial program 82.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. Taylor expanded in a around 0 91.1%

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

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

Alternative 3: 48.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{if}\;z \leq -4.1 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-155}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-266}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 0.00046:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (* -9.0 (* y (* z t)))))
   (if (<= z -4.1e-92)
     t_1
     (if (<= z -1.36e-155)
       (* x 2.0)
       (if (<= z -3.7e-266)
         (* 27.0 (* a b))
         (if (<= z 1.4e-109)
           (* x 2.0)
           (if (<= z 0.00046) (* a (* 27.0 b)) t_1)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (y * (z * t));
	double tmp;
	if (z <= -4.1e-92) {
		tmp = t_1;
	} else if (z <= -1.36e-155) {
		tmp = x * 2.0;
	} else if (z <= -3.7e-266) {
		tmp = 27.0 * (a * b);
	} else if (z <= 1.4e-109) {
		tmp = x * 2.0;
	} else if (z <= 0.00046) {
		tmp = a * (27.0 * b);
	} else {
		tmp = t_1;
	}
	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 = (-9.0d0) * (y * (z * t))
    if (z <= (-4.1d-92)) then
        tmp = t_1
    else if (z <= (-1.36d-155)) then
        tmp = x * 2.0d0
    else if (z <= (-3.7d-266)) then
        tmp = 27.0d0 * (a * b)
    else if (z <= 1.4d-109) then
        tmp = x * 2.0d0
    else if (z <= 0.00046d0) then
        tmp = a * (27.0d0 * b)
    else
        tmp = t_1
    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 = -9.0 * (y * (z * t));
	double tmp;
	if (z <= -4.1e-92) {
		tmp = t_1;
	} else if (z <= -1.36e-155) {
		tmp = x * 2.0;
	} else if (z <= -3.7e-266) {
		tmp = 27.0 * (a * b);
	} else if (z <= 1.4e-109) {
		tmp = x * 2.0;
	} else if (z <= 0.00046) {
		tmp = a * (27.0 * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = -9.0 * (y * (z * t))
	tmp = 0
	if z <= -4.1e-92:
		tmp = t_1
	elif z <= -1.36e-155:
		tmp = x * 2.0
	elif z <= -3.7e-266:
		tmp = 27.0 * (a * b)
	elif z <= 1.4e-109:
		tmp = x * 2.0
	elif z <= 0.00046:
		tmp = a * (27.0 * b)
	else:
		tmp = t_1
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(-9.0 * Float64(y * Float64(z * t)))
	tmp = 0.0
	if (z <= -4.1e-92)
		tmp = t_1;
	elseif (z <= -1.36e-155)
		tmp = Float64(x * 2.0);
	elseif (z <= -3.7e-266)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (z <= 1.4e-109)
		tmp = Float64(x * 2.0);
	elseif (z <= 0.00046)
		tmp = Float64(a * Float64(27.0 * b));
	else
		tmp = t_1;
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -9.0 * (y * (z * t));
	tmp = 0.0;
	if (z <= -4.1e-92)
		tmp = t_1;
	elseif (z <= -1.36e-155)
		tmp = x * 2.0;
	elseif (z <= -3.7e-266)
		tmp = 27.0 * (a * b);
	elseif (z <= 1.4e-109)
		tmp = x * 2.0;
	elseif (z <= 0.00046)
		tmp = a * (27.0 * b);
	else
		tmp = t_1;
	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[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e-92], t$95$1, If[LessEqual[z, -1.36e-155], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -3.7e-266], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-109], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 0.00046], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.36 \cdot 10^{-155}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 0.00046:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.1000000000000002e-92 or 4.6000000000000001e-4 < z

    1. Initial program 91.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. Taylor expanded in y around 0 91.3%

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

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

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

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

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

    if -4.1000000000000002e-92 < z < -1.35999999999999996e-155 or -3.7000000000000003e-266 < z < 1.39999999999999989e-109

    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. associate-+l-99.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. fma-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35999999999999996e-155 < z < -3.7000000000000003e-266

    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. Taylor expanded in y around 0 99.8%

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

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

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

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

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

    if 1.39999999999999989e-109 < z < 4.6000000000000001e-4

    1. Initial program 99.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. associate-+l-99.6%

        \[\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-neg99.6%

        \[\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-199.6%

        \[\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-eval99.6%

        \[\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-eval99.6%

        \[\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-inv99.6%

        \[\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-eval99.6%

        \[\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-identity99.6%

        \[\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.6%

        \[\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.7%

        \[\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.7%

      \[\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 71.9%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 71.9%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in x around 0 34.1%

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

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

        \[\leadsto \color{blue}{a \cdot \left(b \cdot 27\right)} \]
    12. Simplified34.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-92}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-155}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-266}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 0.00046:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \end{array} \]

Alternative 4: 50.2% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-90}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-159}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-265}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 0.00045:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\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 -5.2e-90)
   (* -9.0 (* y (* z t)))
   (if (<= z -2.8e-159)
     (* x 2.0)
     (if (<= z -3.6e-265)
       (* 27.0 (* a b))
       (if (<= z 1.4e-109)
         (* x 2.0)
         (if (<= z 0.00045) (* a (* 27.0 b)) (* z (* t (* y -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 <= -5.2e-90) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= -2.8e-159) {
		tmp = x * 2.0;
	} else if (z <= -3.6e-265) {
		tmp = 27.0 * (a * b);
	} else if (z <= 1.4e-109) {
		tmp = x * 2.0;
	} else if (z <= 0.00045) {
		tmp = a * (27.0 * b);
	} else {
		tmp = z * (t * (y * -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 <= (-5.2d-90)) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (z <= (-2.8d-159)) then
        tmp = x * 2.0d0
    else if (z <= (-3.6d-265)) then
        tmp = 27.0d0 * (a * b)
    else if (z <= 1.4d-109) then
        tmp = x * 2.0d0
    else if (z <= 0.00045d0) then
        tmp = a * (27.0d0 * b)
    else
        tmp = z * (t * (y * (-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 <= -5.2e-90) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= -2.8e-159) {
		tmp = x * 2.0;
	} else if (z <= -3.6e-265) {
		tmp = 27.0 * (a * b);
	} else if (z <= 1.4e-109) {
		tmp = x * 2.0;
	} else if (z <= 0.00045) {
		tmp = a * (27.0 * b);
	} else {
		tmp = z * (t * (y * -9.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -5.2e-90:
		tmp = -9.0 * (y * (z * t))
	elif z <= -2.8e-159:
		tmp = x * 2.0
	elif z <= -3.6e-265:
		tmp = 27.0 * (a * b)
	elif z <= 1.4e-109:
		tmp = x * 2.0
	elif z <= 0.00045:
		tmp = a * (27.0 * b)
	else:
		tmp = z * (t * (y * -9.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -5.2e-90)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (z <= -2.8e-159)
		tmp = Float64(x * 2.0);
	elseif (z <= -3.6e-265)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (z <= 1.4e-109)
		tmp = Float64(x * 2.0);
	elseif (z <= 0.00045)
		tmp = Float64(a * Float64(27.0 * b));
	else
		tmp = Float64(z * Float64(t * Float64(y * -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 <= -5.2e-90)
		tmp = -9.0 * (y * (z * t));
	elseif (z <= -2.8e-159)
		tmp = x * 2.0;
	elseif (z <= -3.6e-265)
		tmp = 27.0 * (a * b);
	elseif (z <= 1.4e-109)
		tmp = x * 2.0;
	elseif (z <= 0.00045)
		tmp = a * (27.0 * b);
	else
		tmp = z * (t * (y * -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, -5.2e-90], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-159], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -3.6e-265], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-109], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 0.00045], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-90}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-159}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 0.00045:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.2000000000000001e-90

    1. Initial program 89.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. Taylor expanded in y around 0 90.0%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Step-by-step derivation
      1. *-commutative90.0%

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

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

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

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

    if -5.2000000000000001e-90 < z < -2.8000000000000002e-159 or -3.6000000000000002e-265 < z < 1.39999999999999989e-109

    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. associate-+l-99.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. fma-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000002e-159 < z < -3.6000000000000002e-265

    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. Taylor expanded in y around 0 99.8%

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

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

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

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

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

    if 1.39999999999999989e-109 < z < 4.4999999999999999e-4

    1. Initial program 99.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. associate-+l-99.6%

        \[\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-neg99.6%

        \[\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-199.6%

        \[\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-eval99.6%

        \[\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-eval99.6%

        \[\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-inv99.6%

        \[\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-eval99.6%

        \[\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-identity99.6%

        \[\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.6%

        \[\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.7%

        \[\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.7%

      \[\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 71.9%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 71.9%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in x around 0 34.1%

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

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

        \[\leadsto \color{blue}{a \cdot \left(b \cdot 27\right)} \]
    12. Simplified34.1%

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

    if 4.4999999999999999e-4 < z

    1. Initial program 92.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. Taylor expanded in y around 0 92.9%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Step-by-step derivation
      1. *-commutative92.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(y \cdot t\right) \cdot -9\right)} \]
    8. Taylor expanded in y around 0 58.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-90}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-159}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-265}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-109}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 0.00045:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\ \end{array} \]

Alternative 5: 80.0% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-87} \lor \neg \left(z \leq 3.5 \cdot 10^{-5}\right):\\ \;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 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 (or (<= z -3.5e-87) (not (<= z 3.5e-5)))
   (+ (* x 2.0) (* (* y t) (* z -9.0)))
   (- (* x 2.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.5e-87) || !(z <= 3.5e-5)) {
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	} else {
		tmp = (x * 2.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.5d-87)) .or. (.not. (z <= 3.5d-5))) then
        tmp = (x * 2.0d0) + ((y * t) * (z * (-9.0d0)))
    else
        tmp = (x * 2.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.5e-87) || !(z <= 3.5e-5)) {
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	} else {
		tmp = (x * 2.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.5e-87) or not (z <= 3.5e-5):
		tmp = (x * 2.0) + ((y * t) * (z * -9.0))
	else:
		tmp = (x * 2.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.5e-87) || !(z <= 3.5e-5))
		tmp = Float64(Float64(x * 2.0) + Float64(Float64(y * t) * Float64(z * -9.0)));
	else
		tmp = Float64(Float64(x * 2.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.5e-87) || ~((z <= 3.5e-5)))
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	else
		tmp = (x * 2.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[Or[LessEqual[z, -3.5e-87], N[Not[LessEqual[z, 3.5e-5]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * t), $MachinePrecision] * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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.5 \cdot 10^{-87} \lor \neg \left(z \leq 3.5 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.50000000000000012e-87 or 3.4999999999999997e-5 < z

    1. Initial program 91.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. Taylor expanded in a around 0 65.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(9 \cdot y\right)} \cdot \left(z \cdot t\right)\right) + x \cdot 2 \]
      10. *-commutative65.9%

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

        \[\leadsto \left(-\color{blue}{9 \cdot \left(y \cdot \left(t \cdot z\right)\right)}\right) + x \cdot 2 \]
      12. distribute-lft-neg-in65.9%

        \[\leadsto \color{blue}{\left(-9\right) \cdot \left(y \cdot \left(t \cdot z\right)\right)} + x \cdot 2 \]
      13. *-commutative65.9%

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

        \[\leadsto \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} \cdot \left(-9\right) + x \cdot 2 \]
      15. *-commutative73.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} \cdot \left(-9\right) + x \cdot 2 \]
      16. metadata-eval73.4%

        \[\leadsto \left(z \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{-9} + x \cdot 2 \]
    4. Applied egg-rr73.4%

      \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right) \cdot -9 + x \cdot 2} \]
    5. Taylor expanded in z around 0 65.9%

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

        \[\leadsto -9 \cdot \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} + x \cdot 2 \]
      2. *-commutative73.4%

        \[\leadsto -9 \cdot \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} + x \cdot 2 \]
      3. *-commutative73.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right) \cdot -9} + x \cdot 2 \]
      4. *-commutative73.4%

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

        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(z \cdot -9\right)} + x \cdot 2 \]
    7. Simplified72.8%

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

    if -3.50000000000000012e-87 < z < 3.4999999999999997e-5

    1. Initial program 99.8%

      \[\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-99.8%

        \[\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-neg99.8%

        \[\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-199.8%

        \[\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-eval99.8%

        \[\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-eval99.8%

        \[\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-inv99.8%

        \[\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-eval99.8%

        \[\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-identity99.8%

        \[\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*98.9%

        \[\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*98.9%

        \[\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. Simplified98.9%

      \[\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 83.7%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 83.7%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in a around 0 83.7%

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

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

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

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

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

Alternative 6: 80.0% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-83}:\\ \;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-5}:\\ \;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\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.35e-83)
   (+ (* x 2.0) (* (* y t) (* z -9.0)))
   (if (<= z 3.2e-5)
     (- (* x 2.0) (* b (* a -27.0)))
     (+ (* x 2.0) (* -9.0 (* z (* y t)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.35e-83) {
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	} else if (z <= 3.2e-5) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	}
	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.35d-83)) then
        tmp = (x * 2.0d0) + ((y * t) * (z * (-9.0d0)))
    else if (z <= 3.2d-5) then
        tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
    else
        tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
    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.35e-83) {
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	} else if (z <= 3.2e-5) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -1.35e-83:
		tmp = (x * 2.0) + ((y * t) * (z * -9.0))
	elif z <= 3.2e-5:
		tmp = (x * 2.0) - (b * (a * -27.0))
	else:
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.35e-83)
		tmp = Float64(Float64(x * 2.0) + Float64(Float64(y * t) * Float64(z * -9.0)));
	elseif (z <= 3.2e-5)
		tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0)));
	else
		tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t))));
	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.35e-83)
		tmp = (x * 2.0) + ((y * t) * (z * -9.0));
	elseif (z <= 3.2e-5)
		tmp = (x * 2.0) - (b * (a * -27.0));
	else
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	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.35e-83], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(y * t), $MachinePrecision] * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-5], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-83}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\

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

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


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

    1. Initial program 89.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in a around 0 54.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      7. +-commutative61.6%

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

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

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

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

        \[\leadsto \left(-\color{blue}{9 \cdot \left(y \cdot \left(t \cdot z\right)\right)}\right) + x \cdot 2 \]
      12. distribute-lft-neg-in54.5%

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} \cdot \left(-9\right) + x \cdot 2 \]
      15. *-commutative63.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} \cdot \left(-9\right) + x \cdot 2 \]
      16. metadata-eval63.4%

        \[\leadsto \left(z \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{-9} + x \cdot 2 \]
    4. Applied egg-rr63.4%

      \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right) \cdot -9 + x \cdot 2} \]
    5. Taylor expanded in z around 0 54.5%

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

        \[\leadsto -9 \cdot \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} + x \cdot 2 \]
      2. *-commutative63.4%

        \[\leadsto -9 \cdot \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} + x \cdot 2 \]
      3. *-commutative63.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right) \cdot -9} + x \cdot 2 \]
      4. *-commutative63.4%

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

        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(z \cdot -9\right)} + x \cdot 2 \]
    7. Simplified63.4%

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

    if -1.34999999999999996e-83 < z < 3.19999999999999986e-5

    1. Initial program 99.8%

      \[\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-99.8%

        \[\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-neg99.8%

        \[\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-199.8%

        \[\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-eval99.8%

        \[\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-eval99.8%

        \[\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-inv99.8%

        \[\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-eval99.8%

        \[\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-identity99.8%

        \[\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*98.9%

        \[\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*98.9%

        \[\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. Simplified98.9%

      \[\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 83.7%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 83.7%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in a around 0 83.7%

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

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

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

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

    if 3.19999999999999986e-5 < z

    1. Initial program 92.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. Taylor expanded in a around 0 79.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      7. +-commutative80.0%

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

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

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

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

        \[\leadsto \left(-\color{blue}{9 \cdot \left(y \cdot \left(t \cdot z\right)\right)}\right) + x \cdot 2 \]
      12. distribute-lft-neg-in79.5%

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} \cdot \left(-9\right) + x \cdot 2 \]
      15. *-commutative85.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} \cdot \left(-9\right) + x \cdot 2 \]
      16. metadata-eval85.4%

        \[\leadsto \left(z \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{-9} + x \cdot 2 \]
    4. Applied egg-rr85.4%

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

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

Alternative 7: 80.2% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{-87}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-5}:\\ \;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\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 -6e-87)
   (- (* x 2.0) (* 9.0 (* y (* z t))))
   (if (<= z 3.5e-5)
     (- (* x 2.0) (* b (* a -27.0)))
     (+ (* x 2.0) (* -9.0 (* z (* y t)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -6e-87) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 3.5e-5) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	}
	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 <= (-6d-87)) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else if (z <= 3.5d-5) then
        tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
    else
        tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
    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 <= -6e-87) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (z <= 3.5e-5) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -6e-87:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	elif z <= 3.5e-5:
		tmp = (x * 2.0) - (b * (a * -27.0))
	else:
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -6e-87)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	elseif (z <= 3.5e-5)
		tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0)));
	else
		tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t))));
	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 <= -6e-87)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	elseif (z <= 3.5e-5)
		tmp = (x * 2.0) - (b * (a * -27.0));
	else
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	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, -6e-87], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-5], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-87}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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

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


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

    1. Initial program 89.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in a around 0 54.5%

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

    if -6.00000000000000033e-87 < z < 3.4999999999999997e-5

    1. Initial program 99.8%

      \[\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-99.8%

        \[\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-neg99.8%

        \[\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-199.8%

        \[\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-eval99.8%

        \[\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-eval99.8%

        \[\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-inv99.8%

        \[\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-eval99.8%

        \[\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-identity99.8%

        \[\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*98.9%

        \[\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*98.9%

        \[\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. Simplified98.9%

      \[\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 83.7%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 83.7%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in a around 0 83.7%

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

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

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

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

    if 3.4999999999999997e-5 < z

    1. Initial program 92.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. Taylor expanded in a around 0 79.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} \]
      7. +-commutative80.0%

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

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

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

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

        \[\leadsto \left(-\color{blue}{9 \cdot \left(y \cdot \left(t \cdot z\right)\right)}\right) + x \cdot 2 \]
      12. distribute-lft-neg-in79.5%

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

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

        \[\leadsto \color{blue}{\left(\left(y \cdot t\right) \cdot z\right)} \cdot \left(-9\right) + x \cdot 2 \]
      15. *-commutative85.4%

        \[\leadsto \color{blue}{\left(z \cdot \left(y \cdot t\right)\right)} \cdot \left(-9\right) + x \cdot 2 \]
      16. metadata-eval85.4%

        \[\leadsto \left(z \cdot \left(y \cdot t\right)\right) \cdot \color{blue}{-9} + x \cdot 2 \]
    4. Applied egg-rr85.4%

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

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

Alternative 8: 74.1% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{-83}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 0.046:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\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 -2.5e-83)
   (* -9.0 (* y (* z t)))
   (if (<= z 0.046) (- (* x 2.0) (* a (* b -27.0))) (* z (* t (* y -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 <= -2.5e-83) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 0.046) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = z * (t * (y * -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 <= (-2.5d-83)) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (z <= 0.046d0) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = z * (t * (y * (-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 <= -2.5e-83) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 0.046) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = z * (t * (y * -9.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -2.5e-83:
		tmp = -9.0 * (y * (z * t))
	elif z <= 0.046:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = z * (t * (y * -9.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -2.5e-83)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (z <= 0.046)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(z * Float64(t * Float64(y * -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 <= -2.5e-83)
		tmp = -9.0 * (y * (z * t));
	elseif (z <= 0.046)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = z * (t * (y * -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, -2.5e-83], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.046], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-83}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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

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


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

    1. Initial program 89.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 89.8%

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

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

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

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

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

    if -2.5e-83 < z < 0.045999999999999999

    1. Initial program 99.8%

      \[\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-99.8%

        \[\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-neg99.8%

        \[\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-199.8%

        \[\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-eval99.8%

        \[\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-eval99.8%

        \[\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-inv99.8%

        \[\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-eval99.8%

        \[\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-identity99.8%

        \[\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*98.9%

        \[\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*98.9%

        \[\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. Simplified98.9%

      \[\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 83.7%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 83.7%

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

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

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

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

    if 0.045999999999999999 < z

    1. Initial program 92.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. Taylor expanded in y around 0 92.9%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Step-by-step derivation
      1. *-commutative92.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(y \cdot t\right) \cdot -9\right)} \]
    8. Taylor expanded in y around 0 58.6%

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

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

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

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

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

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

Alternative 9: 74.0% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{-83}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 0.0052:\\ \;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\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 -2.5e-83)
   (* -9.0 (* y (* z t)))
   (if (<= z 0.0052) (- (* x 2.0) (* b (* a -27.0))) (* z (* t (* y -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 <= -2.5e-83) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 0.0052) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = z * (t * (y * -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 <= (-2.5d-83)) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (z <= 0.0052d0) then
        tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
    else
        tmp = z * (t * (y * (-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 <= -2.5e-83) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 0.0052) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = z * (t * (y * -9.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -2.5e-83:
		tmp = -9.0 * (y * (z * t))
	elif z <= 0.0052:
		tmp = (x * 2.0) - (b * (a * -27.0))
	else:
		tmp = z * (t * (y * -9.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -2.5e-83)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (z <= 0.0052)
		tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0)));
	else
		tmp = Float64(z * Float64(t * Float64(y * -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 <= -2.5e-83)
		tmp = -9.0 * (y * (z * t));
	elseif (z <= 0.0052)
		tmp = (x * 2.0) - (b * (a * -27.0));
	else
		tmp = z * (t * (y * -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, -2.5e-83], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0052], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-83}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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

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


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

    1. Initial program 89.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 89.8%

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

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

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

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

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

    if -2.5e-83 < z < 0.0051999999999999998

    1. Initial program 99.8%

      \[\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-99.8%

        \[\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-neg99.8%

        \[\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-199.8%

        \[\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-eval99.8%

        \[\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-eval99.8%

        \[\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-inv99.8%

        \[\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-eval99.8%

        \[\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-identity99.8%

        \[\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*98.9%

        \[\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*98.9%

        \[\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. Simplified98.9%

      \[\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 83.7%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 83.7%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in a around 0 83.7%

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

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

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

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

    if 0.0051999999999999998 < z

    1. Initial program 92.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. Taylor expanded in y around 0 92.9%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Step-by-step derivation
      1. *-commutative92.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(y \cdot t\right) \cdot -9\right)} \]
    8. Taylor expanded in y around 0 58.6%

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

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

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

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

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

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

Alternative 10: 46.4% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -6.2 \cdot 10^{-59} \lor \neg \left(b \leq 2.1 \cdot 10^{+114}\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 -6.2e-59) (not (<= b 2.1e+114))) (* 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 <= -6.2e-59) || !(b <= 2.1e+114)) {
		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 <= (-6.2d-59)) .or. (.not. (b <= 2.1d+114))) 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 <= -6.2e-59) || !(b <= 2.1e+114)) {
		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 <= -6.2e-59) or not (b <= 2.1e+114):
		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 <= -6.2e-59) || !(b <= 2.1e+114))
		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 <= -6.2e-59) || ~((b <= 2.1e+114)))
		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, -6.2e-59], N[Not[LessEqual[b, 2.1e+114]], $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 -6.2 \cdot 10^{-59} \lor \neg \left(b \leq 2.1 \cdot 10^{+114}\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 < -6.19999999999999998e-59 or 2.1e114 < b

    1. Initial program 91.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. Taylor expanded in y around 0 91.4%

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

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

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

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

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

    if -6.19999999999999998e-59 < b < 2.1e114

    1. Initial program 97.8%

      \[\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.8%

        \[\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. fma-neg97.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b\right) \]
      7. distribute-rgt-neg-in97.8%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 46.4% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{-58}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{+114}:\\ \;\;\;\;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.35e-58)
   (* a (* 27.0 b))
   (if (<= b 2.15e+114) (* 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.35e-58) {
		tmp = a * (27.0 * b);
	} else if (b <= 2.15e+114) {
		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.35d-58)) then
        tmp = a * (27.0d0 * b)
    else if (b <= 2.15d+114) 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.35e-58) {
		tmp = a * (27.0 * b);
	} else if (b <= 2.15e+114) {
		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.35e-58:
		tmp = a * (27.0 * b)
	elif b <= 2.15e+114:
		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.35e-58)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (b <= 2.15e+114)
		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.35e-58)
		tmp = a * (27.0 * b);
	elseif (b <= 2.15e+114)
		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.35e-58], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.15e+114], 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.35 \cdot 10^{-58}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{+114}:\\
\;\;\;\;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.3499999999999999e-58

    1. Initial program 95.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-95.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-neg95.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-195.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-eval95.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-eval95.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-inv95.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-eval95.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-identity95.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*93.9%

        \[\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*93.9%

        \[\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. Simplified93.9%

      \[\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 70.2%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left(a \cdot b\right) \cdot -27} \]
    7. Taylor expanded in a around 0 70.2%

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

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

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

      \[\leadsto x \cdot 2 - \color{blue}{a \cdot \left(b \cdot -27\right)} \]
    10. Taylor expanded in x around 0 38.1%

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

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

        \[\leadsto \color{blue}{a \cdot \left(b \cdot 27\right)} \]
    12. Simplified38.1%

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

    if -1.3499999999999999e-58 < b < 2.15e114

    1. Initial program 97.8%

      \[\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.8%

        \[\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. fma-neg97.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot z\right)}\right) + \left(a \cdot 27\right) \cdot b\right) \]
      7. distribute-rgt-neg-in97.8%

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

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

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

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

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

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

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

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

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

    if 2.15e114 < b

    1. Initial program 82.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. Taylor expanded in y around 0 82.1%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Step-by-step derivation
      1. *-commutative82.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{-58}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{+114}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 12: 31.2% 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 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. fma-neg94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 95.3% 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 2023238 
(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)))