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

Percentage Accurate: 95.7% → 98.7%
Time: 6.9s
Alternatives: 13
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
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.7% accurate, 0.9× speedup?

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

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


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

    1. Initial program 86.0%

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

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

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

      if -8.7999999999999999e30 < z

      1. Initial program 95.7%

        \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      2. 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. 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) \]
        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 87.6% accurate, 0.3× speedup?

    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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\\ t_2 := \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+130}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+100}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, 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.
    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))
            (t_2 (fma -9.0 (* (* z y) t) (* (* b a) 27.0))))
       (if (<= t_1 (- INFINITY))
         (* -9.0 (* (* t y) z))
         (if (<= t_1 -1e+130)
           t_2
           (if (<= t_1 5e+100)
             (fma (* b 27.0) a (+ x x))
             (if (<= t_1 2e+305) t_2 (fma (* -9.0 z) (* t y) (* 2.0 x))))))))
    assert(x < y && y < z && z < t && t < a && a < 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 t_2 = fma(-9.0, ((z * y) * t), ((b * a) * 27.0));
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = -9.0 * ((t * y) * z);
    	} else if (t_1 <= -1e+130) {
    		tmp = t_2;
    	} else if (t_1 <= 5e+100) {
    		tmp = fma((b * 27.0), a, (x + x));
    	} else if (t_1 <= 2e+305) {
    		tmp = t_2;
    	} else {
    		tmp = fma((-9.0 * z), (t * y), (2.0 * x));
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b = sort([x, y, z, t, a, b])
    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)
    	t_2 = fma(-9.0, Float64(Float64(z * y) * t), Float64(Float64(b * a) * 27.0))
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = Float64(-9.0 * Float64(Float64(t * y) * z));
    	elseif (t_1 <= -1e+130)
    		tmp = t_2;
    	elseif (t_1 <= 5e+100)
    		tmp = fma(Float64(b * 27.0), a, Float64(x + x));
    	elseif (t_1 <= 2e+305)
    		tmp = t_2;
    	else
    		tmp = fma(Float64(-9.0 * z), Float64(t * y), 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.
    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]}, Block[{t$95$2 = N[(-9.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(-9.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+130], t$95$2, If[LessEqual[t$95$1, 5e+100], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], t$95$2, N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
    [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\\
    t_2 := \mathsf{fma}\left(-9, \left(z \cdot y\right) \cdot t, \left(b \cdot a\right) \cdot 27\right)\\
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\
    
    \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+130}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+100}:\\
    \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+305}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, 2 \cdot x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -inf.0

      1. Initial program 63.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 inf

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

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

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

          if -inf.0 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -1.0000000000000001e130 or 4.9999999999999999e100 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 1.9999999999999999e305

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

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

            if -1.0000000000000001e130 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.9999999999999999e100

            1. Initial program 99.6%

              \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{2 \cdot x} + \left(a \cdot 27\right) \cdot b \]
            4. Step-by-step derivation
              1. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                4. associate-*r*N/A

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

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

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

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

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

                if 1.9999999999999999e305 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                1. Initial program 78.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 a around 0

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

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

                Alternative 3: 85.5% accurate, 0.5× speedup?

                \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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 -1 \cdot 10^{+130} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+100}\right):\\ \;\;\;\;\mathsf{fma}\left(b \cdot a, 27, \left(\left(z \cdot t\right) \cdot -9\right) \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \end{array} \end{array} \]
                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                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 -1e+130) (not (<= t_1 5e+100)))
                     (fma (* b a) 27.0 (* (* (* z t) -9.0) y))
                     (fma (* b 27.0) a (+ x x)))))
                assert(x < y && y < z && z < t && t < a && a < 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 <= -1e+130) || !(t_1 <= 5e+100)) {
                		tmp = fma((b * a), 27.0, (((z * t) * -9.0) * y));
                	} else {
                		tmp = fma((b * 27.0), a, (x + x));
                	}
                	return tmp;
                }
                
                x, y, z, t, a, b = sort([x, y, z, t, a, b])
                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 <= -1e+130) || !(t_1 <= 5e+100))
                		tmp = fma(Float64(b * a), 27.0, Float64(Float64(Float64(z * t) * -9.0) * y));
                	else
                		tmp = fma(Float64(b * 27.0), a, 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.
                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, -1e+130], N[Not[LessEqual[t$95$1, 5e+100]], $MachinePrecision]], N[(N[(b * a), $MachinePrecision] * 27.0 + N[(N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                [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 -1 \cdot 10^{+130} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+100}\right):\\
                \;\;\;\;\mathsf{fma}\left(b \cdot a, 27, \left(\left(z \cdot t\right) \cdot -9\right) \cdot y\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\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.0000000000000001e130 or 4.9999999999999999e100 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

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

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

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

                      if -1.0000000000000001e130 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 4.9999999999999999e100

                      1. Initial program 99.6%

                        \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                      2. Add Preprocessing
                      3. Taylor expanded in x around inf

                        \[\leadsto \color{blue}{2 \cdot x} + \left(a \cdot 27\right) \cdot b \]
                      4. Step-by-step derivation
                        1. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                          4. associate-*r*N/A

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

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

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

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

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

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

                        Alternative 4: 82.6% accurate, 0.6× speedup?

                        \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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^{+153} \lor \neg \left(t\_1 \leq 10^{+171}\right):\\ \;\;\;\;\left(\left(-9 \cdot z\right) \cdot t\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \end{array} \end{array} \]
                        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                        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+153) (not (<= t_1 1e+171)))
                             (* (* (* -9.0 z) t) y)
                             (fma (* b 27.0) a (+ x x)))))
                        assert(x < y && y < z && z < t && t < a && a < 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+153) || !(t_1 <= 1e+171)) {
                        		tmp = ((-9.0 * z) * t) * y;
                        	} else {
                        		tmp = fma((b * 27.0), a, (x + x));
                        	}
                        	return tmp;
                        }
                        
                        x, y, z, t, a, b = sort([x, y, z, t, a, b])
                        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+153) || !(t_1 <= 1e+171))
                        		tmp = Float64(Float64(Float64(-9.0 * z) * t) * y);
                        	else
                        		tmp = fma(Float64(b * 27.0), a, 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.
                        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+153], N[Not[LessEqual[t$95$1, 1e+171]], $MachinePrecision]], N[(N[(N[(-9.0 * z), $MachinePrecision] * t), $MachinePrecision] * y), $MachinePrecision], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                        [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^{+153} \lor \neg \left(t\_1 \leq 10^{+171}\right):\\
                        \;\;\;\;\left(\left(-9 \cdot z\right) \cdot t\right) \cdot y\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -2e153 or 9.99999999999999954e170 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                          1. Initial program 79.9%

                            \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                          2. Add Preprocessing
                          3. Taylor expanded in y around inf

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

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

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

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

                                if -2e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.99999999999999954e170

                                1. Initial program 99.6%

                                  \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around inf

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

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

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

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

                                      \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b} + 2 \cdot x \]
                                    4. lower-fma.f6489.8

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

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

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

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

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

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

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

                                      \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                                    4. associate-*r*N/A

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

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

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

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

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

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

                                  Alternative 5: 81.6% accurate, 0.6× speedup?

                                  \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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 -5 \cdot 10^{+186} \lor \neg \left(t\_1 \leq 10^{+171}\right):\\ \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \end{array} \end{array} \]
                                  NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                  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 -5e+186) (not (<= t_1 1e+171)))
                                       (* -9.0 (* (* t y) z))
                                       (fma (* b 27.0) a (+ x x)))))
                                  assert(x < y && y < z && z < t && t < a && a < 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 <= -5e+186) || !(t_1 <= 1e+171)) {
                                  		tmp = -9.0 * ((t * y) * z);
                                  	} else {
                                  		tmp = fma((b * 27.0), a, (x + x));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                  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 <= -5e+186) || !(t_1 <= 1e+171))
                                  		tmp = Float64(-9.0 * Float64(Float64(t * y) * z));
                                  	else
                                  		tmp = fma(Float64(b * 27.0), a, 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.
                                  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, -5e+186], N[Not[LessEqual[t$95$1, 1e+171]], $MachinePrecision]], N[(-9.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                  [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 -5 \cdot 10^{+186} \lor \neg \left(t\_1 \leq 10^{+171}\right):\\
                                  \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.99999999999999954e186 or 9.99999999999999954e170 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                    1. Initial program 79.7%

                                      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in y around inf

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

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

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

                                        if -4.99999999999999954e186 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.99999999999999954e170

                                        1. Initial program 99.6%

                                          \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                                            4. associate-*r*N/A

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

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

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

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

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

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

                                          Alternative 6: 82.6% accurate, 0.6× speedup?

                                          \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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^{+153}:\\ \;\;\;\;\left(\left(-9 \cdot z\right) \cdot t\right) \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+171}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot t\right) \cdot -9\right) \cdot y\\ \end{array} \end{array} \]
                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                          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+153)
                                               (* (* (* -9.0 z) t) y)
                                               (if (<= t_1 1e+171) (fma (* b 27.0) a (+ x x)) (* (* (* z t) -9.0) y)))))
                                          assert(x < y && y < z && z < t && t < a && a < 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+153) {
                                          		tmp = ((-9.0 * z) * t) * y;
                                          	} else if (t_1 <= 1e+171) {
                                          		tmp = fma((b * 27.0), a, (x + x));
                                          	} else {
                                          		tmp = ((z * t) * -9.0) * y;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                          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+153)
                                          		tmp = Float64(Float64(Float64(-9.0 * z) * t) * y);
                                          	elseif (t_1 <= 1e+171)
                                          		tmp = fma(Float64(b * 27.0), a, Float64(x + x));
                                          	else
                                          		tmp = Float64(Float64(Float64(z * t) * -9.0) * y);
                                          	end
                                          	return tmp
                                          end
                                          
                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                          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+153], N[(N[(N[(-9.0 * z), $MachinePrecision] * t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+171], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision]]]]
                                          
                                          \begin{array}{l}
                                          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                          [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^{+153}:\\
                                          \;\;\;\;\left(\left(-9 \cdot z\right) \cdot t\right) \cdot y\\
                                          
                                          \mathbf{elif}\;t\_1 \leq 10^{+171}:\\
                                          \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\left(\left(z \cdot t\right) \cdot -9\right) \cdot y\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -2e153

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

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

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

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

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

                                                  if -2e153 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.99999999999999954e170

                                                  1. Initial program 99.6%

                                                    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in x around inf

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

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

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

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

                                                        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b} + 2 \cdot x \]
                                                      4. lower-fma.f6489.8

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

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

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

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

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

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

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

                                                        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                                                      4. associate-*r*N/A

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

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

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

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

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

                                                      if 9.99999999999999954e170 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                      1. Initial program 86.1%

                                                        \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in y around inf

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

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

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

                                                        Alternative 7: 81.6% accurate, 0.6× speedup?

                                                        \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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 -5 \cdot 10^{+186}:\\ \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+171}:\\ \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-9 \cdot \left(t \cdot y\right)\right) \cdot z\\ \end{array} \end{array} \]
                                                        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                        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 -5e+186)
                                                             (* -9.0 (* (* t y) z))
                                                             (if (<= t_1 1e+171) (fma (* b 27.0) a (+ x x)) (* (* -9.0 (* t y)) z)))))
                                                        assert(x < y && y < z && z < t && t < a && a < 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 <= -5e+186) {
                                                        		tmp = -9.0 * ((t * y) * z);
                                                        	} else if (t_1 <= 1e+171) {
                                                        		tmp = fma((b * 27.0), a, (x + x));
                                                        	} else {
                                                        		tmp = (-9.0 * (t * y)) * z;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                        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 <= -5e+186)
                                                        		tmp = Float64(-9.0 * Float64(Float64(t * y) * z));
                                                        	elseif (t_1 <= 1e+171)
                                                        		tmp = fma(Float64(b * 27.0), a, Float64(x + x));
                                                        	else
                                                        		tmp = Float64(Float64(-9.0 * Float64(t * y)) * z);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                        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, -5e+186], N[(-9.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+171], N[(N[(b * 27.0), $MachinePrecision] * a + N[(x + x), $MachinePrecision]), $MachinePrecision], N[(N[(-9.0 * N[(t * y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]
                                                        
                                                        \begin{array}{l}
                                                        [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                        [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 -5 \cdot 10^{+186}:\\
                                                        \;\;\;\;-9 \cdot \left(\left(t \cdot y\right) \cdot z\right)\\
                                                        
                                                        \mathbf{elif}\;t\_1 \leq 10^{+171}:\\
                                                        \;\;\;\;\mathsf{fma}\left(b \cdot 27, a, x + x\right)\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\left(-9 \cdot \left(t \cdot y\right)\right) \cdot z\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < -4.99999999999999954e186

                                                          1. Initial program 74.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 inf

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

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

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

                                                              if -4.99999999999999954e186 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t) < 9.99999999999999954e170

                                                              1. Initial program 99.6%

                                                                \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in x around inf

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                                                                  4. associate-*r*N/A

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

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

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

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

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

                                                                  if 9.99999999999999954e170 < (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)

                                                                  1. Initial program 86.1%

                                                                    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in y around inf

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

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

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

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

                                                                      Alternative 8: 52.3% accurate, 0.9× speedup?

                                                                      \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(a \cdot 27\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28} \lor \neg \left(t\_1 \leq 10^{-12}\right):\\ \;\;\;\;\left(27 \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + x\\ \end{array} \end{array} \]
                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                      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 (* (* a 27.0) b)))
                                                                         (if (or (<= t_1 -2e+28) (not (<= t_1 1e-12))) (* (* 27.0 a) b) (+ x x))))
                                                                      assert(x < y && y < z && z < t && t < a && a < 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 = (a * 27.0) * b;
                                                                      	double tmp;
                                                                      	if ((t_1 <= -2e+28) || !(t_1 <= 1e-12)) {
                                                                      		tmp = (27.0 * a) * b;
                                                                      	} else {
                                                                      		tmp = x + x;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                      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
                                                                          real(8) :: t_1
                                                                          real(8) :: tmp
                                                                          t_1 = (a * 27.0d0) * b
                                                                          if ((t_1 <= (-2d+28)) .or. (.not. (t_1 <= 1d-12))) then
                                                                              tmp = (27.0d0 * a) * b
                                                                          else
                                                                              tmp = x + x
                                                                          end if
                                                                          code = tmp
                                                                      end function
                                                                      
                                                                      assert x < y && y < z && z < t && t < a && a < b;
                                                                      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) {
                                                                      	double t_1 = (a * 27.0) * b;
                                                                      	double tmp;
                                                                      	if ((t_1 <= -2e+28) || !(t_1 <= 1e-12)) {
                                                                      		tmp = (27.0 * a) * b;
                                                                      	} else {
                                                                      		tmp = x + x;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                      [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                      def code(x, y, z, t, a, b):
                                                                      	t_1 = (a * 27.0) * b
                                                                      	tmp = 0
                                                                      	if (t_1 <= -2e+28) or not (t_1 <= 1e-12):
                                                                      		tmp = (27.0 * a) * b
                                                                      	else:
                                                                      		tmp = x + x
                                                                      	return tmp
                                                                      
                                                                      x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                      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(a * 27.0) * b)
                                                                      	tmp = 0.0
                                                                      	if ((t_1 <= -2e+28) || !(t_1 <= 1e-12))
                                                                      		tmp = Float64(Float64(27.0 * a) * b);
                                                                      	else
                                                                      		tmp = Float64(x + x);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                      x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                      function tmp_2 = code(x, y, z, t, a, b)
                                                                      	t_1 = (a * 27.0) * b;
                                                                      	tmp = 0.0;
                                                                      	if ((t_1 <= -2e+28) || ~((t_1 <= 1e-12)))
                                                                      		tmp = (27.0 * a) * b;
                                                                      	else
                                                                      		tmp = x + x;
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                      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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+28], N[Not[LessEqual[t$95$1, 1e-12]], $MachinePrecision]], N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision], N[(x + x), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                                      [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                      \\
                                                                      \begin{array}{l}
                                                                      t_1 := \left(a \cdot 27\right) \cdot b\\
                                                                      \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28} \lor \neg \left(t\_1 \leq 10^{-12}\right):\\
                                                                      \;\;\;\;\left(27 \cdot a\right) \cdot b\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;x + x\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 2 regimes
                                                                      2. if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.99999999999999992e28 or 9.9999999999999998e-13 < (*.f64 (*.f64 a #s(literal 27 binary64)) b)

                                                                        1. Initial program 93.2%

                                                                          \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in a around inf

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

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

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

                                                                            if -1.99999999999999992e28 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 9.9999999999999998e-13

                                                                            1. Initial program 93.7%

                                                                              \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in x around inf

                                                                              \[\leadsto \color{blue}{2 \cdot x} \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites51.7%

                                                                                \[\leadsto \color{blue}{2 \cdot x} \]
                                                                              2. Step-by-step derivation
                                                                                1. Applied rewrites51.7%

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

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(a \cdot 27\right) \cdot b \leq -2 \cdot 10^{+28} \lor \neg \left(\left(a \cdot 27\right) \cdot b \leq 10^{-12}\right):\\ \;\;\;\;\left(27 \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + x\\ \end{array} \]
                                                                              5. Add Preprocessing

                                                                              Alternative 9: 52.3% accurate, 0.9× speedup?

                                                                              \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := \left(a \cdot 27\right) \cdot b\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28}:\\ \;\;\;\;\left(27 \cdot a\right) \cdot b\\ \mathbf{elif}\;t\_1 \leq 10^{-12}:\\ \;\;\;\;x + x\\ \mathbf{else}:\\ \;\;\;\;\left(27 \cdot b\right) \cdot a\\ \end{array} \end{array} \]
                                                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                              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 (* (* a 27.0) b)))
                                                                                 (if (<= t_1 -2e+28)
                                                                                   (* (* 27.0 a) b)
                                                                                   (if (<= t_1 1e-12) (+ x x) (* (* 27.0 b) a)))))
                                                                              assert(x < y && y < z && z < t && t < a && a < 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 = (a * 27.0) * b;
                                                                              	double tmp;
                                                                              	if (t_1 <= -2e+28) {
                                                                              		tmp = (27.0 * a) * b;
                                                                              	} else if (t_1 <= 1e-12) {
                                                                              		tmp = x + x;
                                                                              	} else {
                                                                              		tmp = (27.0 * b) * a;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                              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
                                                                                  real(8) :: t_1
                                                                                  real(8) :: tmp
                                                                                  t_1 = (a * 27.0d0) * b
                                                                                  if (t_1 <= (-2d+28)) then
                                                                                      tmp = (27.0d0 * a) * b
                                                                                  else if (t_1 <= 1d-12) then
                                                                                      tmp = x + x
                                                                                  else
                                                                                      tmp = (27.0d0 * b) * a
                                                                                  end if
                                                                                  code = tmp
                                                                              end function
                                                                              
                                                                              assert x < y && y < z && z < t && t < a && a < b;
                                                                              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) {
                                                                              	double t_1 = (a * 27.0) * b;
                                                                              	double tmp;
                                                                              	if (t_1 <= -2e+28) {
                                                                              		tmp = (27.0 * a) * b;
                                                                              	} else if (t_1 <= 1e-12) {
                                                                              		tmp = x + x;
                                                                              	} else {
                                                                              		tmp = (27.0 * b) * a;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                              [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                              def code(x, y, z, t, a, b):
                                                                              	t_1 = (a * 27.0) * b
                                                                              	tmp = 0
                                                                              	if t_1 <= -2e+28:
                                                                              		tmp = (27.0 * a) * b
                                                                              	elif t_1 <= 1e-12:
                                                                              		tmp = x + x
                                                                              	else:
                                                                              		tmp = (27.0 * b) * a
                                                                              	return tmp
                                                                              
                                                                              x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                              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(a * 27.0) * b)
                                                                              	tmp = 0.0
                                                                              	if (t_1 <= -2e+28)
                                                                              		tmp = Float64(Float64(27.0 * a) * b);
                                                                              	elseif (t_1 <= 1e-12)
                                                                              		tmp = Float64(x + x);
                                                                              	else
                                                                              		tmp = Float64(Float64(27.0 * b) * a);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                              x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                              function tmp_2 = code(x, y, z, t, a, b)
                                                                              	t_1 = (a * 27.0) * b;
                                                                              	tmp = 0.0;
                                                                              	if (t_1 <= -2e+28)
                                                                              		tmp = (27.0 * a) * b;
                                                                              	elseif (t_1 <= 1e-12)
                                                                              		tmp = x + x;
                                                                              	else
                                                                              		tmp = (27.0 * b) * a;
                                                                              	end
                                                                              	tmp_2 = tmp;
                                                                              end
                                                                              
                                                                              NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                              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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+28], N[(N[(27.0 * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t$95$1, 1e-12], N[(x + x), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a), $MachinePrecision]]]]
                                                                              
                                                                              \begin{array}{l}
                                                                              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                                              [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                              \\
                                                                              \begin{array}{l}
                                                                              t_1 := \left(a \cdot 27\right) \cdot b\\
                                                                              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+28}:\\
                                                                              \;\;\;\;\left(27 \cdot a\right) \cdot b\\
                                                                              
                                                                              \mathbf{elif}\;t\_1 \leq 10^{-12}:\\
                                                                              \;\;\;\;x + x\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\left(27 \cdot b\right) \cdot a\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 3 regimes
                                                                              2. if (*.f64 (*.f64 a #s(literal 27 binary64)) b) < -1.99999999999999992e28

                                                                                1. Initial program 95.7%

                                                                                  \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in a around inf

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

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

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

                                                                                    if -1.99999999999999992e28 < (*.f64 (*.f64 a #s(literal 27 binary64)) b) < 9.9999999999999998e-13

                                                                                    1. Initial program 93.7%

                                                                                      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in x around inf

                                                                                      \[\leadsto \color{blue}{2 \cdot x} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. Applied rewrites51.7%

                                                                                        \[\leadsto \color{blue}{2 \cdot x} \]
                                                                                      2. Step-by-step derivation
                                                                                        1. Applied rewrites51.7%

                                                                                          \[\leadsto x + \color{blue}{x} \]

                                                                                        if 9.9999999999999998e-13 < (*.f64 (*.f64 a #s(literal 27 binary64)) b)

                                                                                        1. Initial program 90.8%

                                                                                          \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in a around inf

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

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

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

                                                                                          Alternative 10: 98.7% accurate, 0.9× speedup?

                                                                                          \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1000:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(b \cdot a, 27, 2 \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, -9, \mathsf{fma}\left(2, x, b \cdot \left(27 \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
                                                                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                          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 (<= t 1000.0)
                                                                                             (fma (* -9.0 z) (* t y) (fma (* b a) 27.0 (* 2.0 x)))
                                                                                             (fma (* (* z y) t) -9.0 (fma 2.0 x (* b (* 27.0 a))))))
                                                                                          assert(x < y && y < z && z < t && t < a && a < 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 tmp;
                                                                                          	if (t <= 1000.0) {
                                                                                          		tmp = fma((-9.0 * z), (t * y), fma((b * a), 27.0, (2.0 * x)));
                                                                                          	} else {
                                                                                          		tmp = fma(((z * y) * t), -9.0, fma(2.0, x, (b * (27.0 * a))));
                                                                                          	}
                                                                                          	return tmp;
                                                                                          }
                                                                                          
                                                                                          x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                          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 (t <= 1000.0)
                                                                                          		tmp = fma(Float64(-9.0 * z), Float64(t * y), fma(Float64(b * a), 27.0, Float64(2.0 * x)));
                                                                                          	else
                                                                                          		tmp = fma(Float64(Float64(z * y) * t), -9.0, fma(2.0, x, Float64(b * Float64(27.0 * a))));
                                                                                          	end
                                                                                          	return tmp
                                                                                          end
                                                                                          
                                                                                          NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                          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[t, 1000.0], N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * -9.0 + N[(2.0 * x + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                                                          [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                          \\
                                                                                          \begin{array}{l}
                                                                                          \mathbf{if}\;t \leq 1000:\\
                                                                                          \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(b \cdot a, 27, 2 \cdot x\right)\right)\\
                                                                                          
                                                                                          \mathbf{else}:\\
                                                                                          \;\;\;\;\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, -9, \mathsf{fma}\left(2, x, b \cdot \left(27 \cdot a\right)\right)\right)\\
                                                                                          
                                                                                          
                                                                                          \end{array}
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Split input into 2 regimes
                                                                                          2. if t < 1e3

                                                                                            1. Initial program 91.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 x around 0

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

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

                                                                                              if 1e3 < t

                                                                                              1. Initial program 99.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. 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 \]
                                                                                                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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{9 \cdot y}\right)\right) \cdot \left(t \cdot z\right) + \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(9\right)\right) \cdot y\right)} \cdot \left(t \cdot z\right) + \left(x \cdot 2 + \left(a \cdot 27\right) \cdot b\right) \]
                                                                                                9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            Alternative 11: 92.0% accurate, 0.9× speedup?

                                                                                            \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{+188}:\\ \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(b \cdot a, 27, 2 \cdot x\right)\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.
                                                                                            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 (<= t 8.6e+188)
                                                                                               (fma (* -9.0 z) (* t y) (fma (* b a) 27.0 (* 2.0 x)))
                                                                                               (fma -9.0 (* (* z y) t) (* (* b a) 27.0))))
                                                                                            assert(x < y && y < z && z < t && t < a && a < 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 tmp;
                                                                                            	if (t <= 8.6e+188) {
                                                                                            		tmp = fma((-9.0 * z), (t * y), fma((b * a), 27.0, (2.0 * x)));
                                                                                            	} 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])
                                                                                            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 (t <= 8.6e+188)
                                                                                            		tmp = fma(Float64(-9.0 * z), Float64(t * y), fma(Float64(b * a), 27.0, Float64(2.0 * x)));
                                                                                            	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.
                                                                                            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[t, 8.6e+188], N[(N[(-9.0 * z), $MachinePrecision] * N[(t * y), $MachinePrecision] + N[(N[(b * a), $MachinePrecision] * 27.0 + N[(2.0 * x), $MachinePrecision]), $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])\\\\
                                                                                            [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;t \leq 8.6 \cdot 10^{+188}:\\
                                                                                            \;\;\;\;\mathsf{fma}\left(-9 \cdot z, t \cdot y, \mathsf{fma}\left(b \cdot a, 27, 2 \cdot x\right)\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 2 regimes
                                                                                            2. if t < 8.5999999999999997e188

                                                                                              1. Initial program 93.0%

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

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

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

                                                                                                if 8.5999999999999997e188 < t

                                                                                                1. Initial program 98.1%

                                                                                                  \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                                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. Applied rewrites93.6%

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

                                                                                                Alternative 12: 64.1% accurate, 2.5× speedup?

                                                                                                \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \mathsf{fma}\left(b \cdot 27, a, x + x\right) \end{array} \]
                                                                                                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                                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);
                                                                                                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])
                                                                                                x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                                function code(x, y, z, t, a, b)
                                                                                                	return fma(Float64(b * 27.0), a, Float64(x + x))
                                                                                                end
                                                                                                
                                                                                                NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                                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 + N[(x + x), $MachinePrecision]), $MachinePrecision]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                                                                [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                                \\
                                                                                                \mathsf{fma}\left(b \cdot 27, a, x + x\right)
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Initial program 93.4%

                                                                                                  \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in x around inf

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

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

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

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

                                                                                                      \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b} + 2 \cdot x \]
                                                                                                    4. lower-fma.f6469.0

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

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

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

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

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

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

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

                                                                                                      \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} + 2 \cdot x \]
                                                                                                    4. associate-*r*N/A

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

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

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

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

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

                                                                                                    Alternative 13: 31.1% accurate, 9.3× speedup?

                                                                                                    \[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ x + x \end{array} \]
                                                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                                    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 (+ x x))
                                                                                                    assert(x < y && y < z && z < t && t < a && a < 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 x + x;
                                                                                                    }
                                                                                                    
                                                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                                    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 = x + x
                                                                                                    end function
                                                                                                    
                                                                                                    assert x < y && y < z && z < t && t < a && a < b;
                                                                                                    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 x + x;
                                                                                                    }
                                                                                                    
                                                                                                    [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                                                    [x, y, z, t, a, b] = sort([x, y, z, t, a, b])
                                                                                                    def code(x, y, z, t, a, b):
                                                                                                    	return x + x
                                                                                                    
                                                                                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                                    x, y, z, t, a, b = sort([x, y, z, t, a, b])
                                                                                                    function code(x, y, z, t, a, b)
                                                                                                    	return Float64(x + x)
                                                                                                    end
                                                                                                    
                                                                                                    x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                                                    x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
                                                                                                    function tmp = code(x, y, z, t, a, b)
                                                                                                    	tmp = x + x;
                                                                                                    end
                                                                                                    
                                                                                                    NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
                                                                                                    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[(x + x), $MachinePrecision]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
                                                                                                    [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
                                                                                                    \\
                                                                                                    x + x
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Initial program 93.4%

                                                                                                      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
                                                                                                    2. Add Preprocessing
                                                                                                    3. Taylor expanded in x around inf

                                                                                                      \[\leadsto \color{blue}{2 \cdot x} \]
                                                                                                    4. Step-by-step derivation
                                                                                                      1. Applied rewrites30.2%

                                                                                                        \[\leadsto \color{blue}{2 \cdot x} \]
                                                                                                      2. Step-by-step derivation
                                                                                                        1. Applied rewrites30.2%

                                                                                                          \[\leadsto x + \color{blue}{x} \]
                                                                                                        2. Add Preprocessing

                                                                                                        Developer Target 1: 95.2% accurate, 0.9× speedup?

                                                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
                                                                                                        (FPCore (x y z t a b)
                                                                                                         :precision binary64
                                                                                                         (if (< y 7.590524218811189e-161)
                                                                                                           (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
                                                                                                           (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
                                                                                                        double code(double x, double y, double z, double t, double a, double b) {
                                                                                                        	double tmp;
                                                                                                        	if (y < 7.590524218811189e-161) {
                                                                                                        		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
                                                                                                        	} else {
                                                                                                        		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
                                                                                                        	}
                                                                                                        	return tmp;
                                                                                                        }
                                                                                                        
                                                                                                        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 2025021 
                                                                                                        (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)))