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

Percentage Accurate: 79.5% → 89.0%
Time: 8.3s
Alternatives: 21
Speedup: 0.7×

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 21 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.5% 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: 89.0% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+26}:\\ \;\;\;\;\frac{y \cdot \mathsf{fma}\left(-4, \frac{a \cdot t}{y}, \mathsf{fma}\left(9, \frac{x}{z}, \frac{b}{y \cdot z}\right)\right)}{c}\\ \mathbf{elif}\;z \leq 3000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot 9, y, \mathsf{fma}\left(\left(t \cdot a\right) \cdot z, -4, b\right)\right)}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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.1e+26)
   (/ (* y (fma -4.0 (/ (* a t) y) (fma 9.0 (/ x z) (/ b (* y z))))) c)
   (if (<= z 3000.0)
     (/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
     (/ (/ (fma (* x 9.0) y (fma (* (* t a) z) -4.0 b)) z) c))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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.1e+26) {
		tmp = (y * fma(-4.0, ((a * t) / y), fma(9.0, (x / z), (b / (y * z))))) / c;
	} else if (z <= 3000.0) {
		tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
	} else {
		tmp = (fma((x * 9.0), y, fma(((t * a) * z), -4.0, b)) / z) / c;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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.1e+26)
		tmp = Float64(Float64(y * fma(-4.0, Float64(Float64(a * t) / y), fma(9.0, Float64(x / z), Float64(b / Float64(y * z))))) / c);
	elseif (z <= 3000.0)
		tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c));
	else
		tmp = Float64(Float64(fma(Float64(x * 9.0), y, fma(Float64(Float64(t * a) * z), -4.0, 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.
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.1e+26], N[(N[(y * N[(-4.0 * N[(N[(a * t), $MachinePrecision] / y), $MachinePrecision] + N[(9.0 * N[(x / z), $MachinePrecision] + N[(b / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3000.0], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y + N[(N[(N[(t * a), $MachinePrecision] * z), $MachinePrecision] * -4.0 + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{y \cdot \mathsf{fma}\left(-4, \frac{a \cdot t}{y}, \mathsf{fma}\left(9, \frac{x}{z}, \frac{b}{y \cdot z}\right)\right)}{c}\\

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

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


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

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000004e26 < z < 3e3

    1. Initial program 79.5%

      \[\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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e3 < z

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.8% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [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 -2 \cdot 10^{-133}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+282}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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 -2e-133)
     (/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
     (if (<= t_1 0.0)
       (/ (fma -4.0 (* a t) (/ b z)) c)
       (if (<= t_1 1e+282)
         (/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))
         (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 <= -2e-133) {
		tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
	} else if (t_1 <= 0.0) {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	} else if (t_1 <= 1e+282) {
		tmp = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 <= -2e-133)
		tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c));
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	elseif (t_1 <= 1e+282)
		tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c));
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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, -2e-133], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+282], N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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 -2 \cdot 10^{-133}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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)) < -2.0000000000000001e-133

    1. Initial program 79.5%

      \[\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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-133 < (/.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)) < 0.0

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.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.00000000000000003e282

    1. Initial program 79.5%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e282 < (/.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.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 84.6% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [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}\\ t_2 := \frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-133}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+282}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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)))
        (t_2 (/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))))
   (if (<= t_1 -2e-133)
     t_2
     (if (<= t_1 0.0)
       (/ (fma -4.0 (* a t) (/ b z)) c)
       (if (<= t_1 1e+282)
         t_2
         (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 t_2 = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
	double tmp;
	if (t_1 <= -2e-133) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	} else if (t_1 <= 1e+282) {
		tmp = t_2;
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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))
	t_2 = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c))
	tmp = 0.0
	if (t_1 <= -2e-133)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	elseif (t_1 <= 1e+282)
		tmp = t_2;
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-133], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+282], t$95$2, N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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}\\
t_2 := \frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-133}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\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)) < -2.0000000000000001e-133 or 0.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.00000000000000003e282

    1. Initial program 79.5%

      \[\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-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-133 < (/.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)) < 0.0

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e282 < (/.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.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 83.1% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;\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} \leq 2 \cdot 10^{+247}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot 9, y, \mathsf{fma}\left(\left(t \cdot a\right) \cdot z, -4, b\right)\right)}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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 (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2e+247)
   (/ (/ (fma (* x 9.0) y (fma (* (* t a) z) -4.0 b)) z) c)
   (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= 2e+247) {
		tmp = (fma((x * 9.0), y, fma(((t * a) * z), -4.0, b)) / z) / c;
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= 2e+247)
		tmp = Float64(Float64(fma(Float64(x * 9.0), y, fma(Float64(Float64(t * a) * z), -4.0, b)) / z) / c);
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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[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], 2e+247], N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y + N[(N[(N[(t * a), $MachinePrecision] * z), $MachinePrecision] * -4.0 + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;\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} \leq 2 \cdot 10^{+247}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot 9, y, \mathsf{fma}\left(\left(t \cdot a\right) \cdot z, -4, b\right)\right)}{z}}{c}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 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)) < 1.9999999999999999e247

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e247 < (/.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.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.0% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [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 -1 \cdot 10^{-144}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+178}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(t \cdot \left(-4 \cdot a\right), z, \mathsf{fma}\left(x \cdot y, 9, b\right)\right)}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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 -1e-144)
     (/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
     (if (<= t_1 2e+178)
       (/ (/ (fma (* t (* -4.0 a)) z (fma (* x y) 9.0 b)) c) z)
       (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 <= -1e-144) {
		tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
	} else if (t_1 <= 2e+178) {
		tmp = (fma((t * (-4.0 * a)), z, fma((x * y), 9.0, b)) / c) / z;
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 <= -1e-144)
		tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c));
	elseif (t_1 <= 2e+178)
		tmp = Float64(Float64(fma(Float64(t * Float64(-4.0 * a)), z, fma(Float64(x * y), 9.0, b)) / c) / z);
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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, -1e-144], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+178], N[(N[(N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x * y), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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 -1 \cdot 10^{-144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\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)) < -9.9999999999999995e-145

    1. Initial program 79.5%

      \[\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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e-145 < (/.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)) < 2.0000000000000001e178

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

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

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

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

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

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

    if 2.0000000000000001e178 < (/.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.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.8% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\ t_2 := \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\_2 \leq -2 \cdot 10^{-89}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, t\_1\right)}{z \cdot c}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+181}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, t\_1\right)}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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 (* y x) 9.0 b))
        (t_2 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
   (if (<= t_2 -2e-89)
     (/ (fma (* (* -4.0 z) a) t t_1) (* z c))
     (if (<= t_2 5e+181)
       (/ (/ (fma (* a (* -4.0 z)) t t_1) z) c)
       (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((y * x), 9.0, b);
	double t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
	double tmp;
	if (t_2 <= -2e-89) {
		tmp = fma(((-4.0 * z) * a), t, t_1) / (z * c);
	} else if (t_2 <= 5e+181) {
		tmp = (fma((a * (-4.0 * z)), t, t_1) / z) / c;
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 = fma(Float64(y * x), 9.0, b)
	t_2 = 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_2 <= -2e-89)
		tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, t_1) / Float64(z * c));
	elseif (t_2 <= 5e+181)
		tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, t_1) / z) / c);
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = 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$2, -2e-89], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+181], N[(N[(N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + t$95$1), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \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\_2 \leq -2 \cdot 10^{-89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, t\_1\right)}{z \cdot c}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, t\_1\right)}{z}}{c}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\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)) < -2.00000000000000008e-89

    1. Initial program 79.5%

      \[\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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000008e-89 < (/.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.0000000000000003e181

    1. Initial program 79.5%

      \[\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 rewrites80.1%

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

    if 5.0000000000000003e181 < (/.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.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{elif}\;b \leq -5.2 \cdot 10^{-135}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\ \mathbf{elif}\;b \leq 10^{-30}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{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.
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 -1.7e+71)
   (fma (* t -4.0) (/ a c) (/ b (* c z)))
   (if (<= b -5.2e-135)
     (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))
     (if (<= b 1e-30)
       (/ (fma -4.0 (* a 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);
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 <= -1.7e+71) {
		tmp = fma((t * -4.0), (a / c), (b / (c * z)));
	} else if (b <= -5.2e-135) {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	} else if (b <= 1e-30) {
		tmp = fma(-4.0, (a * 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])
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 <= -1.7e+71)
		tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z)));
	elseif (b <= -5.2e-135)
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * z))));
	elseif (b <= 1e-30)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(9.0 * Float64(Float64(x * y) / 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.
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, -1.7e+71], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.2e-135], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-30], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\

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

\mathbf{elif}\;b \leq 10^{-30}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{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 4 regimes
  2. if b < -1.6999999999999999e71

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \color{blue}{\frac{b}{c \cdot z}} \]
      2. add-flipN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \frac{t}{c}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      13. associate-/l*N/A

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      15. lift-/.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      16. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot t\right) \cdot \frac{a}{c} + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)}\right)\right) \]
    8. Applied rewrites62.9%

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

    if -1.6999999999999999e71 < b < -5.20000000000000008e-135

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000008e-135 < b < 1e-30

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot 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-/.f64N/A

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

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

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

    if 1e-30 < b

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+158}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, \frac{y \cdot 9}{c}, \frac{a \cdot t}{c} \cdot -4\right)\\ \mathbf{elif}\;t\_1 \leq 2:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{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.
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)))
   (if (<= t_1 -4e+158)
     (fma (/ x z) (/ (* y 9.0) c) (* (/ (* a t) c) -4.0))
     (if (<= t_1 2.0)
       (fma (* t -4.0) (/ a c) (/ b (* c z)))
       (fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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;
	double tmp;
	if (t_1 <= -4e+158) {
		tmp = fma((x / z), ((y * 9.0) / c), (((a * t) / c) * -4.0));
	} else if (t_1 <= 2.0) {
		tmp = fma((t * -4.0), (a / c), (b / (c * z)));
	} else {
		tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(x * 9.0) * y)
	tmp = 0.0
	if (t_1 <= -4e+158)
		tmp = fma(Float64(x / z), Float64(Float64(y * 9.0) / c), Float64(Float64(Float64(a * t) / c) * -4.0));
	elseif (t_1 <= 2.0)
		tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z)));
	else
		tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / 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.
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[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+158], N[(N[(x / z), $MachinePrecision] * N[(N[(y * 9.0), $MachinePrecision] / c), $MachinePrecision] + N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, \frac{y \cdot 9}{c}, \frac{a \cdot t}{c} \cdot -4\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999981e158

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot z} + -4 \cdot \frac{a \cdot t}{c} \]
      5. lift-*.f64N/A

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot z} + -4 \cdot \frac{a \cdot t}{c} \]
      6. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(9 \cdot y\right)}{z \cdot c} + -4 \cdot \frac{a \cdot t}{c} \]
      21. times-fracN/A

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

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

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

    if -3.99999999999999981e158 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \color{blue}{\frac{b}{c \cdot z}} \]
      2. add-flipN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \frac{t}{c}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      13. associate-/l*N/A

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      15. lift-/.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      16. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot t\right) \cdot \frac{a}{c} + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)}\right)\right) \]
    8. Applied rewrites62.9%

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

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

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      3. lift-*.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{x \cdot y}{c \cdot z} \]
      4. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.2% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{elif}\;b \leq 10^{-30}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{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.
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 -3e+33)
   (fma (* t -4.0) (/ a c) (/ b (* c z)))
   (if (<= b 1e-30)
     (/ (fma -4.0 (* a 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);
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 <= -3e+33) {
		tmp = fma((t * -4.0), (a / c), (b / (c * z)));
	} else if (b <= 1e-30) {
		tmp = fma(-4.0, (a * 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])
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 <= -3e+33)
		tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z)));
	elseif (b <= 1e-30)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(9.0 * Float64(Float64(x * y) / 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.
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, -3e+33], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-30], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\

\mathbf{elif}\;b \leq 10^{-30}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{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 b < -2.99999999999999984e33

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \color{blue}{\frac{b}{c \cdot z}} \]
      2. add-flipN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \frac{t}{c}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      13. associate-/l*N/A

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      15. lift-/.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      16. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot t\right) \cdot \frac{a}{c} + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)}\right)\right) \]
    8. Applied rewrites62.9%

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

    if -2.99999999999999984e33 < b < 1e-30

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot 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-/.f64N/A

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

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

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

    if 1e-30 < b

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.1% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+184}:\\ \;\;\;\;\frac{9 \cdot \left(\frac{y}{z} \cdot x\right)}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+104}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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)))
   (if (<= t_1 -5e+184)
     (/ (* 9.0 (* (/ y z) x)) c)
     (if (<= t_1 1e+104)
       (fma (* t -4.0) (/ a c) (/ b (* c z)))
       (/ (/ (fma (* y x) 9.0 b) z) c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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;
	double tmp;
	if (t_1 <= -5e+184) {
		tmp = (9.0 * ((y / z) * x)) / c;
	} else if (t_1 <= 1e+104) {
		tmp = fma((t * -4.0), (a / c), (b / (c * z)));
	} else {
		tmp = (fma((y * x), 9.0, b) / z) / c;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(x * 9.0) * y)
	tmp = 0.0
	if (t_1 <= -5e+184)
		tmp = Float64(Float64(9.0 * Float64(Float64(y / z) * x)) / c);
	elseif (t_1 <= 1e+104)
		tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z)));
	else
		tmp = Float64(Float64(fma(Float64(y * x), 9.0, 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.
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[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+184], N[(N[(9.0 * N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+104], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+184}:\\
\;\;\;\;\frac{9 \cdot \left(\frac{y}{z} \cdot x\right)}{c}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.9999999999999999e184

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
      3. associate-/l*N/A

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

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

        \[\leadsto \frac{9 \cdot \left(\frac{y}{z} \cdot \color{blue}{x}\right)}{c} \]
      6. lower-/.f6435.8

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

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

    if -4.9999999999999999e184 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \color{blue}{\frac{b}{c \cdot z}} \]
      2. add-flipN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -4 \cdot \left(a \cdot \frac{t}{c}\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      13. associate-/l*N/A

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

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      15. lift-/.f64N/A

        \[\leadsto -4 \cdot \frac{a \cdot t}{c} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)\right)\right) \]
      16. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-4 \cdot t\right) \cdot \frac{a}{c} + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{b}{c \cdot z}\right)\right)}\right)\right) \]
    8. Applied rewrites62.9%

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

    if 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.5%

      \[\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 0

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

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6460.1

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites60.1%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot y\right)}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}} \]
      5. lower-/.f6459.1

        \[\leadsto \frac{\color{blue}{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}}{c} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{\frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z}}{c} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right) + \color{blue}{b}}{z}}{c} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right) + b}{z}}{c} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(x \cdot y\right) \cdot 9 + b}{z}}{c} \]
      10. lift-fma.f6459.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x \cdot y, \color{blue}{9}, b\right)}{z}}{c} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x \cdot y, 9, b\right)}{z}}{c} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c} \]
      13. lower-*.f6459.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c} \]
    6. Applied rewrites59.1%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 11: 75.1% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+87}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\ \mathbf{elif}\;t\_1 \leq 10^{+104}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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)))
   (if (<= t_1 -1e+87)
     (/ (fma (* y 9.0) x b) (* z c))
     (if (<= t_1 1e+104)
       (/ (fma -4.0 (* a t) (/ b z)) c)
       (/ (/ (fma (* y x) 9.0 b) z) c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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;
	double tmp;
	if (t_1 <= -1e+87) {
		tmp = fma((y * 9.0), x, b) / (z * c);
	} else if (t_1 <= 1e+104) {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	} else {
		tmp = (fma((y * x), 9.0, b) / z) / c;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(x * 9.0) * y)
	tmp = 0.0
	if (t_1 <= -1e+87)
		tmp = Float64(fma(Float64(y * 9.0), x, b) / Float64(z * c));
	elseif (t_1 <= 1e+104)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	else
		tmp = Float64(Float64(fma(Float64(y * x), 9.0, 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.
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[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+87], N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+104], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\

\mathbf{elif}\;t\_1 \leq 10^{+104}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999996e86

    1. Initial program 79.5%

      \[\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 0

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6460.1

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites60.1%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. +-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + \color{blue}{b}}{z \cdot c} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot 9 + b}{z \cdot c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(y \cdot x\right) + b}{z \cdot c} \]
      8. associate-*r*N/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot x + b}{z \cdot c} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot y, \color{blue}{x}, b\right)}{z \cdot c} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
      11. lower-*.f6460.1

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
    6. Applied rewrites60.1%

      \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, \color{blue}{x}, b\right)}{z \cdot c} \]

    if -9.9999999999999996e86 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

        \[\leadsto \frac{b + \color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)}}{z \cdot c} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{b + \left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{b + \color{blue}{\left(\left(x \cdot 9\right) \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a\right)}}{z \cdot c} \]
      7. associate-+r+N/A

        \[\leadsto \frac{\color{blue}{\left(b + \left(x \cdot 9\right) \cdot y\right) + \left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}}{z \cdot c} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{b + \left(x \cdot 9\right) \cdot y}{z \cdot c} + \frac{\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}{z \cdot c}} \]
      9. lower-+.f64N/A

        \[\leadsto \color{blue}{\frac{b + \left(x \cdot 9\right) \cdot y}{z \cdot c} + \frac{\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}{z \cdot c}} \]
    3. Applied rewrites68.8%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c \cdot z} + \left(-4 \cdot \left(t \cdot z\right)\right) \cdot \frac{a}{c \cdot z}} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{\frac{a \cdot t}{c}}, \frac{b}{c \cdot z}\right) \]
      2. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{\color{blue}{c}}, \frac{b}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.5

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)} \]
    7. Taylor expanded in c around 0

      \[\leadsto \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{\color{blue}{c}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
      4. lower-/.f6463.2

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites63.2%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{\color{blue}{c}} \]

    if 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.5%

      \[\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 0

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6460.1

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites60.1%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot y\right)}{\color{blue}{z \cdot c}} \]
      3. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}} \]
      5. lower-/.f6459.1

        \[\leadsto \frac{\color{blue}{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}}{c} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{\frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z}}{c} \]
      7. +-commutativeN/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right) + \color{blue}{b}}{z}}{c} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right) + b}{z}}{c} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(x \cdot y\right) \cdot 9 + b}{z}}{c} \]
      10. lift-fma.f6459.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x \cdot y, \color{blue}{9}, b\right)}{z}}{c} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{\frac{\mathsf{fma}\left(x \cdot y, 9, b\right)}{z}}{c} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c} \]
      13. lower-*.f6459.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c} \]
    6. Applied rewrites59.1%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 74.1% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ t_2 := \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+87}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+104}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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)) (t_2 (/ (fma (* y 9.0) x b) (* z c))))
   (if (<= t_1 -1e+87)
     t_2
     (if (<= t_1 1e+104) (/ (fma -4.0 (* a t) (/ b z)) c) t_2))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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;
	double t_2 = fma((y * 9.0), x, b) / (z * c);
	double tmp;
	if (t_1 <= -1e+87) {
		tmp = t_2;
	} else if (t_1 <= 1e+104) {
		tmp = fma(-4.0, (a * t), (b / z)) / c;
	} else {
		tmp = t_2;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(x * 9.0) * y)
	t_2 = Float64(fma(Float64(y * 9.0), x, b) / Float64(z * c))
	tmp = 0.0
	if (t_1 <= -1e+87)
		tmp = t_2;
	elseif (t_1 <= 1e+104)
		tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c);
	else
		tmp = t_2;
	end
	return tmp
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+87], t$95$2, If[LessEqual[t$95$1, 1e+104], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+104}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999996e86 or 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.5%

      \[\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 0

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6460.1

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites60.1%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. +-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + \color{blue}{b}}{z \cdot c} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot 9 + b}{z \cdot c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(y \cdot x\right) + b}{z \cdot c} \]
      8. associate-*r*N/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot x + b}{z \cdot c} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot y, \color{blue}{x}, b\right)}{z \cdot c} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
      11. lower-*.f6460.1

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
    6. Applied rewrites60.1%

      \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, \color{blue}{x}, b\right)}{z \cdot c} \]

    if -9.9999999999999996e86 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104

    1. Initial program 79.5%

      \[\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. +-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} \]
      4. lift--.f64N/A

        \[\leadsto \frac{b + \color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right)}}{z \cdot c} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{b + \left(\left(x \cdot 9\right) \cdot y - \color{blue}{\left(\left(z \cdot 4\right) \cdot t\right) \cdot a}\right)}{z \cdot c} \]
      6. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{b + \color{blue}{\left(\left(x \cdot 9\right) \cdot y + \left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a\right)}}{z \cdot c} \]
      7. associate-+r+N/A

        \[\leadsto \frac{\color{blue}{\left(b + \left(x \cdot 9\right) \cdot y\right) + \left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}}{z \cdot c} \]
      8. div-addN/A

        \[\leadsto \color{blue}{\frac{b + \left(x \cdot 9\right) \cdot y}{z \cdot c} + \frac{\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}{z \cdot c}} \]
      9. lower-+.f64N/A

        \[\leadsto \color{blue}{\frac{b + \left(x \cdot 9\right) \cdot y}{z \cdot c} + \frac{\left(\mathsf{neg}\left(\left(z \cdot 4\right) \cdot t\right)\right) \cdot a}{z \cdot c}} \]
    3. Applied rewrites68.8%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{c \cdot z} + \left(-4 \cdot \left(t \cdot z\right)\right) \cdot \frac{a}{c \cdot z}} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-4 \cdot \frac{a \cdot t}{c} + \frac{b}{c \cdot z}} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \color{blue}{\frac{a \cdot t}{c}}, \frac{b}{c \cdot z}\right) \]
      2. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{\color{blue}{c}}, \frac{b}{c \cdot z}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
      5. lower-*.f6461.5

        \[\leadsto \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right) \]
    6. Applied rewrites61.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \frac{b}{c \cdot z}\right)} \]
    7. Taylor expanded in c around 0

      \[\leadsto \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{\color{blue}{c}} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c} \]
      2. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
      4. lower-/.f6463.2

        \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    9. Applied rewrites63.2%

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{\color{blue}{c}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 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])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+178}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\ \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.
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 (* -4.0 (/ (* a t) c))))
   (if (<= z -1.8e+145)
     t_1
     (if (<= z 1.2e+178) (/ (fma (* y 9.0) x b) (* z c)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (z <= -1.8e+145) {
		tmp = t_1;
	} else if (z <= 1.2e+178) {
		tmp = fma((y * 9.0), x, b) / (z * c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (z <= -1.8e+145)
		tmp = t_1;
	elseif (z <= 1.2e+178)
		tmp = Float64(fma(Float64(y * 9.0), x, b) / Float64(z * c));
	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.
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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+145], t$95$1, If[LessEqual[z, 1.2e+178], N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+178}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.79999999999999987e145 or 1.2e178 < z

    1. Initial program 79.5%

      \[\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 -1.79999999999999987e145 < z < 1.2e178

    1. Initial program 79.5%

      \[\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 0

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{b + 9 \cdot \color{blue}{\left(x \cdot y\right)}}{z \cdot c} \]
      3. lower-*.f6460.1

        \[\leadsto \frac{b + 9 \cdot \left(x \cdot \color{blue}{y}\right)}{z \cdot c} \]
    4. Applied rewrites60.1%

      \[\leadsto \frac{\color{blue}{b + 9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{b + \color{blue}{9 \cdot \left(x \cdot y\right)}}{z \cdot c} \]
      2. +-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + \color{blue}{b}}{z \cdot c} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\left(x \cdot y\right) \cdot 9 + b}{z \cdot c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \left(x \cdot y\right) + b}{z \cdot c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{9 \cdot \left(y \cdot x\right) + b}{z \cdot c} \]
      8. associate-*r*N/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot x + b}{z \cdot c} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(9 \cdot y, \color{blue}{x}, b\right)}{z \cdot c} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
      11. lower-*.f6460.1

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c} \]
    6. Applied rewrites60.1%

      \[\leadsto \frac{\mathsf{fma}\left(y \cdot 9, \color{blue}{x}, b\right)}{z \cdot c} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 47.4% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\ \;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* -4.0 (/ (* a t) c))))
   (if (<= b -9e+59)
     (/ b (* c z))
     (if (<= b -7.2e-78)
       t_1
       (if (<= b -7.4e-177)
         (/ (* (* 9.0 y) (/ x z)) c)
         (if (<= b 5.2e-272)
           t_1
           (if (<= b 2.6e-26)
             (/ (/ (* (* 9.0 x) y) z) c)
             (if (<= b 7e+163) t_1 (/ (/ b z) c)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= -7.2e-78) {
		tmp = t_1;
	} else if (b <= -7.4e-177) {
		tmp = ((9.0 * y) * (x / z)) / c;
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (((9.0 * x) * y) / z) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = (-4.0d0) * ((a * t) / c)
    if (b <= (-9d+59)) then
        tmp = b / (c * z)
    else if (b <= (-7.2d-78)) then
        tmp = t_1
    else if (b <= (-7.4d-177)) then
        tmp = ((9.0d0 * y) * (x / z)) / c
    else if (b <= 5.2d-272) then
        tmp = t_1
    else if (b <= 2.6d-26) then
        tmp = (((9.0d0 * x) * y) / z) / c
    else if (b <= 7d+163) then
        tmp = t_1
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= -7.2e-78) {
		tmp = t_1;
	} else if (b <= -7.4e-177) {
		tmp = ((9.0 * y) * (x / z)) / c;
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (((9.0 * x) * y) / z) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[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 = -4.0 * ((a * t) / c)
	tmp = 0
	if b <= -9e+59:
		tmp = b / (c * z)
	elif b <= -7.2e-78:
		tmp = t_1
	elif b <= -7.4e-177:
		tmp = ((9.0 * y) * (x / z)) / c
	elif b <= 5.2e-272:
		tmp = t_1
	elif b <= 2.6e-26:
		tmp = (((9.0 * x) * y) / z) / c
	elif b <= 7e+163:
		tmp = t_1
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (b <= -9e+59)
		tmp = Float64(b / Float64(c * z));
	elseif (b <= -7.2e-78)
		tmp = t_1;
	elseif (b <= -7.4e-177)
		tmp = Float64(Float64(Float64(9.0 * y) * Float64(x / z)) / c);
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = Float64(Float64(Float64(Float64(9.0 * x) * y) / z) / c);
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (b <= -9e+59)
		tmp = b / (c * z);
	elseif (b <= -7.2e-78)
		tmp = t_1;
	elseif (b <= -7.4e-177)
		tmp = ((9.0 * y) * (x / z)) / c;
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = (((9.0 * x) * y) / z) / c;
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9e+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-78], t$95$1, If[LessEqual[b, -7.4e-177], N[(N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(N[(N[(9.0 * x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -8.99999999999999919e59

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -8.99999999999999919e59 < b < -7.2000000000000005e-78 or -7.39999999999999986e-177 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163

    1. Initial program 79.5%

      \[\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 -7.2000000000000005e-78 < b < -7.39999999999999986e-177

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. lower-*.f6435.3

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
    6. Applied rewrites35.3%

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{\color{blue}{z}}}{c} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{z}}{c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{9 \cdot \left(y \cdot x\right)}{z}}{c} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\frac{\left(9 \cdot y\right) \cdot x}{z}}{c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(y \cdot 9\right) \cdot x}{z}}{c} \]
      8. associate-/l*N/A

        \[\leadsto \frac{\left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{\color{blue}{x}}{z}}{c} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{\color{blue}{x}}{z}}{c} \]
      12. lower-/.f6435.6

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{x}{\color{blue}{z}}}{c} \]
    8. Applied rewrites35.6%

      \[\leadsto \frac{\left(9 \cdot y\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]

    if 5.19999999999999983e-272 < b < 2.6000000000000001e-26

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. lower-*.f6435.3

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
    6. Applied rewrites35.3%

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{\color{blue}{z}}}{c} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{z}}{c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{9 \cdot \left(y \cdot x\right)}{z}}{c} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(y \cdot x\right)}{z}}{c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(y \cdot x\right) \cdot 9}{z}}{c} \]
      8. lower-/.f64N/A

        \[\leadsto \frac{\frac{\left(y \cdot x\right) \cdot 9}{\color{blue}{z}}}{c} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(y \cdot x\right) \cdot 9}{z}}{c} \]
      10. associate-*l*N/A

        \[\leadsto \frac{\frac{y \cdot \left(x \cdot 9\right)}{z}}{c} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{y \cdot \left(9 \cdot x\right)}{z}}{c} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c} \]
      14. lower-*.f6435.3

        \[\leadsto \frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c} \]
    8. Applied rewrites35.3%

      \[\leadsto \frac{\frac{\left(9 \cdot x\right) \cdot y}{\color{blue}{z}}}{c} \]

    if 7.0000000000000005e163 < b

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 15: 46.9% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\ \;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\ \;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* -4.0 (/ (* a t) c))))
   (if (<= b -9e+59)
     (/ b (* c z))
     (if (<= b -7.2e-78)
       t_1
       (if (<= b -7.4e-177)
         (/ (* (* 9.0 y) (/ x z)) c)
         (if (<= b 5.2e-272)
           t_1
           (if (<= b 2.6e-26)
             (/ (* 9.0 (/ (* x y) z)) c)
             (if (<= b 7e+163) t_1 (/ (/ b z) c)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= -7.2e-78) {
		tmp = t_1;
	} else if (b <= -7.4e-177) {
		tmp = ((9.0 * y) * (x / z)) / c;
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (9.0 * ((x * y) / z)) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = (-4.0d0) * ((a * t) / c)
    if (b <= (-9d+59)) then
        tmp = b / (c * z)
    else if (b <= (-7.2d-78)) then
        tmp = t_1
    else if (b <= (-7.4d-177)) then
        tmp = ((9.0d0 * y) * (x / z)) / c
    else if (b <= 5.2d-272) then
        tmp = t_1
    else if (b <= 2.6d-26) then
        tmp = (9.0d0 * ((x * y) / z)) / c
    else if (b <= 7d+163) then
        tmp = t_1
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= -7.2e-78) {
		tmp = t_1;
	} else if (b <= -7.4e-177) {
		tmp = ((9.0 * y) * (x / z)) / c;
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (9.0 * ((x * y) / z)) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[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 = -4.0 * ((a * t) / c)
	tmp = 0
	if b <= -9e+59:
		tmp = b / (c * z)
	elif b <= -7.2e-78:
		tmp = t_1
	elif b <= -7.4e-177:
		tmp = ((9.0 * y) * (x / z)) / c
	elif b <= 5.2e-272:
		tmp = t_1
	elif b <= 2.6e-26:
		tmp = (9.0 * ((x * y) / z)) / c
	elif b <= 7e+163:
		tmp = t_1
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (b <= -9e+59)
		tmp = Float64(b / Float64(c * z));
	elseif (b <= -7.2e-78)
		tmp = t_1;
	elseif (b <= -7.4e-177)
		tmp = Float64(Float64(Float64(9.0 * y) * Float64(x / z)) / c);
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / z)) / c);
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (b <= -9e+59)
		tmp = b / (c * z);
	elseif (b <= -7.2e-78)
		tmp = t_1;
	elseif (b <= -7.4e-177)
		tmp = ((9.0 * y) * (x / z)) / c;
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = (9.0 * ((x * y) / z)) / c;
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9e+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-78], t$95$1, If[LessEqual[b, -7.4e-177], N[(N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -8.99999999999999919e59

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -8.99999999999999919e59 < b < -7.2000000000000005e-78 or -7.39999999999999986e-177 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163

    1. Initial program 79.5%

      \[\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 -7.2000000000000005e-78 < b < -7.39999999999999986e-177

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. lower-*.f6435.3

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
    6. Applied rewrites35.3%

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. associate-*r/N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{\color{blue}{z}}}{c} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\frac{9 \cdot \left(x \cdot y\right)}{z}}{c} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{9 \cdot \left(y \cdot x\right)}{z}}{c} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\frac{\left(9 \cdot y\right) \cdot x}{z}}{c} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\frac{\left(y \cdot 9\right) \cdot x}{z}}{c} \]
      8. associate-/l*N/A

        \[\leadsto \frac{\left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\left(y \cdot 9\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{\color{blue}{x}}{z}}{c} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{\color{blue}{x}}{z}}{c} \]
      12. lower-/.f6435.6

        \[\leadsto \frac{\left(9 \cdot y\right) \cdot \frac{x}{\color{blue}{z}}}{c} \]
    8. Applied rewrites35.6%

      \[\leadsto \frac{\left(9 \cdot y\right) \cdot \color{blue}{\frac{x}{z}}}{c} \]

    if 5.19999999999999983e-272 < b < 2.6000000000000001e-26

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. lower-*.f6435.3

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
    6. Applied rewrites35.3%

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]

    if 7.0000000000000005e163 < b

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 16: 46.7% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\ \;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\ \;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* -4.0 (/ (* a t) c))))
   (if (<= b -1.7e+71)
     (/ b (* c z))
     (if (<= b -4.6e-182)
       (* 9.0 (/ (* x y) (* c z)))
       (if (<= b 5.2e-272)
         t_1
         (if (<= b 2.6e-26)
           (/ (* 9.0 (/ (* x y) z)) c)
           (if (<= b 7e+163) t_1 (/ (/ b z) c))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -1.7e+71) {
		tmp = b / (c * z);
	} else if (b <= -4.6e-182) {
		tmp = 9.0 * ((x * y) / (c * z));
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (9.0 * ((x * y) / z)) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = (-4.0d0) * ((a * t) / c)
    if (b <= (-1.7d+71)) then
        tmp = b / (c * z)
    else if (b <= (-4.6d-182)) then
        tmp = 9.0d0 * ((x * y) / (c * z))
    else if (b <= 5.2d-272) then
        tmp = t_1
    else if (b <= 2.6d-26) then
        tmp = (9.0d0 * ((x * y) / z)) / c
    else if (b <= 7d+163) then
        tmp = t_1
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -1.7e+71) {
		tmp = b / (c * z);
	} else if (b <= -4.6e-182) {
		tmp = 9.0 * ((x * y) / (c * z));
	} else if (b <= 5.2e-272) {
		tmp = t_1;
	} else if (b <= 2.6e-26) {
		tmp = (9.0 * ((x * y) / z)) / c;
	} else if (b <= 7e+163) {
		tmp = t_1;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[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 = -4.0 * ((a * t) / c)
	tmp = 0
	if b <= -1.7e+71:
		tmp = b / (c * z)
	elif b <= -4.6e-182:
		tmp = 9.0 * ((x * y) / (c * z))
	elif b <= 5.2e-272:
		tmp = t_1
	elif b <= 2.6e-26:
		tmp = (9.0 * ((x * y) / z)) / c
	elif b <= 7e+163:
		tmp = t_1
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (b <= -1.7e+71)
		tmp = Float64(b / Float64(c * z));
	elseif (b <= -4.6e-182)
		tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z)));
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / z)) / c);
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (b <= -1.7e+71)
		tmp = b / (c * z);
	elseif (b <= -4.6e-182)
		tmp = 9.0 * ((x * y) / (c * z));
	elseif (b <= 5.2e-272)
		tmp = t_1;
	elseif (b <= 2.6e-26)
		tmp = (9.0 * ((x * y) / z)) / c;
	elseif (b <= 7e+163)
		tmp = t_1;
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e+71], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.6e-182], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.6999999999999999e71

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -1.6999999999999999e71 < b < -4.5999999999999998e-182

    1. Initial program 79.5%

      \[\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-*.f6436.5

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites36.5%

      \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]

    if -4.5999999999999998e-182 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163

    1. Initial program 79.5%

      \[\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 5.19999999999999983e-272 < b < 2.6000000000000001e-26

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in x around inf

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{9 \cdot \color{blue}{\frac{x \cdot y}{z}}}{c} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{\color{blue}{z}}}{c} \]
      3. lower-*.f6435.3

        \[\leadsto \frac{9 \cdot \frac{x \cdot y}{z}}{c} \]
    6. Applied rewrites35.3%

      \[\leadsto \frac{\color{blue}{9 \cdot \frac{x \cdot y}{z}}}{c} \]

    if 7.0000000000000005e163 < b

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 17: 46.7% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\ t_2 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-272}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* 9.0 (/ (* x y) (* c z)))) (t_2 (* -4.0 (/ (* a t) c))))
   (if (<= b -1.7e+71)
     (/ b (* c z))
     (if (<= b -4.6e-182)
       t_1
       (if (<= b 6.8e-272)
         t_2
         (if (<= b 2.6e-26) t_1 (if (<= b 7e+163) t_2 (/ (/ b z) c))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = 9.0 * ((x * y) / (c * z));
	double t_2 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -1.7e+71) {
		tmp = b / (c * z);
	} else if (b <= -4.6e-182) {
		tmp = t_1;
	} else if (b <= 6.8e-272) {
		tmp = t_2;
	} else if (b <= 2.6e-26) {
		tmp = t_1;
	} else if (b <= 7e+163) {
		tmp = t_2;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = 9.0d0 * ((x * y) / (c * z))
    t_2 = (-4.0d0) * ((a * t) / c)
    if (b <= (-1.7d+71)) then
        tmp = b / (c * z)
    else if (b <= (-4.6d-182)) then
        tmp = t_1
    else if (b <= 6.8d-272) then
        tmp = t_2
    else if (b <= 2.6d-26) then
        tmp = t_1
    else if (b <= 7d+163) then
        tmp = t_2
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 = 9.0 * ((x * y) / (c * z));
	double t_2 = -4.0 * ((a * t) / c);
	double tmp;
	if (b <= -1.7e+71) {
		tmp = b / (c * z);
	} else if (b <= -4.6e-182) {
		tmp = t_1;
	} else if (b <= 6.8e-272) {
		tmp = t_2;
	} else if (b <= 2.6e-26) {
		tmp = t_1;
	} else if (b <= 7e+163) {
		tmp = t_2;
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[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 = 9.0 * ((x * y) / (c * z))
	t_2 = -4.0 * ((a * t) / c)
	tmp = 0
	if b <= -1.7e+71:
		tmp = b / (c * z)
	elif b <= -4.6e-182:
		tmp = t_1
	elif b <= 6.8e-272:
		tmp = t_2
	elif b <= 2.6e-26:
		tmp = t_1
	elif b <= 7e+163:
		tmp = t_2
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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(9.0 * Float64(Float64(x * y) / Float64(c * z)))
	t_2 = Float64(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (b <= -1.7e+71)
		tmp = Float64(b / Float64(c * z));
	elseif (b <= -4.6e-182)
		tmp = t_1;
	elseif (b <= 6.8e-272)
		tmp = t_2;
	elseif (b <= 2.6e-26)
		tmp = t_1;
	elseif (b <= 7e+163)
		tmp = t_2;
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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 = 9.0 * ((x * y) / (c * z));
	t_2 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (b <= -1.7e+71)
		tmp = b / (c * z);
	elseif (b <= -4.6e-182)
		tmp = t_1;
	elseif (b <= 6.8e-272)
		tmp = t_2;
	elseif (b <= 2.6e-26)
		tmp = t_1;
	elseif (b <= 7e+163)
		tmp = t_2;
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e+71], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.6e-182], t$95$1, If[LessEqual[b, 6.8e-272], t$95$2, If[LessEqual[b, 2.6e-26], t$95$1, If[LessEqual[b, 7e+163], t$95$2, N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 6.8 \cdot 10^{-272}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.6999999999999999e71

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -1.6999999999999999e71 < b < -4.5999999999999998e-182 or 6.8000000000000006e-272 < b < 2.6000000000000001e-26

    1. Initial program 79.5%

      \[\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-*.f6436.5

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites36.5%

      \[\leadsto \color{blue}{9 \cdot \frac{x \cdot y}{c \cdot z}} \]

    if -4.5999999999999998e-182 < b < 6.8000000000000006e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163

    1. Initial program 79.5%

      \[\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 7.0000000000000005e163 < b

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 18: 46.6% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [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^{+59}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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+59)
   (/ b (* c z))
   (if (<= b 7e+163) (* -4.0 (/ (* a t) c)) (/ (/ b z) c))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= 7e+163) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
    if (b <= (-9d+59)) then
        tmp = b / (c * z)
    else if (b <= 7d+163) then
        tmp = (-4.0d0) * ((a * t) / c)
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 tmp;
	if (b <= -9e+59) {
		tmp = b / (c * z);
	} else if (b <= 7e+163) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if b <= -9e+59:
		tmp = b / (c * z)
	elif b <= 7e+163:
		tmp = -4.0 * ((a * t) / c)
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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+59)
		tmp = Float64(b / Float64(c * z));
	elseif (b <= 7e+163)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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)
	tmp = 0.0;
	if (b <= -9e+59)
		tmp = b / (c * z);
	elseif (b <= 7e+163)
		tmp = -4.0 * ((a * t) / c);
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e+163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -8.99999999999999919e59

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -8.99999999999999919e59 < b < 7.0000000000000005e163

    1. Initial program 79.5%

      \[\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 7.0000000000000005e163 < b

    1. Initial program 79.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 35.2% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;\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} \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -5e+99)
   (/ b (* c z))
   (/ (/ b z) c)))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99) {
		tmp = b / (c * z);
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
    if ((((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)) <= (-5d+99)) then
        tmp = b / (c * z)
    else
        tmp = (b / z) / c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 tmp;
	if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99) {
		tmp = b / (c * z);
	} else {
		tmp = (b / z) / c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99:
		tmp = b / (c * z)
	else:
		tmp = (b / z) / c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= -5e+99)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = Float64(Float64(b / z) / c);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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)
	tmp = 0.0;
	if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99)
		tmp = b / (c * z);
	else
		tmp = (b / z) / c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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[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], -5e+99], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;\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} \leq -5 \cdot 10^{+99}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 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.00000000000000008e99

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if -5.00000000000000008e99 < (/.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.5%

      \[\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. add-to-fractionN/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 \cdot c} \cdot \left(z \cdot c\right) + b}{z \cdot c}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{\color{blue}{z \cdot c}} \]
      6. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a}{z \cdot c} \cdot \left(z \cdot c\right) + b}{z}}{c}} \]
    3. Applied rewrites80.0%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, y \cdot \left(9 \cdot x\right)\right), 1, b\right)}{z}}{c}} \]
    4. Taylor expanded in b around inf

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
    5. Step-by-step derivation
      1. lower-/.f6433.0

        \[\leadsto \frac{\frac{b}{\color{blue}{z}}}{c} \]
    6. Applied rewrites33.0%

      \[\leadsto \frac{\color{blue}{\frac{b}{z}}}{c} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 34.6% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;c \leq 10^{+29}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{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.
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 (<= c 1e+29) (/ b (* c z)) (/ (/ b c) z)))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 (c <= 1e+29) {
		tmp = b / (c * z);
	} else {
		tmp = (b / c) / z;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
    if (c <= 1d+29) then
        tmp = b / (c * z)
    else
        tmp = (b / c) / z
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 tmp;
	if (c <= 1e+29) {
		tmp = b / (c * z);
	} else {
		tmp = (b / c) / z;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if c <= 1e+29:
		tmp = b / (c * z)
	else:
		tmp = (b / c) / z
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
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 (c <= 1e+29)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = Float64(Float64(b / c) / z);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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)
	tmp = 0.0;
	if (c <= 1e+29)
		tmp = b / (c * z);
	else
		tmp = (b / 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.
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[c, 1e+29], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], 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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq 10^{+29}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 9.99999999999999914e28

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]

    if 9.99999999999999914e28 < c

    1. Initial program 79.5%

      \[\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-*.f6434.6

        \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
    4. Applied rewrites34.6%

      \[\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. lower-/.f64N/A

        \[\leadsto \frac{\frac{b}{c}}{\color{blue}{z}} \]
      5. lower-/.f6434.2

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.2%

      \[\leadsto \frac{\frac{b}{c}}{\color{blue}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 34.3% accurate, 3.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\ [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.
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);
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.
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;
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])
[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])
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])){:}
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.
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])\\\\
[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.5%

    \[\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-*.f6434.6

      \[\leadsto \frac{b}{c \cdot \color{blue}{z}} \]
  4. Applied rewrites34.6%

    \[\leadsto \color{blue}{\frac{b}{c \cdot z}} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025156 
(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)))