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

Percentage Accurate: 95.7% → 99.0%
Time: 14.8s
Alternatives: 14
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 14 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.7% 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: 99.0% accurate, 0.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999992e-72 < z

    1. Initial program 90.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Simplified91.9%

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

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

Alternative 2: 98.9% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y 9) < -1.00000000000000004e-10

    1. Initial program 90.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. Simplified98.5%

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

    if -1.00000000000000004e-10 < (*.f64 y 9)

    1. Initial program 94.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*94.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 \]
    3. Simplified94.1%

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

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

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

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

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

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

Alternative 3: 97.2% accurate, 0.8× speedup?

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

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


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

    1. Initial program 86.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. associate-*l*92.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 \]
    3. Simplified92.9%

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

    if -1.9999999999999998e131 < (*.f64 y 9)

    1. Initial program 95.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. 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 \]
    3. Simplified94.9%

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

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

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

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

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

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

Alternative 4: 97.1% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 6.6 \cdot 10^{+121}:\\ \;\;\;\;b \cdot \left(27 \cdot a\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\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 6.6e+121)
   (+ (* b (* 27.0 a)) (- (* x 2.0) (* (* y 9.0) (* z t))))
   (- (* 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 <= 6.6e+121) {
		tmp = (b * (27.0 * a)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
	} 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 <= 6.6d+121) then
        tmp = (b * (27.0d0 * a)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
    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 <= 6.6e+121) {
		tmp = (b * (27.0 * a)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
	} 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 <= 6.6e+121:
		tmp = (b * (27.0 * a)) + ((x * 2.0) - ((y * 9.0) * (z * t)))
	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 <= 6.6e+121)
		tmp = Float64(Float64(b * Float64(27.0 * a)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))));
	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 <= 6.6e+121)
		tmp = (b * (27.0 * a)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
	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, 6.6e+121], N[(N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $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 6.6 \cdot 10^{+121}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\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 2 regimes
  2. if z < 6.59999999999999958e121

    1. Initial program 95.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*95.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 \]
    3. Simplified95.6%

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

    if 6.59999999999999958e121 < z

    1. Initial program 80.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*86.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 \]
    3. Simplified86.7%

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

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

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

Alternative 5: 98.1% accurate, 0.9× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999993e-102 < z

    1. Initial program 91.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*93.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 \]
    3. Simplified93.5%

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

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

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

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

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

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

Alternative 6: 44.2% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{if}\;y \leq -4.1 \cdot 10^{+138}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+112}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -62000000000000 \lor \neg \left(y \leq -3.2 \cdot 10^{-53}\right) \land y \leq -2.25 \cdot 10^{-113}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* -9.0 (* t (* z y)))))
   (if (<= y -4.1e+138)
     t_1
     (if (<= y -1.45e+112)
       (* x 2.0)
       (if (<= y -6.2e+106)
         t_1
         (if (or (<= y -62000000000000.0)
                 (and (not (<= y -3.2e-53)) (<= y -2.25e-113)))
           (* x 2.0)
           (* 27.0 (* a b))))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (z * y));
	double tmp;
	if (y <= -4.1e+138) {
		tmp = t_1;
	} else if (y <= -1.45e+112) {
		tmp = x * 2.0;
	} else if (y <= -6.2e+106) {
		tmp = t_1;
	} else if ((y <= -62000000000000.0) || (!(y <= -3.2e-53) && (y <= -2.25e-113))) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-9.0d0) * (t * (z * y))
    if (y <= (-4.1d+138)) then
        tmp = t_1
    else if (y <= (-1.45d+112)) then
        tmp = x * 2.0d0
    else if (y <= (-6.2d+106)) then
        tmp = t_1
    else if ((y <= (-62000000000000.0d0)) .or. (.not. (y <= (-3.2d-53))) .and. (y <= (-2.25d-113))) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (z * y));
	double tmp;
	if (y <= -4.1e+138) {
		tmp = t_1;
	} else if (y <= -1.45e+112) {
		tmp = x * 2.0;
	} else if (y <= -6.2e+106) {
		tmp = t_1;
	} else if ((y <= -62000000000000.0) || (!(y <= -3.2e-53) && (y <= -2.25e-113))) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = -9.0 * (t * (z * y))
	tmp = 0
	if y <= -4.1e+138:
		tmp = t_1
	elif y <= -1.45e+112:
		tmp = x * 2.0
	elif y <= -6.2e+106:
		tmp = t_1
	elif (y <= -62000000000000.0) or (not (y <= -3.2e-53) and (y <= -2.25e-113)):
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(-9.0 * Float64(t * Float64(z * y)))
	tmp = 0.0
	if (y <= -4.1e+138)
		tmp = t_1;
	elseif (y <= -1.45e+112)
		tmp = Float64(x * 2.0);
	elseif (y <= -6.2e+106)
		tmp = t_1;
	elseif ((y <= -62000000000000.0) || (!(y <= -3.2e-53) && (y <= -2.25e-113)))
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -9.0 * (t * (z * y));
	tmp = 0.0;
	if (y <= -4.1e+138)
		tmp = t_1;
	elseif (y <= -1.45e+112)
		tmp = x * 2.0;
	elseif (y <= -6.2e+106)
		tmp = t_1;
	elseif ((y <= -62000000000000.0) || (~((y <= -3.2e-53)) && (y <= -2.25e-113)))
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.1e+138], t$95$1, If[LessEqual[y, -1.45e+112], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -6.2e+106], t$95$1, If[Or[LessEqual[y, -62000000000000.0], And[N[Not[LessEqual[y, -3.2e-53]], $MachinePrecision], LessEqual[y, -2.25e-113]]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+138}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{+106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -62000000000000 \lor \neg \left(y \leq -3.2 \cdot 10^{-53}\right) \land y \leq -2.25 \cdot 10^{-113}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.0999999999999998e138 or -1.4500000000000001e112 < y < -6.1999999999999999e106

    1. Initial program 84.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. Simplified97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0999999999999998e138 < y < -1.4500000000000001e112 or -6.1999999999999999e106 < y < -6.2e13 or -3.2000000000000001e-53 < y < -2.2500000000000001e-113

    1. Initial program 97.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. Simplified99.7%

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

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

    if -6.2e13 < y < -3.2000000000000001e-53 or -2.2500000000000001e-113 < y

    1. Initial program 94.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. Simplified93.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+138}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+112}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{+106}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -62000000000000 \lor \neg \left(y \leq -3.2 \cdot 10^{-53}\right) \land y \leq -2.25 \cdot 10^{-113}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 7: 45.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;y \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq -6.8 \cdot 10^{+106}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

\mathbf{elif}\;y \leq -2100000000000 \lor \neg \left(y \leq -3.1 \cdot 10^{-53}\right) \land y \leq -1.86 \cdot 10^{-115}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.0999999999999998e138

    1. Initial program 83.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Simplified97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0999999999999998e138 < y < -1.4500000000000001e112 or -6.79999999999999989e106 < y < -2.1e12 or -3.10000000000000015e-53 < y < -1.86e-115

    1. Initial program 97.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. Simplified99.7%

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

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

    if -1.4500000000000001e112 < y < -6.79999999999999989e106

    1. Initial program 100.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Simplified100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1e12 < y < -3.10000000000000015e-53 or -1.86e-115 < y

    1. Initial program 94.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. Simplified93.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+138}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+112}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{+106}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -2100000000000 \lor \neg \left(y \leq -3.1 \cdot 10^{-53}\right) \land y \leq -1.86 \cdot 10^{-115}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 8: 75.7% accurate, 1.0× speedup?

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

\mathbf{elif}\;a \leq 3.5 \cdot 10^{-120}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(z \cdot \left(9 \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.8999999999999998e-7

    1. Initial program 94.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Simplified99.7%

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

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

    if -2.8999999999999998e-7 < a < 3.5e-120

    1. Initial program 95.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*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 \]
    3. Simplified91.2%

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

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

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

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

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

      \[\leadsto 2 \cdot x - 9 \cdot \color{blue}{{\left(y \cdot \left(z \cdot t\right)\right)}^{1}} \]
    7. Taylor expanded in y around 0 82.7%

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

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

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

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

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

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

    if 3.5e-120 < a

    1. Initial program 91.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. 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 \]
    3. Simplified95.1%

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

      \[\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. cancel-sign-sub-inv63.4%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 77.2% accurate, 1.1× speedup?

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

\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 2 regimes
  2. if a < -4.5999999999999999e-7 or 4.89999999999999971e-30 < a

    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. Simplified97.7%

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

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

    if -4.5999999999999999e-7 < a < 4.89999999999999971e-30

    1. Initial program 94.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*92.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 \]
    3. Simplified92.6%

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

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

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

Alternative 10: 77.1% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.55e-7 or 1.08e-38 < a

    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. Simplified97.7%

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

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

    if -1.55e-7 < a < 1.08e-38

    1. Initial program 94.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-*l*92.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 \]
    3. Simplified92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 76.3% accurate, 1.3× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-16 < z < 2.49999999999999985e38

    1. Initial program 99.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. Simplified99.1%

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

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

    if 2.49999999999999985e38 < z

    1. Initial program 86.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Simplified91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.8% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-41} \lor \neg \left(b \leq 5.1 \cdot 10^{+91}\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 -4e-41) (not (<= b 5.1e+91))) (* 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 <= -4e-41) || !(b <= 5.1e+91)) {
		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 <= (-4d-41)) .or. (.not. (b <= 5.1d+91))) 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 <= -4e-41) || !(b <= 5.1e+91)) {
		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 <= -4e-41) or not (b <= 5.1e+91):
		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 <= -4e-41) || !(b <= 5.1e+91))
		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 <= -4e-41) || ~((b <= 5.1e+91)))
		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, -4e-41], N[Not[LessEqual[b, 5.1e+91]], $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 -4 \cdot 10^{-41} \lor \neg \left(b \leq 5.1 \cdot 10^{+91}\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 < -4.00000000000000002e-41 or 5.10000000000000013e91 < b

    1. Initial program 94.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. Simplified97.2%

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

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

    if -4.00000000000000002e-41 < b < 5.10000000000000013e91

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

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

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

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

Alternative 13: 48.0% accurate, 1.9× speedup?

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

\mathbf{elif}\;b \leq 9.5 \cdot 10^{+92}:\\
\;\;\;\;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 < -3.4999999999999999e-32

    1. Initial program 94.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. Simplified97.2%

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

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

    if -3.4999999999999999e-32 < b < 9.4999999999999995e92

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

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

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

    if 9.4999999999999995e92 < b

    1. Initial program 94.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. Simplified97.0%

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

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

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

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

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

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

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

Alternative 14: 31.2% accurate, 5.7× speedup?

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

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

    \[\leadsto \color{blue}{2 \cdot x} \]
  4. Final simplification32.6%

    \[\leadsto x \cdot 2 \]

Developer target: 95.2% 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 2023301 
(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)))