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

Percentage Accurate: 79.9% → 87.1%
Time: 6.3s
Alternatives: 17
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
    code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c):
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}

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 17 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: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, c)
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), intent (in) :: c
    code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c):
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}

Alternative 1: 87.1% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b - a \cdot \left(t \cdot \left(4 \cdot z\right)\right)\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(9 \cdot x, \frac{y}{z}, \frac{\left(\left(t \cdot a\right) \cdot z\right) \cdot -4}{z}\right), \frac{1}{c}, \frac{b}{c \cdot z}\right)\\


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

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(-4 \cdot \frac{a}{c} + \left(9 \cdot \frac{x \cdot y}{c \cdot \left(t \cdot z\right)} + \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      7. lower-*.f64N/A

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      9. lower-/.f64N/A

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      11. lower-*.f6469.2

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
    4. Applied rewrites69.2%

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

    if -4.4999999999999998e145 < z < 4.00000000000000015e-10

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y - \left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)}}{z \cdot c} \]
      4. sub-flipN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, \mathsf{neg}\left(\left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)\right)\right)}{z \cdot c} \]
      10. sub-negate-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot x, y, \color{blue}{b - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right)}{z \cdot c} \]
      11. lower--.f6480.2

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000015e-10 < z

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}}{z \cdot c} \]
      3. div-addN/A

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

        \[\leadsto \frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{\color{blue}{z \cdot c}} + \frac{b}{z \cdot c} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z}}{c}} + \frac{b}{z \cdot c} \]
      6. mult-flipN/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z} \cdot \frac{1}{c}} + \frac{b}{z \cdot c} \]
      7. inv-powN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z}, {c}^{-1}, \frac{b}{z \cdot c}\right)} \]
    3. Applied rewrites76.4%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(y \cdot x\right) \cdot 9 - \left(\mathsf{neg}\left(-4\right)\right) \cdot \left(z \cdot \left(a \cdot t\right)\right)}}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right) \]
      5. metadata-evalN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\left(y \cdot x\right) \cdot 9 - \color{blue}{4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right) \]
      13. sub-flip-reverseN/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(y \cdot x\right) \cdot 9 + \left(\mathsf{neg}\left(4 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\right)}}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right) \]
      14. div-addN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{y \cdot \left(x \cdot 9\right)}}{z} + \frac{\mathsf{neg}\left(4 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right) \]
      17. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(x \cdot 9\right) \cdot \frac{y}{z}} + \frac{\mathsf{neg}\left(4 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right) \]
    5. Applied rewrites75.9%

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

Alternative 2: 86.3% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b - a \cdot \left(t \cdot \left(4 \cdot z\right)\right)\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(y \cdot x, 9, -4 \cdot \left(z \cdot \left(a \cdot t\right)\right)\right)}{z}, \frac{1}{c}, \frac{b}{c \cdot z}\right)\\


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

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(-4 \cdot \frac{a}{c} + \left(9 \cdot \frac{x \cdot y}{c \cdot \left(t \cdot z\right)} + \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      7. lower-*.f64N/A

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      9. lower-/.f64N/A

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

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
      11. lower-*.f6469.2

        \[\leadsto t \cdot \mathsf{fma}\left(-4, \frac{a}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot \left(t \cdot z\right)}, \frac{b}{c \cdot \left(t \cdot z\right)}\right)\right) \]
    4. Applied rewrites69.2%

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

    if -4.4999999999999998e145 < z < 1.2e-21

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y - \left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)}}{z \cdot c} \]
      4. sub-flipN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, \mathsf{neg}\left(\left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)\right)\right)}{z \cdot c} \]
      10. sub-negate-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot x, y, \color{blue}{b - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right)}{z \cdot c} \]
      11. lower--.f6480.2

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-21 < z

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}}{z \cdot c} \]
      3. div-addN/A

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

        \[\leadsto \frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{\color{blue}{z \cdot c}} + \frac{b}{z \cdot c} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z}}{c}} + \frac{b}{z \cdot c} \]
      6. mult-flipN/A

        \[\leadsto \color{blue}{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z} \cdot \frac{1}{c}} + \frac{b}{z \cdot c} \]
      7. inv-powN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z}, {c}^{-1}, \frac{b}{z \cdot c}\right)} \]
    3. Applied rewrites76.4%

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

Alternative 3: 86.2% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b - a \cdot \left(t \cdot \left(4 \cdot z\right)\right)\right)}{c}}{z}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -5.0000000000000003e-296

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(z \cdot \left(t \cdot a\right)\right)}\right) + b}{z \cdot c} \]
      16. metadata-evalN/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, -4 \cdot \left(z \cdot \color{blue}{\left(a \cdot t\right)}\right)\right) + b}{z \cdot c} \]
      19. lower-*.f6480.4

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

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

    if -5.0000000000000003e-296 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
    3. Applied rewrites80.5%

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

    if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c))

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      8. lower-*.f6456.0

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites56.0%

      \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
    5. Taylor expanded in a around inf

      \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      4. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      5. lower-/.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      6. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      8. lower-*.f6458.7

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
    7. Applied rewrites58.7%

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

Alternative 4: 86.0% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b - a \cdot \left(t \cdot \left(4 \cdot z\right)\right)\right)}{c}}{z}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -5.0000000000000003e-296

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(z \cdot \left(t \cdot a\right)\right)}\right) + b}{z \cdot c} \]
      16. metadata-evalN/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, -4 \cdot \left(z \cdot \color{blue}{\left(a \cdot t\right)}\right)\right) + b}{z \cdot c} \]
      19. lower-*.f6480.4

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

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

    if -5.0000000000000003e-296 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
    3. Applied rewrites80.5%

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

    if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c))

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
      8. lower-*.f6456.0

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites56.0%

      \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
    5. Taylor expanded in a around inf

      \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      4. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      5. lower-/.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      6. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      7. lower-*.f64N/A

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
      8. lower-*.f6458.7

        \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
    7. Applied rewrites58.7%

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

      \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
      2. lower-/.f6439.9

        \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
    10. Applied rewrites39.9%

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

Alternative 5: 85.3% accurate, 0.9× speedup?

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

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


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

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
    3. Applied rewrites78.9%

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

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + 9 \cdot \frac{x \cdot y}{z}}}{c} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      5. lower-*.f6462.5

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
    7. Applied rewrites62.5%

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

    if -7.7999999999999998e149 < z

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

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

        \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y - \left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)}}{z \cdot c} \]
      4. sub-flipN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, \mathsf{neg}\left(\left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)\right)\right)}{z \cdot c} \]
      10. sub-negate-revN/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot x, y, \color{blue}{b - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right)}{z \cdot c} \]
      11. lower--.f6480.2

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.6% accurate, 0.8× speedup?

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

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+124}:\\
\;\;\;\;\frac{b - \mathsf{fma}\left(a \cdot \left(4 \cdot z\right), t, -9 \cdot \left(x \cdot y\right)\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\


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

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
    3. Applied rewrites78.9%

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

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + 9 \cdot \frac{x \cdot y}{z}}}{c} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      5. lower-*.f6462.5

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
    7. Applied rewrites62.5%

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

    if -1.2e97 < z < 6.2000000000000004e124

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \frac{\color{blue}{b + \left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)}}{z \cdot c} \]
      3. add-flipN/A

        \[\leadsto \frac{\color{blue}{b - \left(\mathsf{neg}\left(\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)\right)\right)}}{z \cdot c} \]
      4. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{b - \left(\mathsf{neg}\left(\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)\right)\right)}}{z \cdot c} \]
      5. lift--.f64N/A

        \[\leadsto \frac{b - \left(\mathsf{neg}\left(\color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)}\right)\right)}{z \cdot c} \]
      6. sub-negate-revN/A

        \[\leadsto \frac{b - \color{blue}{\left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - \left(x \cdot 9\right) \cdot y\right)}}{z \cdot c} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{b - \left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - \color{blue}{\left(x \cdot 9\right) \cdot y}\right)}{z \cdot c} \]
      8. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{b - \mathsf{fma}\left(a \cdot \color{blue}{\left(4 \cdot z\right)}, t, \left(\mathsf{neg}\left(9\right)\right) \cdot \left(x \cdot y\right)\right)}{z \cdot c} \]
      20. lower-*.f64N/A

        \[\leadsto \frac{b - \mathsf{fma}\left(a \cdot \color{blue}{\left(4 \cdot z\right)}, t, \left(\mathsf{neg}\left(9\right)\right) \cdot \left(x \cdot y\right)\right)}{z \cdot c} \]
      21. lower-*.f64N/A

        \[\leadsto \frac{b - \mathsf{fma}\left(a \cdot \left(4 \cdot z\right), t, \color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot \left(x \cdot y\right)}\right)}{z \cdot c} \]
      22. metadata-evalN/A

        \[\leadsto \frac{b - \mathsf{fma}\left(a \cdot \left(4 \cdot z\right), t, \color{blue}{-9} \cdot \left(x \cdot y\right)\right)}{z \cdot c} \]
      23. lower-*.f6480.0

        \[\leadsto \frac{b - \mathsf{fma}\left(a \cdot \left(4 \cdot z\right), t, -9 \cdot \color{blue}{\left(x \cdot y\right)}\right)}{z \cdot c} \]
    3. Applied rewrites80.0%

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

    if 6.2000000000000004e124 < z

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
    3. Applied rewrites78.9%

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

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}}{c} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, \frac{b}{z}\right)}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot \color{blue}{t}, \frac{b}{z}\right)}{c} \]
      3. lower-/.f6463.8

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    7. Applied rewrites63.8%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 74.7% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \leq 1.15 \cdot 10^{-39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{c}}{z}\\


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

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
    3. Applied rewrites78.9%

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

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}}{c} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, \frac{b}{z}\right)}{c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot \color{blue}{t}, \frac{b}{z}\right)}{c} \]
      3. lower-/.f6463.8

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    7. Applied rewrites63.8%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}}{c} \]

    if -9.0000000000000003e-16 < b < 1.15000000000000004e-39

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
    3. Applied rewrites78.9%

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

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + 9 \cdot \frac{x \cdot y}{z}}}{c} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
      5. lower-*.f6462.5

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c} \]
    7. Applied rewrites62.5%

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

    if 1.15000000000000004e-39 < b

    1. Initial program 79.9%

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
    3. Applied rewrites80.5%

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

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

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

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

          \[\leadsto \frac{\frac{\color{blue}{\left(y \cdot x\right)} \cdot 9 + b}{c}}{z} \]
        3. associate-*l*N/A

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

          \[\leadsto \frac{\frac{y \cdot \color{blue}{\left(9 \cdot x\right)} + b}{c}}{z} \]
        5. associate-*r*N/A

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

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

          \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(9 \cdot y, x, b\right)}}{c}}{z} \]
        8. lower-*.f6461.4

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\color{blue}{9 \cdot y}, x, b\right)}{c}}{z} \]
      3. Applied rewrites61.4%

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

    Alternative 8: 74.4% accurate, 1.2× speedup?

    \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
    (FPCore (x y z t a b c)
     :precision binary64
     (let* ((t_1 (/ (fma -4.0 (* a t) (/ b z)) c)))
       (if (<= z -3.5e-22)
         t_1
         (if (<= z 7.5e+122) (/ (/ (fma (* y x) 9.0 b) c) z) t_1))))
    assert(x < y && y < z && z < t && t < a && a < b && b < c);
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double t_1 = fma(-4.0, (a * t), (b / z)) / c;
    	double tmp;
    	if (z <= -3.5e-22) {
    		tmp = t_1;
    	} else if (z <= 7.5e+122) {
    		tmp = (fma((y * x), 9.0, b) / c) / z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
    function code(x, y, z, t, a, b, c)
    	t_1 = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c)
    	tmp = 0.0
    	if (z <= -3.5e-22)
    		tmp = t_1;
    	elseif (z <= 7.5e+122)
    		tmp = Float64(Float64(fma(Float64(y * x), 9.0, b) / c) / z);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -3.5e-22], t$95$1, If[LessEqual[z, 7.5e+122], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
    \\
    \begin{array}{l}
    t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
    \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\
    \;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c}}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -3.50000000000000005e-22 or 7.5000000000000002e122 < z

      1. Initial program 79.9%

        \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
        3. associate-/r*N/A

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

          \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
      3. Applied rewrites78.9%

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

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

        \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}}{c} \]
      6. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, \frac{b}{z}\right)}{c} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot \color{blue}{t}, \frac{b}{z}\right)}{c} \]
        3. lower-/.f6463.8

          \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
      7. Applied rewrites63.8%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}}{c} \]

      if -3.50000000000000005e-22 < z < 7.5000000000000002e122

      1. Initial program 79.9%

        \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
      3. Applied rewrites80.5%

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

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

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

      Alternative 9: 74.4% accurate, 1.2× speedup?

      \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
      (FPCore (x y z t a b c)
       :precision binary64
       (let* ((t_1 (/ (fma -4.0 (* a t) (/ b z)) c)))
         (if (<= z -3.5e-22)
           t_1
           (if (<= z 7.5e+122) (/ (/ (fma (* 9.0 y) x b) c) z) t_1))))
      assert(x < y && y < z && z < t && t < a && a < b && b < c);
      double code(double x, double y, double z, double t, double a, double b, double c) {
      	double t_1 = fma(-4.0, (a * t), (b / z)) / c;
      	double tmp;
      	if (z <= -3.5e-22) {
      		tmp = t_1;
      	} else if (z <= 7.5e+122) {
      		tmp = (fma((9.0 * y), x, b) / c) / z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
      function code(x, y, z, t, a, b, c)
      	t_1 = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c)
      	tmp = 0.0
      	if (z <= -3.5e-22)
      		tmp = t_1;
      	elseif (z <= 7.5e+122)
      		tmp = Float64(Float64(fma(Float64(9.0 * y), x, b) / c) / z);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -3.5e-22], t$95$1, If[LessEqual[z, 7.5e+122], N[(N[(N[(N[(9.0 * y), $MachinePrecision] * x + b), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
      \\
      \begin{array}{l}
      t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
      \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\
      \;\;\;\;\frac{\frac{\mathsf{fma}\left(9 \cdot y, x, b\right)}{c}}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -3.50000000000000005e-22 or 7.5000000000000002e122 < z

        1. Initial program 79.9%

          \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

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

            \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
          3. associate-/r*N/A

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

            \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
        3. Applied rewrites78.9%

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

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

          \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}}{c} \]
        6. Step-by-step derivation
          1. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, \frac{b}{z}\right)}{c} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot \color{blue}{t}, \frac{b}{z}\right)}{c} \]
          3. lower-/.f6463.8

            \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
        7. Applied rewrites63.8%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}}{c} \]

        if -3.50000000000000005e-22 < z < 7.5000000000000002e122

        1. Initial program 79.9%

          \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
        3. Applied rewrites80.5%

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

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

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

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

              \[\leadsto \frac{\frac{\color{blue}{\left(y \cdot x\right)} \cdot 9 + b}{c}}{z} \]
            3. associate-*l*N/A

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

              \[\leadsto \frac{\frac{y \cdot \color{blue}{\left(9 \cdot x\right)} + b}{c}}{z} \]
            5. associate-*r*N/A

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

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

              \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(9 \cdot y, x, b\right)}}{c}}{z} \]
            8. lower-*.f6461.4

              \[\leadsto \frac{\frac{\mathsf{fma}\left(\color{blue}{9 \cdot y}, x, b\right)}{c}}{z} \]
          3. Applied rewrites61.4%

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

        Alternative 10: 74.3% accurate, 1.2× speedup?

        \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
        (FPCore (x y z t a b c)
         :precision binary64
         (let* ((t_1 (/ (fma -4.0 (* a t) (/ b z)) c)))
           (if (<= z -3.5e-22)
             t_1
             (if (<= z 7.5e+122) (/ (fma (* 9.0 x) y b) (* c z)) t_1))))
        assert(x < y && y < z && z < t && t < a && a < b && b < c);
        double code(double x, double y, double z, double t, double a, double b, double c) {
        	double t_1 = fma(-4.0, (a * t), (b / z)) / c;
        	double tmp;
        	if (z <= -3.5e-22) {
        		tmp = t_1;
        	} else if (z <= 7.5e+122) {
        		tmp = fma((9.0 * x), y, b) / (c * z);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
        function code(x, y, z, t, a, b, c)
        	t_1 = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c)
        	tmp = 0.0
        	if (z <= -3.5e-22)
        		tmp = t_1;
        	elseif (z <= 7.5e+122)
        		tmp = Float64(fma(Float64(9.0 * x), y, b) / Float64(c * z));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -3.5e-22], t$95$1, If[LessEqual[z, 7.5e+122], N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
        \\
        \begin{array}{l}
        t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
        \mathbf{if}\;z \leq -3.5 \cdot 10^{-22}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 7.5 \cdot 10^{+122}:\\
        \;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c \cdot z}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.50000000000000005e-22 or 7.5000000000000002e122 < z

          1. Initial program 79.9%

            \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{\color{blue}{z \cdot c}} \]
            3. associate-/r*N/A

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

              \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}} \]
          3. Applied rewrites78.9%

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

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

            \[\leadsto \frac{\color{blue}{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}}{c} \]
          6. Step-by-step derivation
            1. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(-4, \color{blue}{a \cdot t}, \frac{b}{z}\right)}{c} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot \color{blue}{t}, \frac{b}{z}\right)}{c} \]
            3. lower-/.f6463.8

              \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
          7. Applied rewrites63.8%

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}}{c} \]

          if -3.50000000000000005e-22 < z < 7.5000000000000002e122

          1. Initial program 79.9%

            \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

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

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

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

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

              \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
          3. Applied rewrites80.5%

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

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

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

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

                \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c}}}{z} \]
              3. associate-/l/N/A

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

                \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{\color{blue}{c \cdot z}} \]
              5. lower-/.f6460.9

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

                \[\leadsto \frac{\color{blue}{\left(y \cdot x\right) \cdot 9 + b}}{c \cdot z} \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(y \cdot x\right)} \cdot 9 + b}{c \cdot z} \]
              8. associate-*l*N/A

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

                \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y} + b}{c \cdot z} \]
              10. lower-fma.f64N/A

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

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, b\right)}{c \cdot z} \]
              12. lower-*.f6460.9

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, b\right)}{c \cdot z} \]
            3. Applied rewrites60.9%

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

          Alternative 11: 67.9% accurate, 1.2× speedup?

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

            1. Initial program 79.9%

              \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
            2. Taylor expanded in z around inf

              \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto -4 \cdot \color{blue}{\frac{a \cdot t}{c}} \]
              2. lower-/.f64N/A

                \[\leadsto -4 \cdot \frac{a \cdot t}{\color{blue}{c}} \]
              3. lower-*.f6438.2

                \[\leadsto -4 \cdot \frac{a \cdot t}{c} \]
            4. Applied rewrites38.2%

              \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c}} \]

            if -2.05e15 < z < 6.40000000000000038e137

            1. Initial program 79.9%

              \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
            2. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
            3. Applied rewrites80.5%

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c}}}{z} \]
                3. associate-/l/N/A

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

                  \[\leadsto \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{\color{blue}{c \cdot z}} \]
                5. lower-/.f6460.9

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

                  \[\leadsto \frac{\color{blue}{\left(y \cdot x\right) \cdot 9 + b}}{c \cdot z} \]
                7. lift-*.f64N/A

                  \[\leadsto \frac{\color{blue}{\left(y \cdot x\right)} \cdot 9 + b}{c \cdot z} \]
                8. associate-*l*N/A

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

                  \[\leadsto \frac{\color{blue}{\left(x \cdot 9\right) \cdot y} + b}{c \cdot z} \]
                10. lower-fma.f64N/A

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

                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, b\right)}{c \cdot z} \]
                12. lower-*.f6460.9

                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{9 \cdot x}, y, b\right)}{c \cdot z} \]
              3. Applied rewrites60.9%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c \cdot z}} \]

              if 6.40000000000000038e137 < z

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in a around inf

                \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                5. lower-/.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                8. lower-*.f6458.7

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
              7. Applied rewrites58.7%

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

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
                2. lower-/.f6439.9

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
              10. Applied rewrites39.9%

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
            6. Recombined 3 regimes into one program.
            7. Add Preprocessing

            Alternative 12: 52.7% accurate, 0.5× speedup?

            \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\ t_2 := \left(x \cdot 9\right) \cdot y\\ t_3 := \frac{9 \cdot \frac{x \cdot y}{c}}{z}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\ \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\ \mathbf{elif}\;t\_2 \leq 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            (FPCore (x y z t a b c)
             :precision binary64
             (let* ((t_1 (* a (* -4.0 (/ t c))))
                    (t_2 (* (* x 9.0) y))
                    (t_3 (/ (* 9.0 (/ (* x y) c)) z)))
               (if (<= t_2 -2e+141)
                 t_3
                 (if (<= t_2 -2e-181)
                   t_1
                   (if (<= t_2 2e-236)
                     (* (/ b c) (/ 1.0 z))
                     (if (<= t_2 1e+146) t_1 t_3))))))
            assert(x < y && y < z && z < t && t < a && a < b && b < c);
            double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double t_3 = (9.0 * ((x * y) / c)) / z;
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = t_3;
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = t_3;
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, t, a, b, and c 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, c)
            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), intent (in) :: c
                real(8) :: t_1
                real(8) :: t_2
                real(8) :: t_3
                real(8) :: tmp
                t_1 = a * ((-4.0d0) * (t / c))
                t_2 = (x * 9.0d0) * y
                t_3 = (9.0d0 * ((x * y) / c)) / z
                if (t_2 <= (-2d+141)) then
                    tmp = t_3
                else if (t_2 <= (-2d-181)) then
                    tmp = t_1
                else if (t_2 <= 2d-236) then
                    tmp = (b / c) * (1.0d0 / z)
                else if (t_2 <= 1d+146) then
                    tmp = t_1
                else
                    tmp = t_3
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < t && t < a && a < b && b < c;
            public static double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double t_3 = (9.0 * ((x * y) / c)) / z;
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = t_3;
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = t_3;
            	}
            	return tmp;
            }
            
            [x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
            def code(x, y, z, t, a, b, c):
            	t_1 = a * (-4.0 * (t / c))
            	t_2 = (x * 9.0) * y
            	t_3 = (9.0 * ((x * y) / c)) / z
            	tmp = 0
            	if t_2 <= -2e+141:
            		tmp = t_3
            	elif t_2 <= -2e-181:
            		tmp = t_1
            	elif t_2 <= 2e-236:
            		tmp = (b / c) * (1.0 / z)
            	elif t_2 <= 1e+146:
            		tmp = t_1
            	else:
            		tmp = t_3
            	return tmp
            
            x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
            function code(x, y, z, t, a, b, c)
            	t_1 = Float64(a * Float64(-4.0 * Float64(t / c)))
            	t_2 = Float64(Float64(x * 9.0) * y)
            	t_3 = Float64(Float64(9.0 * Float64(Float64(x * y) / c)) / z)
            	tmp = 0.0
            	if (t_2 <= -2e+141)
            		tmp = t_3;
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = Float64(Float64(b / c) * Float64(1.0 / z));
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = t_3;
            	end
            	return tmp
            end
            
            x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
            function tmp_2 = code(x, y, z, t, a, b, c)
            	t_1 = a * (-4.0 * (t / c));
            	t_2 = (x * 9.0) * y;
            	t_3 = (9.0 * ((x * y) / c)) / z;
            	tmp = 0.0;
            	if (t_2 <= -2e+141)
            		tmp = t_3;
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = (b / c) * (1.0 / z);
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = t_3;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+141], t$95$3, If[LessEqual[t$95$2, -2e-181], t$95$1, If[LessEqual[t$95$2, 2e-236], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+146], t$95$1, t$95$3]]]]]]]
            
            \begin{array}{l}
            [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
            \\
            \begin{array}{l}
            t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
            t_2 := \left(x \cdot 9\right) \cdot y\\
            t_3 := \frac{9 \cdot \frac{x \cdot y}{c}}{z}\\
            \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\
            \;\;\;\;t\_3\\
            
            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\
            \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
            
            \mathbf{elif}\;t\_2 \leq 10^{+146}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_3\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e141 or 9.99999999999999934e145 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Step-by-step derivation
                1. lift-/.f64N/A

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
              3. Applied rewrites80.5%

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

                \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{c}}}{z} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{c}}}{z} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{c}}}{z} \]
                3. lower-*.f6435.5

                  \[\leadsto \frac{9 \cdot \frac{x \cdot y}{c}}{z} \]
              6. Applied rewrites35.5%

                \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{c}}}{z} \]

              if -2.00000000000000003e141 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000009e-181 or 2.0000000000000001e-236 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999934e145

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in a around inf

                \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                5. lower-/.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                8. lower-*.f6458.7

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
              7. Applied rewrites58.7%

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

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
                2. lower-/.f6439.9

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
              10. Applied rewrites39.9%

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]

              if -2.00000000000000009e-181 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.0000000000000001e-236

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around inf

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lower-*.f6435.7

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.7%

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
                3. associate-/r*N/A

                  \[\leadsto \frac{\frac{b}{c}}{\color{blue}{z}} \]
                4. mult-flipN/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                6. lower-/.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \frac{\color{blue}{1}}{z} \]
                7. lower-/.f6435.0

                  \[\leadsto \frac{b}{c} \cdot \frac{1}{\color{blue}{z}} \]
              6. Applied rewrites35.0%

                \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 13: 52.3% accurate, 0.5× speedup?

            \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\ t_2 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\ \;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\ \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\ \mathbf{elif}\;t\_2 \leq 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{9 \cdot \left(x \cdot y\right)}{c \cdot z}\\ \end{array} \end{array} \]
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            (FPCore (x y z t a b c)
             :precision binary64
             (let* ((t_1 (* a (* -4.0 (/ t c)))) (t_2 (* (* x 9.0) y)))
               (if (<= t_2 -2e+141)
                 (* 9.0 (/ (* x y) (* c z)))
                 (if (<= t_2 -2e-181)
                   t_1
                   (if (<= t_2 2e-236)
                     (* (/ b c) (/ 1.0 z))
                     (if (<= t_2 1e+146) t_1 (/ (* 9.0 (* x y)) (* c z))))))))
            assert(x < y && y < z && z < t && t < a && a < b && b < c);
            double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = 9.0 * ((x * y) / (c * z));
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = (9.0 * (x * y)) / (c * z);
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, t, a, b, and c 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, c)
            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), intent (in) :: c
                real(8) :: t_1
                real(8) :: t_2
                real(8) :: tmp
                t_1 = a * ((-4.0d0) * (t / c))
                t_2 = (x * 9.0d0) * y
                if (t_2 <= (-2d+141)) then
                    tmp = 9.0d0 * ((x * y) / (c * z))
                else if (t_2 <= (-2d-181)) then
                    tmp = t_1
                else if (t_2 <= 2d-236) then
                    tmp = (b / c) * (1.0d0 / z)
                else if (t_2 <= 1d+146) then
                    tmp = t_1
                else
                    tmp = (9.0d0 * (x * y)) / (c * z)
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < t && t < a && a < b && b < c;
            public static double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = 9.0 * ((x * y) / (c * z));
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = (9.0 * (x * y)) / (c * z);
            	}
            	return tmp;
            }
            
            [x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
            def code(x, y, z, t, a, b, c):
            	t_1 = a * (-4.0 * (t / c))
            	t_2 = (x * 9.0) * y
            	tmp = 0
            	if t_2 <= -2e+141:
            		tmp = 9.0 * ((x * y) / (c * z))
            	elif t_2 <= -2e-181:
            		tmp = t_1
            	elif t_2 <= 2e-236:
            		tmp = (b / c) * (1.0 / z)
            	elif t_2 <= 1e+146:
            		tmp = t_1
            	else:
            		tmp = (9.0 * (x * y)) / (c * z)
            	return tmp
            
            x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
            function code(x, y, z, t, a, b, c)
            	t_1 = Float64(a * Float64(-4.0 * Float64(t / c)))
            	t_2 = Float64(Float64(x * 9.0) * y)
            	tmp = 0.0
            	if (t_2 <= -2e+141)
            		tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)));
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = Float64(Float64(b / c) * Float64(1.0 / z));
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = Float64(Float64(9.0 * Float64(x * y)) / Float64(c * z));
            	end
            	return tmp
            end
            
            x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
            function tmp_2 = code(x, y, z, t, a, b, c)
            	t_1 = a * (-4.0 * (t / c));
            	t_2 = (x * 9.0) * y;
            	tmp = 0.0;
            	if (t_2 <= -2e+141)
            		tmp = 9.0 * ((x * y) / (c * z));
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = (b / c) * (1.0 / z);
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = (9.0 * (x * y)) / (c * z);
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+141], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-181], t$95$1, If[LessEqual[t$95$2, 2e-236], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+146], t$95$1, N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
            \\
            \begin{array}{l}
            t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
            t_2 := \left(x \cdot 9\right) \cdot y\\
            \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\
            \;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
            
            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\
            \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
            
            \mathbf{elif}\;t\_2 \leq 10^{+146}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{9 \cdot \left(x \cdot y\right)}{c \cdot z}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e141

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in x around inf

                \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
                2. lower-/.f64N/A

                  \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
                3. lower-*.f64N/A

                  \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
                4. lower-*.f6435.8

                  \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.8%

                \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]

              if -2.00000000000000003e141 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000009e-181 or 2.0000000000000001e-236 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999934e145

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in a around inf

                \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                5. lower-/.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                8. lower-*.f6458.7

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
              7. Applied rewrites58.7%

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

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
                2. lower-/.f6439.9

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
              10. Applied rewrites39.9%

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]

              if -2.00000000000000009e-181 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.0000000000000001e-236

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around inf

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lower-*.f6435.7

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.7%

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
                3. associate-/r*N/A

                  \[\leadsto \frac{\frac{b}{c}}{\color{blue}{z}} \]
                4. mult-flipN/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                6. lower-/.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \frac{\color{blue}{1}}{z} \]
                7. lower-/.f6435.0

                  \[\leadsto \frac{b}{c} \cdot \frac{1}{\color{blue}{z}} \]
              6. Applied rewrites35.0%

                \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]

              if 9.99999999999999934e145 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in x around 0

                \[\leadsto \frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                3. lower-*.f6430.3

                  \[\leadsto \frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
              7. Applied rewrites30.3%

                \[\leadsto \frac{-4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
              8. Taylor expanded in x around inf

                \[\leadsto \frac{9 \cdot \left(x \cdot y\right)}{\color{blue}{c} \cdot z} \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right)}{c \cdot z} \]
                2. lower-*.f6435.8

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right)}{c \cdot z} \]
              10. Applied rewrites35.8%

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

            Alternative 14: 52.3% accurate, 0.5× speedup?

            \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\ t_2 := \left(x \cdot 9\right) \cdot y\\ t_3 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\ \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\ \mathbf{elif}\;t\_2 \leq 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            (FPCore (x y z t a b c)
             :precision binary64
             (let* ((t_1 (* a (* -4.0 (/ t c))))
                    (t_2 (* (* x 9.0) y))
                    (t_3 (* 9.0 (/ (* x y) (* c z)))))
               (if (<= t_2 -2e+141)
                 t_3
                 (if (<= t_2 -2e-181)
                   t_1
                   (if (<= t_2 2e-236)
                     (* (/ b c) (/ 1.0 z))
                     (if (<= t_2 1e+146) t_1 t_3))))))
            assert(x < y && y < z && z < t && t < a && a < b && b < c);
            double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double t_3 = 9.0 * ((x * y) / (c * z));
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = t_3;
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = t_3;
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, t, a, b, and c 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, c)
            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), intent (in) :: c
                real(8) :: t_1
                real(8) :: t_2
                real(8) :: t_3
                real(8) :: tmp
                t_1 = a * ((-4.0d0) * (t / c))
                t_2 = (x * 9.0d0) * y
                t_3 = 9.0d0 * ((x * y) / (c * z))
                if (t_2 <= (-2d+141)) then
                    tmp = t_3
                else if (t_2 <= (-2d-181)) then
                    tmp = t_1
                else if (t_2 <= 2d-236) then
                    tmp = (b / c) * (1.0d0 / z)
                else if (t_2 <= 1d+146) then
                    tmp = t_1
                else
                    tmp = t_3
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < t && t < a && a < b && b < c;
            public static double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double t_2 = (x * 9.0) * y;
            	double t_3 = 9.0 * ((x * y) / (c * z));
            	double tmp;
            	if (t_2 <= -2e+141) {
            		tmp = t_3;
            	} else if (t_2 <= -2e-181) {
            		tmp = t_1;
            	} else if (t_2 <= 2e-236) {
            		tmp = (b / c) * (1.0 / z);
            	} else if (t_2 <= 1e+146) {
            		tmp = t_1;
            	} else {
            		tmp = t_3;
            	}
            	return tmp;
            }
            
            [x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
            def code(x, y, z, t, a, b, c):
            	t_1 = a * (-4.0 * (t / c))
            	t_2 = (x * 9.0) * y
            	t_3 = 9.0 * ((x * y) / (c * z))
            	tmp = 0
            	if t_2 <= -2e+141:
            		tmp = t_3
            	elif t_2 <= -2e-181:
            		tmp = t_1
            	elif t_2 <= 2e-236:
            		tmp = (b / c) * (1.0 / z)
            	elif t_2 <= 1e+146:
            		tmp = t_1
            	else:
            		tmp = t_3
            	return tmp
            
            x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
            function code(x, y, z, t, a, b, c)
            	t_1 = Float64(a * Float64(-4.0 * Float64(t / c)))
            	t_2 = Float64(Float64(x * 9.0) * y)
            	t_3 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)))
            	tmp = 0.0
            	if (t_2 <= -2e+141)
            		tmp = t_3;
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = Float64(Float64(b / c) * Float64(1.0 / z));
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = t_3;
            	end
            	return tmp
            end
            
            x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
            function tmp_2 = code(x, y, z, t, a, b, c)
            	t_1 = a * (-4.0 * (t / c));
            	t_2 = (x * 9.0) * y;
            	t_3 = 9.0 * ((x * y) / (c * z));
            	tmp = 0.0;
            	if (t_2 <= -2e+141)
            		tmp = t_3;
            	elseif (t_2 <= -2e-181)
            		tmp = t_1;
            	elseif (t_2 <= 2e-236)
            		tmp = (b / c) * (1.0 / z);
            	elseif (t_2 <= 1e+146)
            		tmp = t_1;
            	else
            		tmp = t_3;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+141], t$95$3, If[LessEqual[t$95$2, -2e-181], t$95$1, If[LessEqual[t$95$2, 2e-236], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+146], t$95$1, t$95$3]]]]]]]
            
            \begin{array}{l}
            [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
            \\
            \begin{array}{l}
            t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
            t_2 := \left(x \cdot 9\right) \cdot y\\
            t_3 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
            \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+141}:\\
            \;\;\;\;t\_3\\
            
            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-181}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-236}:\\
            \;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
            
            \mathbf{elif}\;t\_2 \leq 10^{+146}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_3\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e141 or 9.99999999999999934e145 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in x around inf

                \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto 9 \cdot \color{blue}{\frac{x \cdot y}{c \cdot z}} \]
                2. lower-/.f64N/A

                  \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c \cdot z}} \]
                3. lower-*.f64N/A

                  \[\leadsto 9 \cdot \frac{x \cdot y}{\color{blue}{c} \cdot z} \]
                4. lower-*.f6435.8

                  \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.8%

                \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]

              if -2.00000000000000003e141 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000009e-181 or 2.0000000000000001e-236 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999934e145

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in a around inf

                \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                5. lower-/.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                8. lower-*.f6458.7

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
              7. Applied rewrites58.7%

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

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
                2. lower-/.f6439.9

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
              10. Applied rewrites39.9%

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]

              if -2.00000000000000009e-181 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.0000000000000001e-236

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around inf

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lower-*.f6435.7

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.7%

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
                3. associate-/r*N/A

                  \[\leadsto \frac{\frac{b}{c}}{\color{blue}{z}} \]
                4. mult-flipN/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
                6. lower-/.f64N/A

                  \[\leadsto \frac{b}{c} \cdot \frac{\color{blue}{1}}{z} \]
                7. lower-/.f6435.0

                  \[\leadsto \frac{b}{c} \cdot \frac{1}{\color{blue}{z}} \]
              6. Applied rewrites35.0%

                \[\leadsto \frac{b}{c} \cdot \color{blue}{\frac{1}{z}} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 15: 50.9% accurate, 1.5× speedup?

            \[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\ \mathbf{if}\;t \leq -0.00155:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-77}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            (FPCore (x y z t a b c)
             :precision binary64
             (let* ((t_1 (* a (* -4.0 (/ t c)))))
               (if (<= t -0.00155) t_1 (if (<= t 7.2e-77) (/ b (* c z)) t_1))))
            assert(x < y && y < z && z < t && t < a && a < b && b < c);
            double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double tmp;
            	if (t <= -0.00155) {
            		tmp = t_1;
            	} else if (t <= 7.2e-77) {
            		tmp = b / (c * z);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, t, a, b, and c 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, c)
            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), intent (in) :: c
                real(8) :: t_1
                real(8) :: tmp
                t_1 = a * ((-4.0d0) * (t / c))
                if (t <= (-0.00155d0)) then
                    tmp = t_1
                else if (t <= 7.2d-77) then
                    tmp = b / (c * z)
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < t && t < a && a < b && b < c;
            public static double code(double x, double y, double z, double t, double a, double b, double c) {
            	double t_1 = a * (-4.0 * (t / c));
            	double tmp;
            	if (t <= -0.00155) {
            		tmp = t_1;
            	} else if (t <= 7.2e-77) {
            		tmp = b / (c * z);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            [x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
            def code(x, y, z, t, a, b, c):
            	t_1 = a * (-4.0 * (t / c))
            	tmp = 0
            	if t <= -0.00155:
            		tmp = t_1
            	elif t <= 7.2e-77:
            		tmp = b / (c * z)
            	else:
            		tmp = t_1
            	return tmp
            
            x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
            function code(x, y, z, t, a, b, c)
            	t_1 = Float64(a * Float64(-4.0 * Float64(t / c)))
            	tmp = 0.0
            	if (t <= -0.00155)
            		tmp = t_1;
            	elseif (t <= 7.2e-77)
            		tmp = Float64(b / Float64(c * z));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
            function tmp_2 = code(x, y, z, t, a, b, c)
            	t_1 = a * (-4.0 * (t / c));
            	tmp = 0.0;
            	if (t <= -0.00155)
            		tmp = t_1;
            	elseif (t <= 7.2e-77)
            		tmp = b / (c * z);
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.00155], t$95$1, If[LessEqual[t, 7.2e-77], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
            \\
            \begin{array}{l}
            t_1 := a \cdot \left(-4 \cdot \frac{t}{c}\right)\\
            \mathbf{if}\;t \leq -0.00155:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t \leq 7.2 \cdot 10^{-77}:\\
            \;\;\;\;\frac{b}{c \cdot z}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < -0.00154999999999999995 or 7.2e-77 < t

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around 0

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c \cdot z}} \]
                2. lower--.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{\color{blue}{c} \cdot z} \]
                3. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z} \]
                8. lower-*.f6456.0

                  \[\leadsto \frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites56.0%

                \[\leadsto \color{blue}{\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
              5. Taylor expanded in a around inf

                \[\leadsto a \cdot \color{blue}{\left(-4 \cdot \frac{t}{c} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right)} \]
              6. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                5. lower-/.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
                8. lower-*.f6458.7

                  \[\leadsto a \cdot \mathsf{fma}\left(-4, \frac{t}{c}, 9 \cdot \frac{x \cdot y}{a \cdot \left(c \cdot z\right)}\right) \]
              7. Applied rewrites58.7%

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

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]
              9. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
                2. lower-/.f6439.9

                  \[\leadsto a \cdot \left(-4 \cdot \frac{t}{c}\right) \]
              10. Applied rewrites39.9%

                \[\leadsto a \cdot \left(-4 \cdot \frac{t}{\color{blue}{c}}\right) \]

              if -0.00154999999999999995 < t < 7.2e-77

              1. Initial program 79.9%

                \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
              2. Taylor expanded in b around inf

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
                2. lower-*.f6435.7

                  \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
              4. Applied rewrites35.7%

                \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 16: 35.7% accurate, 3.6× speedup?

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

              \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
            2. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{c}}{z}} \]
            3. Applied rewrites80.5%

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

              \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]
            5. Step-by-step derivation
              1. lower-/.f6435.1

                \[\leadsto \frac{\frac{b}{\color{blue}{c}}}{z} \]
            6. Applied rewrites35.1%

              \[\leadsto \frac{\color{blue}{\frac{b}{c}}}{z} \]
            7. Add Preprocessing

            Alternative 17: 35.1% accurate, 3.8× speedup?

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

              \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
            2. Taylor expanded in b around inf

              \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{b}{\color{blue}{c \cdot z}} \]
              2. lower-*.f6435.7

                \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
            4. Applied rewrites35.7%

              \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
            5. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025151 
            (FPCore (x y z t a b c)
              :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, J"
              :precision binary64
              (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))