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

Percentage Accurate: 95.3% → 98.5%
Time: 13.8s
Alternatives: 16
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.49999999999999959e32

    1. Initial program 95.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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999959e32 < z

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.0% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.40000000000000007e56

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

    if 6.40000000000000007e56 < z

    1. Initial program 85.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u43.7%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef43.7%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative43.7%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(t \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      4. associate-*r*47.2%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right) \cdot y}\right)} - 1\right) \]
    6. Applied egg-rr47.2%

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def47.3%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)\right)} \]
      2. expm1-log1p75.5%

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

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

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

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(z \cdot \left(t \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. sub-neg79.4%

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.10000000000000009e31

    1. Initial program 95.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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

    if 6.10000000000000009e31 < z

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.0% accurate, 0.9× speedup?

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

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


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

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999984e-123 < z

    1. Initial program 95.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 94.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. Recombined 2 regimes into one program.
  4. Final simplification93.3%

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

Alternative 5: 98.0% accurate, 0.9× speedup?

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

    if -1e3 < z

    1. Initial program 95.6%

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

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

Alternative 6: 49.1% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot 27\right)\\ t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{-62}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-179}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-191}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_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
 (let* ((t_1 (* b (* a 27.0))) (t_2 (* -9.0 (* t (* z y)))))
   (if (<= z -1.45e-62)
     t_2
     (if (<= z -2.75e-179)
       (* x 2.0)
       (if (<= z -1.5e-259)
         t_1
         (if (<= z 2.25e-191) (* x 2.0) (if (<= z 3.3e-25) t_1 t_2)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a * 27.0);
	double t_2 = -9.0 * (t * (z * y));
	double tmp;
	if (z <= -1.45e-62) {
		tmp = t_2;
	} else if (z <= -2.75e-179) {
		tmp = x * 2.0;
	} else if (z <= -1.5e-259) {
		tmp = t_1;
	} else if (z <= 2.25e-191) {
		tmp = x * 2.0;
	} else if (z <= 3.3e-25) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = b * (a * 27.0d0)
    t_2 = (-9.0d0) * (t * (z * y))
    if (z <= (-1.45d-62)) then
        tmp = t_2
    else if (z <= (-2.75d-179)) then
        tmp = x * 2.0d0
    else if (z <= (-1.5d-259)) then
        tmp = t_1
    else if (z <= 2.25d-191) then
        tmp = x * 2.0d0
    else if (z <= 3.3d-25) then
        tmp = t_1
    else
        tmp = t_2
    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 = b * (a * 27.0);
	double t_2 = -9.0 * (t * (z * y));
	double tmp;
	if (z <= -1.45e-62) {
		tmp = t_2;
	} else if (z <= -2.75e-179) {
		tmp = x * 2.0;
	} else if (z <= -1.5e-259) {
		tmp = t_1;
	} else if (z <= 2.25e-191) {
		tmp = x * 2.0;
	} else if (z <= 3.3e-25) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = b * (a * 27.0)
	t_2 = -9.0 * (t * (z * y))
	tmp = 0
	if z <= -1.45e-62:
		tmp = t_2
	elif z <= -2.75e-179:
		tmp = x * 2.0
	elif z <= -1.5e-259:
		tmp = t_1
	elif z <= 2.25e-191:
		tmp = x * 2.0
	elif z <= 3.3e-25:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a * 27.0))
	t_2 = Float64(-9.0 * Float64(t * Float64(z * y)))
	tmp = 0.0
	if (z <= -1.45e-62)
		tmp = t_2;
	elseif (z <= -2.75e-179)
		tmp = Float64(x * 2.0);
	elseif (z <= -1.5e-259)
		tmp = t_1;
	elseif (z <= 2.25e-191)
		tmp = Float64(x * 2.0);
	elseif (z <= 3.3e-25)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a * 27.0);
	t_2 = -9.0 * (t * (z * y));
	tmp = 0.0;
	if (z <= -1.45e-62)
		tmp = t_2;
	elseif (z <= -2.75e-179)
		tmp = x * 2.0;
	elseif (z <= -1.5e-259)
		tmp = t_1;
	elseif (z <= 2.25e-191)
		tmp = x * 2.0;
	elseif (z <= 3.3e-25)
		tmp = t_1;
	else
		tmp = t_2;
	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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-62], t$95$2, If[LessEqual[z, -2.75e-179], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.5e-259], t$95$1, If[LessEqual[z, 2.25e-191], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.3e-25], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-62}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -2.75 \cdot 10^{-179}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-259}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.25 \cdot 10^{-191}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.44999999999999993e-62 or 3.2999999999999998e-25 < z

    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. Step-by-step derivation
      1. sub-neg89.8%

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

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

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

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

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

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

    if -1.44999999999999993e-62 < z < -2.7500000000000001e-179 or -1.5000000000000001e-259 < z < 2.25000000000000004e-191

    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. sub-neg99.9%

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

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

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

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

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

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

    if -2.7500000000000001e-179 < z < -1.5000000000000001e-259 or 2.25000000000000004e-191 < z < 3.2999999999999998e-25

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]
    7. Simplified49.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-62}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;z \leq -2.75 \cdot 10^{-179}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-259}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-191}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-25}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 50.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-180}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-253}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-192}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-23}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.6999999999999998e-62

    1. Initial program 90.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.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. Taylor expanded in y around inf 51.3%

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

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

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

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

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

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

    if -3.6999999999999998e-62 < z < -8.4999999999999993e-180 or -1.02e-253 < z < 9.4999999999999996e-192

    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. sub-neg99.9%

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

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

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

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

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

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

    if -8.4999999999999993e-180 < z < -1.02e-253 or 9.4999999999999996e-192 < z < 7.4999999999999998e-23

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]
    7. Simplified50.8%

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

    if 7.4999999999999998e-23 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{-62}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-180}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-253}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-192}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-23}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]

Alternative 8: 80.9% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.56000000000000009e-62 or 1.50000000000000001e-28 < z

    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. Step-by-step derivation
      1. sub-neg89.8%

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u50.9%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative47.2%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(t \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      4. associate-*r*49.1%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right) \cdot y}\right)} - 1\right) \]
    6. Applied egg-rr49.1%

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def52.7%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)\right)} \]
      2. expm1-log1p75.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.56000000000000009e-62 < z < 1.50000000000000001e-28

    1. Initial program 98.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. sub-neg98.8%

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

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

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

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

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

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

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

Alternative 9: 80.9% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 90.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. sub-neg90.9%

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u53.3%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef46.9%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative46.9%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(t \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      4. associate-*r*48.1%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right) \cdot y}\right)} - 1\right) \]
    6. Applied egg-rr48.1%

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def54.5%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)\right)} \]
      2. expm1-log1p73.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right) + 2 \cdot x} \]
    11. Step-by-step derivation
      1. expm1-log1p-u64.9%

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

        \[\leadsto z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(-9 \cdot \left(t \cdot y\right)\right)} - 1\right)} + 2 \cdot x \]
      3. *-commutative50.6%

        \[\leadsto z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot y\right) \cdot -9}\right)} - 1\right) + 2 \cdot x \]
      4. associate-*l*50.6%

        \[\leadsto z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{t \cdot \left(y \cdot -9\right)}\right)} - 1\right) + 2 \cdot x \]
    12. Applied egg-rr50.6%

      \[\leadsto z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot -9\right)\right)} - 1\right)} + 2 \cdot x \]
    13. Step-by-step derivation
      1. expm1-def64.9%

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

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

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

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

    if -3.0000000000000001e-62 < z < 1.1e-22

    1. Initial program 98.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. sub-neg98.8%

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

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

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

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

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

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

    if 1.1e-22 < z

    1. Initial program 88.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u47.7%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef47.7%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative47.7%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(t \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      4. associate-*r*50.4%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right) \cdot y}\right)} - 1\right) \]
    6. Applied egg-rr50.4%

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def50.4%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)\right)} \]
      2. expm1-log1p79.3%

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

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

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

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(z \cdot \left(t \cdot y\right)\right)} \]
    9. Step-by-step derivation
      1. sub-neg80.9%

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

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

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

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

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

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

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

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

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

Alternative 10: 81.0% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 90.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. sub-neg90.9%

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u53.3%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef46.9%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative46.9%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(t \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      4. associate-*r*48.1%

        \[\leadsto 2 \cdot x - 9 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right) \cdot y}\right)} - 1\right) \]
    6. Applied egg-rr48.1%

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)} - 1\right)} \]
    7. Step-by-step derivation
      1. expm1-def54.5%

        \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot y\right)\right)} \]
      2. expm1-log1p73.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right) + 2 \cdot x} \]
    11. Step-by-step derivation
      1. expm1-log1p-u64.9%

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

        \[\leadsto z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(-9 \cdot \left(t \cdot y\right)\right)} - 1\right)} + 2 \cdot x \]
      3. *-commutative50.6%

        \[\leadsto z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot y\right) \cdot -9}\right)} - 1\right) + 2 \cdot x \]
      4. associate-*l*50.6%

        \[\leadsto z \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{t \cdot \left(y \cdot -9\right)}\right)} - 1\right) + 2 \cdot x \]
    12. Applied egg-rr50.6%

      \[\leadsto z \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(t \cdot \left(y \cdot -9\right)\right)} - 1\right)} + 2 \cdot x \]
    13. Step-by-step derivation
      1. expm1-def64.9%

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

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

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

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

    if -1.90000000000000003e-62 < z < 3.80000000000000009e-28

    1. Initial program 98.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. sub-neg98.8%

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

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

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

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

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

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

    if 3.80000000000000009e-28 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

Alternative 11: 81.2% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 90.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. sub-neg90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e-62 < z < 1.45000000000000006e-28

    1. Initial program 98.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. sub-neg98.8%

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

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

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

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

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

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

    if 1.45000000000000006e-28 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

Alternative 12: 76.4% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 89.5%

      \[\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.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. Taylor expanded in y around inf 57.9%

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

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

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

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

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

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

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

    if -4.50000000000000011e-6 < z < 1.94999999999999999e-22

    1. Initial program 98.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. sub-neg98.8%

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

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

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

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

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

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

    if 1.94999999999999999e-22 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

Alternative 13: 48.3% accurate, 1.9× speedup?

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

    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. Step-by-step derivation
      1. sub-neg92.9%

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

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

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

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

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

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

    if -2.19999999999999996e-93 < b < 3.7e-9

    1. Initial program 95.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-93} \lor \neg \left(b \leq 3.7 \cdot 10^{-9}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 14: 48.3% 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^{-92}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{-9}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \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-92)
   (* 27.0 (* a b))
   (if (<= b 3.8e-9) (* x 2.0) (* a (* 27.0 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-92) {
		tmp = 27.0 * (a * b);
	} else if (b <= 3.8e-9) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * 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-92)) then
        tmp = 27.0d0 * (a * b)
    else if (b <= 3.8d-9) then
        tmp = x * 2.0d0
    else
        tmp = a * (27.0d0 * 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-92) {
		tmp = 27.0 * (a * b);
	} else if (b <= 3.8e-9) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.35e-92:
		tmp = 27.0 * (a * b)
	elif b <= 3.8e-9:
		tmp = x * 2.0
	else:
		tmp = a * (27.0 * 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-92)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (b <= 3.8e-9)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(a * Float64(27.0 * 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-92)
		tmp = 27.0 * (a * b);
	elseif (b <= 3.8e-9)
		tmp = x * 2.0;
	else
		tmp = a * (27.0 * 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-92], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e-9], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * 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^{-92}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;b \leq 3.8 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if -1.34999999999999998e-92 < b < 3.80000000000000011e-9

    1. Initial program 95.7%

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

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

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

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

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

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

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

    if 3.80000000000000011e-9 < b

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 48.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \left(27 \cdot a\right)} \]
    7. Simplified41.0%

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

    if -1.25000000000000003e-92 < b < 2e-8

    1. Initial program 95.7%

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

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

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

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

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

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

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

    if 2e-8 < b

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-92}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-8}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 16: 31.8% 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.0%

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

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 94.8% 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 2023305 
(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)))