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

Percentage Accurate: 95.6% → 98.9%
Time: 10.2s
Alternatives: 18
Speedup: 1.0×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    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 18 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.6% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 98.9% accurate, 0.9× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + x \cdot 2\right)} + \left(a \cdot 27\right) \cdot b \]
      6. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + \left(x \cdot 2 + \left(a \cdot 27\right) \cdot b\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 9\right) \cdot z}\right)\right) \cdot t + \left(x \cdot 2 + \left(a \cdot 27\right) \cdot b\right) \]
      8. distribute-lft-neg-inN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \left(z \cdot t\right)} + \left(x \cdot 2 + \left(a \cdot 27\right) \cdot b\right) \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot t\right) \cdot \left(\mathsf{neg}\left(y \cdot 9\right)\right)} + \left(x \cdot 2 + \left(a \cdot 27\right) \cdot b\right) \]
      11. +-commutativeN/A

        \[\leadsto \left(z \cdot t\right) \cdot \left(\mathsf{neg}\left(y \cdot 9\right)\right) + \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right)} \]
      12. lower-fma.f64N/A

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

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

    if 4.9999999999999999e-13 < z

    1. Initial program 85.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right) \]
      10. fp-cancel-sub-sign-invN/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{x \cdot 2 + \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t}\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + x \cdot 2}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 9\right) \cdot z}\right)\right) \cdot t + x \cdot 2\right) \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot z\right)} \cdot t + x \cdot 2\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \left(z \cdot t\right)} + x \cdot 2\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \color{blue}{\left(t \cdot z\right)} + x \cdot 2\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot t\right) \cdot z} + x \cdot 2\right) \]
      17. lower-fma.f64N/A

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

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

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

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

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

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

Alternative 2: 85.6% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

    1. Initial program 92.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. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
      5. lower-*.f6425.4

        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
    5. Applied rewrites25.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
    6. Taylor expanded in x around 0

      \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites11.4%

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

        \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
      3. Step-by-step derivation
        1. fp-cancel-sub-sign-invN/A

          \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
        2. metadata-evalN/A

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

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

          \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
        5. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
        7. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
        8. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
        9. lower-*.f6486.1

          \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
      4. Applied rewrites86.1%

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

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

        if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.99999999999999987e146

        1. Initial program 99.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. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
        4. Step-by-step derivation
          1. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          3. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
          5. lower-*.f6492.1

            \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
        5. Applied rewrites92.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites92.1%

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

          if 1.99999999999999987e146 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

          1. Initial program 85.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. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
          4. Step-by-step derivation
            1. fp-cancel-sub-sign-invN/A

              \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
            2. metadata-evalN/A

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

              \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
            4. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(-9, t \cdot \left(y \cdot z\right), 27 \cdot \left(a \cdot b\right)\right)} \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
            6. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
            8. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
            10. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
            11. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
            12. lower-*.f6486.5

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

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

            \[\leadsto \mathsf{fma}\left(z \cdot t, \color{blue}{-9 \cdot y}, \left(a \cdot 27\right) \cdot b\right) \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 3: 85.4% accurate, 0.5× speedup?

        \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z, t \cdot -9, \left(a \cdot 27\right) \cdot b\right)\\ \end{array} \end{array} \]
        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
        (FPCore (x y z t a b)
         :precision binary64
         (let* ((t_1 (* (* (* y 9.0) z) t)))
           (if (<= t_1 -2e+68)
             (fma (* z y) (* -9.0 t) (* 2.0 x))
             (if (<= t_1 2e+146)
               (fma (* 27.0 b) a (* x 2.0))
               (fma (* y z) (* t -9.0) (* (* a 27.0) b))))))
        assert(x < y && y < z && z < t && t < a && a < b);
        double code(double x, double y, double z, double t, double a, double b) {
        	double t_1 = ((y * 9.0) * z) * t;
        	double tmp;
        	if (t_1 <= -2e+68) {
        		tmp = fma((z * y), (-9.0 * t), (2.0 * x));
        	} else if (t_1 <= 2e+146) {
        		tmp = fma((27.0 * b), a, (x * 2.0));
        	} else {
        		tmp = fma((y * z), (t * -9.0), ((a * 27.0) * b));
        	}
        	return tmp;
        }
        
        x, y, z, t, a, b = sort([x, y, z, t, a, b])
        function code(x, y, z, t, a, b)
        	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
        	tmp = 0.0
        	if (t_1 <= -2e+68)
        		tmp = fma(Float64(z * y), Float64(-9.0 * t), Float64(2.0 * x));
        	elseif (t_1 <= 2e+146)
        		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
        	else
        		tmp = fma(Float64(y * z), Float64(t * -9.0), Float64(Float64(a * 27.0) * b));
        	end
        	return tmp
        end
        
        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(N[(z * y), $MachinePrecision] * N[(-9.0 * t), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+146], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
        \\
        \begin{array}{l}
        t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
        \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
        \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\
        \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(y \cdot z, t \cdot -9, \left(a \cdot 27\right) \cdot b\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

          1. Initial program 92.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. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
          4. Step-by-step derivation
            1. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
            2. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
            3. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
            5. lower-*.f6425.4

              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
          5. Applied rewrites25.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
          6. Taylor expanded in x around 0

            \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites11.4%

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

              \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
            3. Step-by-step derivation
              1. fp-cancel-sub-sign-invN/A

                \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
              2. metadata-evalN/A

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

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

                \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
              5. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
              7. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
              8. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
              9. lower-*.f6486.1

                \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
            4. Applied rewrites86.1%

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

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

              if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.99999999999999987e146

              1. Initial program 99.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. Add Preprocessing
              3. Taylor expanded in y around 0

                \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
              4. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                2. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                3. lower-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                5. lower-*.f6492.1

                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
              5. Applied rewrites92.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites92.1%

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

                if 1.99999999999999987e146 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                1. Initial program 85.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. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                4. Step-by-step derivation
                  1. fp-cancel-sub-sign-invN/A

                    \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                  2. metadata-evalN/A

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

                    \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
                  4. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-9, t \cdot \left(y \cdot z\right), 27 \cdot \left(a \cdot b\right)\right)} \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                  8. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                  10. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                  12. lower-*.f6486.5

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

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

                  \[\leadsto \mathsf{fma}\left(y \cdot z, \color{blue}{t \cdot -9}, \left(a \cdot 27\right) \cdot b\right) \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 4: 85.4% accurate, 0.5× speedup?

              \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot \left(y \cdot z\right), t, \left(a \cdot 27\right) \cdot b\right)\\ \end{array} \end{array} \]
              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
              (FPCore (x y z t a b)
               :precision binary64
               (let* ((t_1 (* (* (* y 9.0) z) t)))
                 (if (<= t_1 -2e+68)
                   (fma (* z y) (* -9.0 t) (* 2.0 x))
                   (if (<= t_1 2e+146)
                     (fma (* 27.0 b) a (* x 2.0))
                     (fma (* -9.0 (* y z)) t (* (* a 27.0) b))))))
              assert(x < y && y < z && z < t && t < a && a < b);
              double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = ((y * 9.0) * z) * t;
              	double tmp;
              	if (t_1 <= -2e+68) {
              		tmp = fma((z * y), (-9.0 * t), (2.0 * x));
              	} else if (t_1 <= 2e+146) {
              		tmp = fma((27.0 * b), a, (x * 2.0));
              	} else {
              		tmp = fma((-9.0 * (y * z)), t, ((a * 27.0) * b));
              	}
              	return tmp;
              }
              
              x, y, z, t, a, b = sort([x, y, z, t, a, b])
              function code(x, y, z, t, a, b)
              	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
              	tmp = 0.0
              	if (t_1 <= -2e+68)
              		tmp = fma(Float64(z * y), Float64(-9.0 * t), Float64(2.0 * x));
              	elseif (t_1 <= 2e+146)
              		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
              	else
              		tmp = fma(Float64(-9.0 * Float64(y * z)), t, Float64(Float64(a * 27.0) * b));
              	end
              	return tmp
              end
              
              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(N[(z * y), $MachinePrecision] * N[(-9.0 * t), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+146], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
              \\
              \begin{array}{l}
              t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
              \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\
              
              \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\
              \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(-9 \cdot \left(y \cdot z\right), t, \left(a \cdot 27\right) \cdot b\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

                1. Initial program 92.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. Add Preprocessing
                3. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                4. Step-by-step derivation
                  1. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                  3. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                  5. lower-*.f6425.4

                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                5. Applied rewrites25.4%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                6. Taylor expanded in x around 0

                  \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites11.4%

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

                    \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                  3. Step-by-step derivation
                    1. fp-cancel-sub-sign-invN/A

                      \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                    2. metadata-evalN/A

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

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

                      \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                    5. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                    7. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                    9. lower-*.f6486.1

                      \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                  4. Applied rewrites86.1%

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

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

                    if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.99999999999999987e146

                    1. Initial program 99.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. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                    4. Step-by-step derivation
                      1. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                      3. lower-*.f64N/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                      5. lower-*.f6492.1

                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                    5. Applied rewrites92.1%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites92.1%

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

                      if 1.99999999999999987e146 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                      1. Initial program 85.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. Add Preprocessing
                      3. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                      4. Step-by-step derivation
                        1. fp-cancel-sub-sign-invN/A

                          \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                        2. metadata-evalN/A

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

                          \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
                        4. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(-9, t \cdot \left(y \cdot z\right), 27 \cdot \left(a \cdot b\right)\right)} \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                        6. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                        7. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                        8. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                        9. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        10. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                        12. lower-*.f6486.5

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

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

                        \[\leadsto \mathsf{fma}\left(-9 \cdot \left(y \cdot z\right), \color{blue}{t}, \left(a \cdot 27\right) \cdot b\right) \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 5: 85.3% accurate, 0.5× speedup?

                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\ \end{array} \end{array} \]
                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (* (* (* y 9.0) z) t)))
                       (if (<= t_1 -2e+68)
                         (fma (* z y) (* -9.0 t) (* 2.0 x))
                         (if (<= t_1 5e+153)
                           (fma (* 27.0 b) a (* x 2.0))
                           (fma -9.0 (* (* z y) t) (* (* b a) 27.0))))))
                    assert(x < y && y < z && z < t && t < a && a < b);
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = ((y * 9.0) * z) * t;
                    	double tmp;
                    	if (t_1 <= -2e+68) {
                    		tmp = fma((z * y), (-9.0 * t), (2.0 * x));
                    	} else if (t_1 <= 5e+153) {
                    		tmp = fma((27.0 * b), a, (x * 2.0));
                    	} else {
                    		tmp = fma(-9.0, ((z * y) * t), ((b * a) * 27.0));
                    	}
                    	return tmp;
                    }
                    
                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                    	tmp = 0.0
                    	if (t_1 <= -2e+68)
                    		tmp = fma(Float64(z * y), Float64(-9.0 * t), Float64(2.0 * x));
                    	elseif (t_1 <= 5e+153)
                    		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                    	else
                    		tmp = fma(-9.0, Float64(Float64(z * y) * t), Float64(Float64(b * a) * 27.0));
                    	end
                    	return tmp
                    end
                    
                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(N[(z * y), $MachinePrecision] * N[(-9.0 * t), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+153], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                    \\
                    \begin{array}{l}
                    t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
                    \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\
                    
                    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\
                    \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

                      1. Initial program 92.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. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                      4. Step-by-step derivation
                        1. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        3. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                        5. lower-*.f6425.4

                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                      5. Applied rewrites25.4%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                      6. Taylor expanded in x around 0

                        \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites11.4%

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

                          \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                        3. Step-by-step derivation
                          1. fp-cancel-sub-sign-invN/A

                            \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                          2. metadata-evalN/A

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

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

                            \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                          5. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                          6. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                          7. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                          8. lower-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                          9. lower-*.f6486.1

                            \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                        4. Applied rewrites86.1%

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

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

                          if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                          1. Initial program 99.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. Add Preprocessing
                          3. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                          4. Step-by-step derivation
                            1. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                            3. lower-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                            4. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                            5. lower-*.f6492.1

                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                          5. Applied rewrites92.1%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites92.1%

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

                            if 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                            1. Initial program 85.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. Add Preprocessing
                            3. Taylor expanded in x around 0

                              \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                            4. Step-by-step derivation
                              1. fp-cancel-sub-sign-invN/A

                                \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                              2. metadata-evalN/A

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

                                \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right) + 27 \cdot \left(a \cdot b\right)} \]
                              4. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(-9, t \cdot \left(y \cdot z\right), 27 \cdot \left(a \cdot b\right)\right)} \]
                              5. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                              6. lower-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(y \cdot z\right) \cdot t}, 27 \cdot \left(a \cdot b\right)\right) \]
                              7. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                              8. lower-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(-9, \color{blue}{\left(z \cdot y\right)} \cdot t, 27 \cdot \left(a \cdot b\right)\right) \]
                              9. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                              10. lower-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                              11. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                              12. lower-*.f6486.5

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)} \]
                          7. Recombined 3 regimes into one program.
                          8. Add Preprocessing

                          Alternative 6: 84.9% accurate, 0.6× speedup?

                          \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot y, t \cdot z, 2 \cdot x\right)\\ \end{array} \end{array} \]
                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                          (FPCore (x y z t a b)
                           :precision binary64
                           (let* ((t_1 (* (* (* y 9.0) z) t)))
                             (if (<= t_1 -2e+68)
                               (fma (* z y) (* -9.0 t) (* 2.0 x))
                               (if (<= t_1 5e+153)
                                 (fma (* 27.0 b) a (* x 2.0))
                                 (fma (* -9.0 y) (* t z) (* 2.0 x))))))
                          assert(x < y && y < z && z < t && t < a && a < b);
                          double code(double x, double y, double z, double t, double a, double b) {
                          	double t_1 = ((y * 9.0) * z) * t;
                          	double tmp;
                          	if (t_1 <= -2e+68) {
                          		tmp = fma((z * y), (-9.0 * t), (2.0 * x));
                          	} else if (t_1 <= 5e+153) {
                          		tmp = fma((27.0 * b), a, (x * 2.0));
                          	} else {
                          		tmp = fma((-9.0 * y), (t * z), (2.0 * x));
                          	}
                          	return tmp;
                          }
                          
                          x, y, z, t, a, b = sort([x, y, z, t, a, b])
                          function code(x, y, z, t, a, b)
                          	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                          	tmp = 0.0
                          	if (t_1 <= -2e+68)
                          		tmp = fma(Float64(z * y), Float64(-9.0 * t), Float64(2.0 * x));
                          	elseif (t_1 <= 5e+153)
                          		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                          	else
                          		tmp = fma(Float64(-9.0 * y), Float64(t * z), Float64(2.0 * x));
                          	end
                          	return tmp
                          end
                          
                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                          code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(N[(z * y), $MachinePrecision] * N[(-9.0 * t), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+153], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                          \\
                          \begin{array}{l}
                          t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                          \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
                          \;\;\;\;\mathsf{fma}\left(z \cdot y, -9 \cdot t, 2 \cdot x\right)\\
                          
                          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\
                          \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(-9 \cdot y, t \cdot z, 2 \cdot x\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

                            1. Initial program 92.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. Add Preprocessing
                            3. Taylor expanded in y around 0

                              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                            4. Step-by-step derivation
                              1. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                              2. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                              3. lower-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                              4. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                              5. lower-*.f6425.4

                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                            5. Applied rewrites25.4%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                            6. Taylor expanded in x around 0

                              \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites11.4%

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

                                \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                              3. Step-by-step derivation
                                1. fp-cancel-sub-sign-invN/A

                                  \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                2. metadata-evalN/A

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

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

                                  \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                5. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                6. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                7. lower-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                8. lower-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                9. lower-*.f6486.1

                                  \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                              4. Applied rewrites86.1%

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

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

                                if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                1. Initial program 99.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. Add Preprocessing
                                3. Taylor expanded in y around 0

                                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                4. Step-by-step derivation
                                  1. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                  2. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                  3. lower-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                  4. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                  5. lower-*.f6492.1

                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                5. Applied rewrites92.1%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites92.1%

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

                                  if 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                  1. Initial program 85.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. Add Preprocessing
                                  3. Taylor expanded in y around 0

                                    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                  4. Step-by-step derivation
                                    1. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                    2. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                    4. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                    5. lower-*.f6418.3

                                      \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                  5. Applied rewrites18.3%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                  6. Taylor expanded in x around 0

                                    \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites15.6%

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

                                      \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                    3. Step-by-step derivation
                                      1. fp-cancel-sub-sign-invN/A

                                        \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                      2. metadata-evalN/A

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

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

                                        \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                      5. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                      6. *-commutativeN/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                      7. lower-*.f64N/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                      8. lower-*.f64N/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                      9. lower-*.f6483.4

                                        \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                    4. Applied rewrites83.4%

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

                                        \[\leadsto \mathsf{fma}\left(-9 \cdot y, \color{blue}{t \cdot z}, 2 \cdot x\right) \]
                                    6. Recombined 3 regimes into one program.
                                    7. Add Preprocessing

                                    Alternative 7: 84.9% accurate, 0.6× speedup?

                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;x + \left(x - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot y, t \cdot z, 2 \cdot x\right)\\ \end{array} \end{array} \]
                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                    (FPCore (x y z t a b)
                                     :precision binary64
                                     (let* ((t_1 (* (* (* y 9.0) z) t)))
                                       (if (<= t_1 -2e+68)
                                         (+ x (- x (* t (* z (* 9.0 y)))))
                                         (if (<= t_1 5e+153)
                                           (fma (* 27.0 b) a (* x 2.0))
                                           (fma (* -9.0 y) (* t z) (* 2.0 x))))))
                                    assert(x < y && y < z && z < t && t < a && a < b);
                                    double code(double x, double y, double z, double t, double a, double b) {
                                    	double t_1 = ((y * 9.0) * z) * t;
                                    	double tmp;
                                    	if (t_1 <= -2e+68) {
                                    		tmp = x + (x - (t * (z * (9.0 * y))));
                                    	} else if (t_1 <= 5e+153) {
                                    		tmp = fma((27.0 * b), a, (x * 2.0));
                                    	} else {
                                    		tmp = fma((-9.0 * y), (t * z), (2.0 * x));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                    function code(x, y, z, t, a, b)
                                    	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                                    	tmp = 0.0
                                    	if (t_1 <= -2e+68)
                                    		tmp = Float64(x + Float64(x - Float64(t * Float64(z * Float64(9.0 * y)))));
                                    	elseif (t_1 <= 5e+153)
                                    		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                                    	else
                                    		tmp = fma(Float64(-9.0 * y), Float64(t * z), Float64(2.0 * x));
                                    	end
                                    	return tmp
                                    end
                                    
                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(x + N[(x - N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+153], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * y), $MachinePrecision] * N[(t * z), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]]]]
                                    
                                    \begin{array}{l}
                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                    \\
                                    \begin{array}{l}
                                    t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
                                    \;\;\;\;x + \left(x - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\
                                    
                                    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\
                                    \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(-9 \cdot y, t \cdot z, 2 \cdot x\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

                                      1. Initial program 92.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. Add Preprocessing
                                      3. Taylor expanded in y around 0

                                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                      4. Step-by-step derivation
                                        1. lower-fma.f64N/A

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                        2. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                        3. lower-*.f64N/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                        4. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                        5. lower-*.f6425.4

                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                      5. Applied rewrites25.4%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                      6. Taylor expanded in x around 0

                                        \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites11.4%

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

                                          \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                        3. Step-by-step derivation
                                          1. fp-cancel-sub-sign-invN/A

                                            \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                          2. metadata-evalN/A

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

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

                                            \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                          5. lower-fma.f64N/A

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                          6. *-commutativeN/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                          7. lower-*.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                          8. lower-*.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                          9. lower-*.f6486.1

                                            \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                        4. Applied rewrites86.1%

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

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

                                          if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                          1. Initial program 99.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. Add Preprocessing
                                          3. Taylor expanded in y around 0

                                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                          4. Step-by-step derivation
                                            1. lower-fma.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                            2. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                            3. lower-*.f64N/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                            4. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                            5. lower-*.f6492.1

                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                          5. Applied rewrites92.1%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites92.1%

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

                                            if 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                            1. Initial program 85.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. Add Preprocessing
                                            3. Taylor expanded in y around 0

                                              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                            4. Step-by-step derivation
                                              1. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                              2. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                              3. lower-*.f64N/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                              4. *-commutativeN/A

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                              5. lower-*.f6418.3

                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                            5. Applied rewrites18.3%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                            6. Taylor expanded in x around 0

                                              \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites15.6%

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

                                                \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                              3. Step-by-step derivation
                                                1. fp-cancel-sub-sign-invN/A

                                                  \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                2. metadata-evalN/A

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

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

                                                  \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                5. lower-fma.f64N/A

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                6. *-commutativeN/A

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                7. lower-*.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                8. lower-*.f64N/A

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                9. lower-*.f6483.4

                                                  \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                              4. Applied rewrites83.4%

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

                                                  \[\leadsto \mathsf{fma}\left(-9 \cdot y, \color{blue}{t \cdot z}, 2 \cdot x\right) \]
                                              6. Recombined 3 regimes into one program.
                                              7. Add Preprocessing

                                              Alternative 8: 84.8% accurate, 0.6× speedup?

                                              \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(-9 \cdot t\right) \cdot z, y, x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \end{array} \end{array} \]
                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                              (FPCore (x y z t a b)
                                               :precision binary64
                                               (let* ((t_1 (* (* (* y 9.0) z) t)))
                                                 (if (or (<= t_1 -2e+68) (not (<= t_1 5e+153)))
                                                   (+ (fma (* (* -9.0 t) z) y x) x)
                                                   (fma (* 27.0 b) a (* x 2.0)))))
                                              assert(x < y && y < z && z < t && t < a && a < b);
                                              double code(double x, double y, double z, double t, double a, double b) {
                                              	double t_1 = ((y * 9.0) * z) * t;
                                              	double tmp;
                                              	if ((t_1 <= -2e+68) || !(t_1 <= 5e+153)) {
                                              		tmp = fma(((-9.0 * t) * z), y, x) + x;
                                              	} else {
                                              		tmp = fma((27.0 * b), a, (x * 2.0));
                                              	}
                                              	return tmp;
                                              }
                                              
                                              x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                              function code(x, y, z, t, a, b)
                                              	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                                              	tmp = 0.0
                                              	if ((t_1 <= -2e+68) || !(t_1 <= 5e+153))
                                              		tmp = Float64(fma(Float64(Float64(-9.0 * t) * z), y, x) + x);
                                              	else
                                              		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                                              	end
                                              	return tmp
                                              end
                                              
                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+68], N[Not[LessEqual[t$95$1, 5e+153]], $MachinePrecision]], N[(N[(N[(N[(-9.0 * t), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision] + x), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                              \\
                                              \begin{array}{l}
                                              t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                                              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\
                                              \;\;\;\;\mathsf{fma}\left(\left(-9 \cdot t\right) \cdot z, y, x\right) + x\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68 or 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                1. Initial program 89.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. Add Preprocessing
                                                3. Taylor expanded in y around 0

                                                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                4. Step-by-step derivation
                                                  1. lower-fma.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                  2. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                  3. lower-*.f64N/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                  5. lower-*.f6422.3

                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                5. Applied rewrites22.3%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                6. Taylor expanded in x around 0

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

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

                                                    \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                  3. Step-by-step derivation
                                                    1. fp-cancel-sub-sign-invN/A

                                                      \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                    2. metadata-evalN/A

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

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

                                                      \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                    5. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                    6. *-commutativeN/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                    7. lower-*.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                    8. lower-*.f64N/A

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                    9. lower-*.f6485.0

                                                      \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                  4. Applied rewrites85.0%

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

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

                                                    if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                                    1. Initial program 99.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. Add Preprocessing
                                                    3. Taylor expanded in y around 0

                                                      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                    4. Step-by-step derivation
                                                      1. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                      2. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                      3. lower-*.f64N/A

                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                      4. *-commutativeN/A

                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                      5. lower-*.f6492.1

                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                    5. Applied rewrites92.1%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites92.1%

                                                        \[\leadsto \mathsf{fma}\left(27 \cdot b, \color{blue}{a}, x \cdot 2\right) \]
                                                    7. Recombined 2 regimes into one program.
                                                    8. Final simplification88.7%

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

                                                    Alternative 9: 84.9% accurate, 0.6× speedup?

                                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;x + \left(x - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(-9 \cdot t\right) \cdot z, y, x\right) + x\\ \end{array} \end{array} \]
                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                    (FPCore (x y z t a b)
                                                     :precision binary64
                                                     (let* ((t_1 (* (* (* y 9.0) z) t)))
                                                       (if (<= t_1 -2e+68)
                                                         (+ x (- x (* t (* z (* 9.0 y)))))
                                                         (if (<= t_1 5e+153)
                                                           (fma (* 27.0 b) a (* x 2.0))
                                                           (+ (fma (* (* -9.0 t) z) y x) x)))))
                                                    assert(x < y && y < z && z < t && t < a && a < b);
                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                    	double t_1 = ((y * 9.0) * z) * t;
                                                    	double tmp;
                                                    	if (t_1 <= -2e+68) {
                                                    		tmp = x + (x - (t * (z * (9.0 * y))));
                                                    	} else if (t_1 <= 5e+153) {
                                                    		tmp = fma((27.0 * b), a, (x * 2.0));
                                                    	} else {
                                                    		tmp = fma(((-9.0 * t) * z), y, x) + x;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                    function code(x, y, z, t, a, b)
                                                    	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                                                    	tmp = 0.0
                                                    	if (t_1 <= -2e+68)
                                                    		tmp = Float64(x + Float64(x - Float64(t * Float64(z * Float64(9.0 * y)))));
                                                    	elseif (t_1 <= 5e+153)
                                                    		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                                                    	else
                                                    		tmp = Float64(fma(Float64(Float64(-9.0 * t) * z), y, x) + x);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+68], N[(x + N[(x - N[(t * N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+153], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-9.0 * t), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision] + x), $MachinePrecision]]]]
                                                    
                                                    \begin{array}{l}
                                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                    \\
                                                    \begin{array}{l}
                                                    t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                                                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+68}:\\
                                                    \;\;\;\;x + \left(x - t \cdot \left(z \cdot \left(9 \cdot y\right)\right)\right)\\
                                                    
                                                    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+153}:\\
                                                    \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\mathsf{fma}\left(\left(-9 \cdot t\right) \cdot z, y, x\right) + x\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.99999999999999991e68

                                                      1. Initial program 92.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. Add Preprocessing
                                                      3. Taylor expanded in y around 0

                                                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                      4. Step-by-step derivation
                                                        1. lower-fma.f64N/A

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                        2. *-commutativeN/A

                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                        3. lower-*.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                        4. *-commutativeN/A

                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                        5. lower-*.f6425.4

                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                      5. Applied rewrites25.4%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                      6. Taylor expanded in x around 0

                                                        \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites11.4%

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

                                                          \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                        3. Step-by-step derivation
                                                          1. fp-cancel-sub-sign-invN/A

                                                            \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                          2. metadata-evalN/A

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

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

                                                            \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                          5. lower-fma.f64N/A

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                          6. *-commutativeN/A

                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                          7. lower-*.f64N/A

                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                          8. lower-*.f64N/A

                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                          9. lower-*.f6486.1

                                                            \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                        4. Applied rewrites86.1%

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

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

                                                          if -1.99999999999999991e68 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                                          1. Initial program 99.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. Add Preprocessing
                                                          3. Taylor expanded in y around 0

                                                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                          4. Step-by-step derivation
                                                            1. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                            2. *-commutativeN/A

                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                            3. lower-*.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                            4. *-commutativeN/A

                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                            5. lower-*.f6492.1

                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                          5. Applied rewrites92.1%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites92.1%

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

                                                            if 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                            1. Initial program 85.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. Add Preprocessing
                                                            3. Taylor expanded in y around 0

                                                              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                            4. Step-by-step derivation
                                                              1. lower-fma.f64N/A

                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                              2. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                              3. lower-*.f64N/A

                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                              4. *-commutativeN/A

                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                              5. lower-*.f6418.3

                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                            5. Applied rewrites18.3%

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                            6. Taylor expanded in x around 0

                                                              \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites15.6%

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

                                                                \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                              3. Step-by-step derivation
                                                                1. fp-cancel-sub-sign-invN/A

                                                                  \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                2. metadata-evalN/A

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

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

                                                                  \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                                5. lower-fma.f64N/A

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                                6. *-commutativeN/A

                                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                7. lower-*.f64N/A

                                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                8. lower-*.f64N/A

                                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                                9. lower-*.f6483.4

                                                                  \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                              4. Applied rewrites83.4%

                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, 2 \cdot x\right)} \]
                                                              5. Step-by-step derivation
                                                                1. Applied rewrites81.4%

                                                                  \[\leadsto \mathsf{fma}\left(\left(-9 \cdot t\right) \cdot z, y, x\right) + \color{blue}{x} \]
                                                              6. Recombined 3 regimes into one program.
                                                              7. Add Preprocessing

                                                              Alternative 10: 83.1% accurate, 0.6× speedup?

                                                              \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+155} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\ \;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\ \end{array} \end{array} \]
                                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                              (FPCore (x y z t a b)
                                                               :precision binary64
                                                               (let* ((t_1 (* (* (* y 9.0) z) t)))
                                                                 (if (or (<= t_1 -2e+155) (not (<= t_1 5e+153)))
                                                                   (* -9.0 (* (* z y) t))
                                                                   (fma (* 27.0 b) a (* x 2.0)))))
                                                              assert(x < y && y < z && z < t && t < a && a < b);
                                                              double code(double x, double y, double z, double t, double a, double b) {
                                                              	double t_1 = ((y * 9.0) * z) * t;
                                                              	double tmp;
                                                              	if ((t_1 <= -2e+155) || !(t_1 <= 5e+153)) {
                                                              		tmp = -9.0 * ((z * y) * t);
                                                              	} else {
                                                              		tmp = fma((27.0 * b), a, (x * 2.0));
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                              function code(x, y, z, t, a, b)
                                                              	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                                                              	tmp = 0.0
                                                              	if ((t_1 <= -2e+155) || !(t_1 <= 5e+153))
                                                              		tmp = Float64(-9.0 * Float64(Float64(z * y) * t));
                                                              	else
                                                              		tmp = fma(Float64(27.0 * b), a, Float64(x * 2.0));
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+155], N[Not[LessEqual[t$95$1, 5e+153]], $MachinePrecision]], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
                                                              
                                                              \begin{array}{l}
                                                              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                              \\
                                                              \begin{array}{l}
                                                              t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                                                              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+155} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\
                                                              \;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\mathsf{fma}\left(27 \cdot b, a, x \cdot 2\right)\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 2 regimes
                                                              2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -2.00000000000000001e155 or 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                                1. Initial program 87.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. Add Preprocessing
                                                                3. Taylor expanded in y around 0

                                                                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-fma.f64N/A

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                  2. *-commutativeN/A

                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                  3. lower-*.f64N/A

                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                  4. *-commutativeN/A

                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                  5. lower-*.f6415.2

                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                5. Applied rewrites15.2%

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                6. Taylor expanded in x around 0

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

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

                                                                    \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                  3. Step-by-step derivation
                                                                    1. fp-cancel-sub-sign-invN/A

                                                                      \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                    2. metadata-evalN/A

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

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

                                                                      \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                                    5. lower-fma.f64N/A

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                                    6. *-commutativeN/A

                                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                    7. lower-*.f64N/A

                                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                    8. lower-*.f64N/A

                                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                                    9. lower-*.f6485.7

                                                                      \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                                  4. Applied rewrites85.7%

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

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

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

                                                                    if -2.00000000000000001e155 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                                                    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. Add Preprocessing
                                                                    3. Taylor expanded in y around 0

                                                                      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-fma.f64N/A

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                      2. *-commutativeN/A

                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                      3. lower-*.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                      4. *-commutativeN/A

                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                      5. lower-*.f6489.3

                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                    5. Applied rewrites89.3%

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites89.3%

                                                                        \[\leadsto \mathsf{fma}\left(27 \cdot b, \color{blue}{a}, x \cdot 2\right) \]
                                                                    7. Recombined 2 regimes into one program.
                                                                    8. Final simplification87.4%

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

                                                                    Alternative 11: 83.1% accurate, 0.6× speedup?

                                                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+155} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\ \;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x\right) + x\\ \end{array} \end{array} \]
                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                    (FPCore (x y z t a b)
                                                                     :precision binary64
                                                                     (let* ((t_1 (* (* (* y 9.0) z) t)))
                                                                       (if (or (<= t_1 -2e+155) (not (<= t_1 5e+153)))
                                                                         (* -9.0 (* (* z y) t))
                                                                         (+ (fma (* b 27.0) a x) x))))
                                                                    assert(x < y && y < z && z < t && t < a && a < b);
                                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                                    	double t_1 = ((y * 9.0) * z) * t;
                                                                    	double tmp;
                                                                    	if ((t_1 <= -2e+155) || !(t_1 <= 5e+153)) {
                                                                    		tmp = -9.0 * ((z * y) * t);
                                                                    	} else {
                                                                    		tmp = fma((b * 27.0), a, x) + x;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                    function code(x, y, z, t, a, b)
                                                                    	t_1 = Float64(Float64(Float64(y * 9.0) * z) * t)
                                                                    	tmp = 0.0
                                                                    	if ((t_1 <= -2e+155) || !(t_1 <= 5e+153))
                                                                    		tmp = Float64(-9.0 * Float64(Float64(z * y) * t));
                                                                    	else
                                                                    		tmp = Float64(fma(Float64(b * 27.0), a, x) + x);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+155], N[Not[LessEqual[t$95$1, 5e+153]], $MachinePrecision]], N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * 27.0), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_1 := \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\\
                                                                    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+155} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+153}\right):\\
                                                                    \;\;\;\;-9 \cdot \left(\left(z \cdot y\right) \cdot t\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x\right) + x\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -2.00000000000000001e155 or 5.00000000000000018e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                                      1. Initial program 87.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. Add Preprocessing
                                                                      3. Taylor expanded in y around 0

                                                                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-fma.f64N/A

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                        2. *-commutativeN/A

                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                        3. lower-*.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                        4. *-commutativeN/A

                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                        5. lower-*.f6415.2

                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                      5. Applied rewrites15.2%

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                      6. Taylor expanded in x around 0

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

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

                                                                          \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                        3. Step-by-step derivation
                                                                          1. fp-cancel-sub-sign-invN/A

                                                                            \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                          2. metadata-evalN/A

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

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

                                                                            \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                                          5. lower-fma.f64N/A

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                                          6. *-commutativeN/A

                                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                          7. lower-*.f64N/A

                                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                          8. lower-*.f64N/A

                                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                                          9. lower-*.f6485.7

                                                                            \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                                        4. Applied rewrites85.7%

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

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

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

                                                                          if -2.00000000000000001e155 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 5.00000000000000018e153

                                                                          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. Add Preprocessing
                                                                          3. Taylor expanded in y around 0

                                                                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. lower-fma.f64N/A

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                            2. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                            3. lower-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                            4. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                            5. lower-*.f6489.3

                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                          5. Applied rewrites89.3%

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                          6. Step-by-step derivation
                                                                            1. Applied rewrites89.3%

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

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

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

                                                                            Alternative 12: 98.9% accurate, 1.0× speedup?

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

                                                                              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. Add Preprocessing
                                                                              3. Step-by-step derivation
                                                                                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right) \]
                                                                                10. fp-cancel-sub-sign-invN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{x \cdot 2 + \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t}\right) \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + x \cdot 2}\right) \]
                                                                                12. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 9\right) \cdot z}\right)\right) \cdot t + x \cdot 2\right) \]
                                                                                13. distribute-lft-neg-inN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot z\right)} \cdot t + x \cdot 2\right) \]
                                                                                14. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \left(z \cdot t\right)} + x \cdot 2\right) \]
                                                                                15. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \color{blue}{\left(t \cdot z\right)} + x \cdot 2\right) \]
                                                                                16. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot t\right) \cdot z} + x \cdot 2\right) \]
                                                                                17. lower-fma.f64N/A

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

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z + \color{blue}{\left(x + x\right)}\right) \]
                                                                                4. associate-+r+N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\left(-9 \cdot y\right) \cdot t\right) \cdot z + x\right) + x}\right) \]
                                                                                5. lower-+.f64N/A

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\color{blue}{\left(t \cdot z\right) \cdot \left(-9 \cdot y\right)} + x\right) + x\right) \]
                                                                                9. lower-fma.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\mathsf{fma}\left(t \cdot z, -9 \cdot y, x\right)} + x\right) \]
                                                                                10. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \mathsf{fma}\left(\color{blue}{z \cdot t}, -9 \cdot y, x\right) + x\right) \]
                                                                                11. lower-*.f6498.7

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

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

                                                                              if 2.00000000000000012e-9 < z

                                                                              1. Initial program 85.0%

                                                                                \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                              2. Add Preprocessing
                                                                              3. Step-by-step derivation
                                                                                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right) \]
                                                                                10. fp-cancel-sub-sign-invN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{x \cdot 2 + \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t}\right) \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + x \cdot 2}\right) \]
                                                                                12. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 9\right) \cdot z}\right)\right) \cdot t + x \cdot 2\right) \]
                                                                                13. distribute-lft-neg-inN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot z\right)} \cdot t + x \cdot 2\right) \]
                                                                                14. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \left(z \cdot t\right)} + x \cdot 2\right) \]
                                                                                15. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \color{blue}{\left(t \cdot z\right)} + x \cdot 2\right) \]
                                                                                16. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot t\right) \cdot z} + x \cdot 2\right) \]
                                                                                17. lower-fma.f64N/A

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

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

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

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

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

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

                                                                            Alternative 13: 97.1% accurate, 1.0× speedup?

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

                                                                              1. Initial program 98.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. Add Preprocessing
                                                                              3. Step-by-step derivation
                                                                                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right) \cdot t}\right) \]
                                                                                10. fp-cancel-sub-sign-invN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{x \cdot 2 + \left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t}\right) \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot 9\right) \cdot z\right)\right) \cdot t + x \cdot 2}\right) \]
                                                                                12. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(\color{blue}{\left(y \cdot 9\right) \cdot z}\right)\right) \cdot t + x \cdot 2\right) \]
                                                                                13. distribute-lft-neg-inN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot z\right)} \cdot t + x \cdot 2\right) \]
                                                                                14. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \left(z \cdot t\right)} + x \cdot 2\right) \]
                                                                                15. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot \color{blue}{\left(t \cdot z\right)} + x \cdot 2\right) \]
                                                                                16. associate-*r*N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\mathsf{neg}\left(y \cdot 9\right)\right) \cdot t\right) \cdot z} + x \cdot 2\right) \]
                                                                                17. lower-fma.f64N/A

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

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\left(-9 \cdot y\right) \cdot t\right) \cdot z + \color{blue}{\left(x + x\right)}\right) \]
                                                                                4. associate-+r+N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\left(\left(\left(-9 \cdot y\right) \cdot t\right) \cdot z + x\right) + x}\right) \]
                                                                                5. lower-+.f64N/A

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

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

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

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \left(\color{blue}{\left(t \cdot z\right) \cdot \left(-9 \cdot y\right)} + x\right) + x\right) \]
                                                                                9. lower-fma.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(27 \cdot a, b, \color{blue}{\mathsf{fma}\left(t \cdot z, -9 \cdot y, x\right)} + x\right) \]
                                                                                10. *-commutativeN/A

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

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

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

                                                                              if 8.5000000000000004e63 < z

                                                                              1. Initial program 82.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. Add Preprocessing
                                                                              3. Taylor expanded in y around 0

                                                                                \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. lower-fma.f64N/A

                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                2. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                3. lower-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                4. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                5. lower-*.f6436.2

                                                                                  \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                              5. Applied rewrites36.2%

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                              6. Taylor expanded in x around 0

                                                                                \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites16.3%

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

                                                                                  \[\leadsto \color{blue}{2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                                3. Step-by-step derivation
                                                                                  1. fp-cancel-sub-sign-invN/A

                                                                                    \[\leadsto \color{blue}{2 \cdot x + \left(\mathsf{neg}\left(9\right)\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
                                                                                  2. metadata-evalN/A

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

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

                                                                                    \[\leadsto \color{blue}{\left(t \cdot \left(y \cdot z\right)\right) \cdot -9} + 2 \cdot x \]
                                                                                  5. lower-fma.f64N/A

                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot \left(y \cdot z\right), -9, 2 \cdot x\right)} \]
                                                                                  6. *-commutativeN/A

                                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                                  7. lower-*.f64N/A

                                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right) \cdot t}, -9, 2 \cdot x\right) \]
                                                                                  8. lower-*.f64N/A

                                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y \cdot z\right)} \cdot t, -9, 2 \cdot x\right) \]
                                                                                  9. lower-*.f6474.9

                                                                                    \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot t, -9, \color{blue}{2 \cdot x}\right) \]
                                                                                4. Applied rewrites74.9%

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

                                                                                    \[\leadsto \mathsf{fma}\left(z \cdot y, \color{blue}{-9 \cdot t}, 2 \cdot x\right) \]
                                                                                6. Recombined 2 regimes into one program.
                                                                                7. Add Preprocessing

                                                                                Alternative 14: 63.9% accurate, 2.5× speedup?

                                                                                \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \mathsf{fma}\left(b \cdot 27, a, x\right) + x \end{array} \]
                                                                                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                (FPCore (x y z t a b) :precision binary64 (+ (fma (* b 27.0) a x) x))
                                                                                assert(x < y && y < z && z < t && t < a && a < b);
                                                                                double code(double x, double y, double z, double t, double a, double b) {
                                                                                	return fma((b * 27.0), a, x) + x;
                                                                                }
                                                                                
                                                                                x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                function code(x, y, z, t, a, b)
                                                                                	return Float64(fma(Float64(b * 27.0), a, x) + x)
                                                                                end
                                                                                
                                                                                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(b * 27.0), $MachinePrecision] * a + x), $MachinePrecision] + x), $MachinePrecision]
                                                                                
                                                                                \begin{array}{l}
                                                                                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                \\
                                                                                \mathsf{fma}\left(b \cdot 27, a, x\right) + x
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                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. Add Preprocessing
                                                                                3. Taylor expanded in y around 0

                                                                                  \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                                4. Step-by-step derivation
                                                                                  1. lower-fma.f64N/A

                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                  2. *-commutativeN/A

                                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                  3. lower-*.f64N/A

                                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                  4. *-commutativeN/A

                                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                  5. lower-*.f6462.1

                                                                                    \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                5. Applied rewrites62.1%

                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                                6. Step-by-step derivation
                                                                                  1. Applied rewrites62.1%

                                                                                    \[\leadsto \mathsf{fma}\left(a \cdot 27, \color{blue}{b}, x \cdot 2\right) \]
                                                                                  2. Step-by-step derivation
                                                                                    1. Applied rewrites62.1%

                                                                                      \[\leadsto \mathsf{fma}\left(b \cdot 27, a, x\right) + \color{blue}{x} \]
                                                                                    2. Add Preprocessing

                                                                                    Alternative 15: 63.9% accurate, 2.5× speedup?

                                                                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \mathsf{fma}\left(a \cdot 27, b, x\right) + x \end{array} \]
                                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                    (FPCore (x y z t a b) :precision binary64 (+ (fma (* a 27.0) b x) x))
                                                                                    assert(x < y && y < z && z < t && t < a && a < b);
                                                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                                                    	return fma((a * 27.0), b, x) + x;
                                                                                    }
                                                                                    
                                                                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                    function code(x, y, z, t, a, b)
                                                                                    	return Float64(fma(Float64(a * 27.0), b, x) + x)
                                                                                    end
                                                                                    
                                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                    code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a * 27.0), $MachinePrecision] * b + x), $MachinePrecision] + x), $MachinePrecision]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                    \\
                                                                                    \mathsf{fma}\left(a \cdot 27, b, x\right) + x
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    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. Add Preprocessing
                                                                                    3. Taylor expanded in y around 0

                                                                                      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. lower-fma.f64N/A

                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                      2. *-commutativeN/A

                                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                      3. lower-*.f64N/A

                                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                      4. *-commutativeN/A

                                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                      5. lower-*.f6462.1

                                                                                        \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                    5. Applied rewrites62.1%

                                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                                    6. Step-by-step derivation
                                                                                      1. Applied rewrites62.1%

                                                                                        \[\leadsto \mathsf{fma}\left(a \cdot 27, b, x\right) + \color{blue}{x} \]
                                                                                      2. Add Preprocessing

                                                                                      Alternative 16: 36.1% accurate, 3.4× speedup?

                                                                                      \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \left(b \cdot 27\right) \cdot a \end{array} \]
                                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                      (FPCore (x y z t a b) :precision binary64 (* (* b 27.0) a))
                                                                                      assert(x < y && y < z && z < t && t < a && a < b);
                                                                                      double code(double x, double y, double z, double t, double a, double b) {
                                                                                      	return (b * 27.0) * a;
                                                                                      }
                                                                                      
                                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                      module fmin_fmax_functions
                                                                                          implicit none
                                                                                          private
                                                                                          public fmax
                                                                                          public fmin
                                                                                      
                                                                                          interface fmax
                                                                                              module procedure fmax88
                                                                                              module procedure fmax44
                                                                                              module procedure fmax84
                                                                                              module procedure fmax48
                                                                                          end interface
                                                                                          interface fmin
                                                                                              module procedure fmin88
                                                                                              module procedure fmin44
                                                                                              module procedure fmin84
                                                                                              module procedure fmin48
                                                                                          end interface
                                                                                      contains
                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                              real(8), intent (in) :: x
                                                                                              real(4), intent (in) :: y
                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                          end function
                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                              real(4), intent (in) :: x
                                                                                              real(8), intent (in) :: y
                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                          end function
                                                                                      end module
                                                                                      
                                                                                      real(8) function code(x, y, z, t, a, b)
                                                                                      use fmin_fmax_functions
                                                                                          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 = (b * 27.0d0) * a
                                                                                      end function
                                                                                      
                                                                                      assert x < y && y < z && z < t && t < a && a < b;
                                                                                      public static double code(double x, double y, double z, double t, double a, double b) {
                                                                                      	return (b * 27.0) * a;
                                                                                      }
                                                                                      
                                                                                      [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                                      def code(x, y, z, t, a, b):
                                                                                      	return (b * 27.0) * a
                                                                                      
                                                                                      x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                      function code(x, y, z, t, a, b)
                                                                                      	return Float64(Float64(b * 27.0) * a)
                                                                                      end
                                                                                      
                                                                                      x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                                      function tmp = code(x, y, z, t, a, b)
                                                                                      	tmp = (b * 27.0) * a;
                                                                                      end
                                                                                      
                                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                      code[x_, y_, z_, t_, a_, b_] := N[(N[(b * 27.0), $MachinePrecision] * a), $MachinePrecision]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                      \\
                                                                                      \left(b \cdot 27\right) \cdot a
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      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. Add Preprocessing
                                                                                      3. Taylor expanded in y around 0

                                                                                        \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-fma.f64N/A

                                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                        2. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                        3. lower-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                        4. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                        5. lower-*.f6462.1

                                                                                          \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                      5. Applied rewrites62.1%

                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                                      6. Taylor expanded in x around 0

                                                                                        \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites34.0%

                                                                                          \[\leadsto \left(a \cdot b\right) \cdot \color{blue}{27} \]
                                                                                        2. Step-by-step derivation
                                                                                          1. Applied rewrites34.0%

                                                                                            \[\leadsto \left(b \cdot 27\right) \cdot a \]
                                                                                          2. Add Preprocessing

                                                                                          Alternative 17: 36.2% accurate, 3.4× speedup?

                                                                                          \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \left(a \cdot b\right) \cdot 27 \end{array} \]
                                                                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                          (FPCore (x y z t a b) :precision binary64 (* (* a b) 27.0))
                                                                                          assert(x < y && y < z && z < t && t < a && a < b);
                                                                                          double code(double x, double y, double z, double t, double a, double b) {
                                                                                          	return (a * b) * 27.0;
                                                                                          }
                                                                                          
                                                                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                          module fmin_fmax_functions
                                                                                              implicit none
                                                                                              private
                                                                                              public fmax
                                                                                              public fmin
                                                                                          
                                                                                              interface fmax
                                                                                                  module procedure fmax88
                                                                                                  module procedure fmax44
                                                                                                  module procedure fmax84
                                                                                                  module procedure fmax48
                                                                                              end interface
                                                                                              interface fmin
                                                                                                  module procedure fmin88
                                                                                                  module procedure fmin44
                                                                                                  module procedure fmin84
                                                                                                  module procedure fmin48
                                                                                              end interface
                                                                                          contains
                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                              end function
                                                                                          end module
                                                                                          
                                                                                          real(8) function code(x, y, z, t, a, b)
                                                                                          use fmin_fmax_functions
                                                                                              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 = (a * b) * 27.0d0
                                                                                          end function
                                                                                          
                                                                                          assert x < y && y < z && z < t && t < a && a < b;
                                                                                          public static double code(double x, double y, double z, double t, double a, double b) {
                                                                                          	return (a * b) * 27.0;
                                                                                          }
                                                                                          
                                                                                          [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                                          def code(x, y, z, t, a, b):
                                                                                          	return (a * b) * 27.0
                                                                                          
                                                                                          x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                          function code(x, y, z, t, a, b)
                                                                                          	return Float64(Float64(a * b) * 27.0)
                                                                                          end
                                                                                          
                                                                                          x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                                          function tmp = code(x, y, z, t, a, b)
                                                                                          	tmp = (a * b) * 27.0;
                                                                                          end
                                                                                          
                                                                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                          code[x_, y_, z_, t_, a_, b_] := N[(N[(a * b), $MachinePrecision] * 27.0), $MachinePrecision]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                          \\
                                                                                          \left(a \cdot b\right) \cdot 27
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          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. Add Preprocessing
                                                                                          3. Taylor expanded in y around 0

                                                                                            \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. lower-fma.f64N/A

                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                            2. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                            3. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                            4. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                            5. lower-*.f6462.1

                                                                                              \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                          5. Applied rewrites62.1%

                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                                          6. Taylor expanded in x around 0

                                                                                            \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites34.0%

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

                                                                                            Alternative 18: 36.2% accurate, 3.4× speedup?

                                                                                            \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \left(a \cdot 27\right) \cdot b \end{array} \]
                                                                                            NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                            (FPCore (x y z t a b) :precision binary64 (* (* a 27.0) b))
                                                                                            assert(x < y && y < z && z < t && t < a && a < b);
                                                                                            double code(double x, double y, double z, double t, double a, double b) {
                                                                                            	return (a * 27.0) * b;
                                                                                            }
                                                                                            
                                                                                            NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                            module fmin_fmax_functions
                                                                                                implicit none
                                                                                                private
                                                                                                public fmax
                                                                                                public fmin
                                                                                            
                                                                                                interface fmax
                                                                                                    module procedure fmax88
                                                                                                    module procedure fmax44
                                                                                                    module procedure fmax84
                                                                                                    module procedure fmax48
                                                                                                end interface
                                                                                                interface fmin
                                                                                                    module procedure fmin88
                                                                                                    module procedure fmin44
                                                                                                    module procedure fmin84
                                                                                                    module procedure fmin48
                                                                                                end interface
                                                                                            contains
                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                            end module
                                                                                            
                                                                                            real(8) function code(x, y, z, t, a, b)
                                                                                            use fmin_fmax_functions
                                                                                                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 = (a * 27.0d0) * b
                                                                                            end function
                                                                                            
                                                                                            assert x < y && y < z && z < t && t < a && a < b;
                                                                                            public static double code(double x, double y, double z, double t, double a, double b) {
                                                                                            	return (a * 27.0) * b;
                                                                                            }
                                                                                            
                                                                                            [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                                            def code(x, y, z, t, a, b):
                                                                                            	return (a * 27.0) * b
                                                                                            
                                                                                            x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                            function code(x, y, z, t, a, b)
                                                                                            	return Float64(Float64(a * 27.0) * b)
                                                                                            end
                                                                                            
                                                                                            x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                                            function tmp = code(x, y, z, t, a, b)
                                                                                            	tmp = (a * 27.0) * b;
                                                                                            end
                                                                                            
                                                                                            NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                            code[x_, y_, z_, t_, a_, b_] := N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                            \\
                                                                                            \left(a \cdot 27\right) \cdot b
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            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. Add Preprocessing
                                                                                            3. Taylor expanded in y around 0

                                                                                              \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. lower-fma.f64N/A

                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right)\right)} \]
                                                                                              2. *-commutativeN/A

                                                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                              3. lower-*.f64N/A

                                                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(a \cdot b\right) \cdot 27}\right) \]
                                                                                              4. *-commutativeN/A

                                                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                              5. lower-*.f6462.1

                                                                                                \[\leadsto \mathsf{fma}\left(2, x, \color{blue}{\left(b \cdot a\right)} \cdot 27\right) \]
                                                                                            5. Applied rewrites62.1%

                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, x, \left(b \cdot a\right) \cdot 27\right)} \]
                                                                                            6. Taylor expanded in x around 0

                                                                                              \[\leadsto 27 \cdot \color{blue}{\left(a \cdot b\right)} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites34.0%

                                                                                                \[\leadsto \left(a \cdot b\right) \cdot \color{blue}{27} \]
                                                                                              2. Step-by-step derivation
                                                                                                1. Applied rewrites34.0%

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

                                                                                                Developer Target 1: 95.0% 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;
                                                                                                }
                                                                                                
                                                                                                module fmin_fmax_functions
                                                                                                    implicit none
                                                                                                    private
                                                                                                    public fmax
                                                                                                    public fmin
                                                                                                
                                                                                                    interface fmax
                                                                                                        module procedure fmax88
                                                                                                        module procedure fmax44
                                                                                                        module procedure fmax84
                                                                                                        module procedure fmax48
                                                                                                    end interface
                                                                                                    interface fmin
                                                                                                        module procedure fmin88
                                                                                                        module procedure fmin44
                                                                                                        module procedure fmin84
                                                                                                        module procedure fmin48
                                                                                                    end interface
                                                                                                contains
                                                                                                    real(8) function fmax88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmax44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmin44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                end module
                                                                                                
                                                                                                real(8) function code(x, y, z, t, a, b)
                                                                                                use fmin_fmax_functions
                                                                                                    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 2024364 
                                                                                                (FPCore (x y z t a b)
                                                                                                  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
                                                                                                  :precision binary64
                                                                                                
                                                                                                  :alt
                                                                                                  (! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
                                                                                                
                                                                                                  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))