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

Percentage Accurate: 80.0% → 88.7%
Time: 5.5s
Alternatives: 14
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 80.0% 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: 88.7% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.99999999999999986e58

    1. Initial program 80.0%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\color{blue}{\left(z \cdot 4\right)} \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
      6. 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} \]
      7. 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} \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999986e58 < a

    1. Initial program 80.0%

      \[\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 a around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.8% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\mathsf{fma}\left(x \cdot \frac{y}{a \cdot z}, 9, -4 \cdot t\right)}{c} \cdot a\\ t_2 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+109}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot a, t, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{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.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (/ (fma (* x (/ y (* a z))) 9.0 (* -4.0 t)) c) a))
        (t_2 (* (* x 9.0) y)))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 1e+109)
       (/ (fma (* -4.0 a) t (/ (fma (* y x) 9.0 b) z)) c)
       t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (fma((x * (y / (a * z))), 9.0, (-4.0 * t)) / c) * a;
	double t_2 = (x * 9.0) * y;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= 1e+109) {
		tmp = fma((-4.0 * a), t, (fma((y * x), 9.0, b) / z)) / c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(fma(Float64(x * Float64(y / Float64(a * z))), 9.0, Float64(-4.0 * t)) / c) * a)
	t_2 = Float64(Float64(x * 9.0) * y)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= 1e+109)
		tmp = Float64(fma(Float64(-4.0 * a), t, Float64(fma(Float64(y * x), 9.0, b) / 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.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(x * N[(y / N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 9.0 + N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+109], N[(N[(N[(-4.0 * a), $MachinePrecision] * t + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(x \cdot \frac{y}{a \cdot z}, 9, -4 \cdot t\right)}{c} \cdot a\\
t_2 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -inf.0 or 9.99999999999999982e108 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 80.0%

      \[\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 a around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-4 \cdot t + 9 \cdot \frac{x \cdot y}{a \cdot z}}{c} \cdot a \]
    9. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\color{blue}{\left(z \cdot 4\right)} \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
      6. 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} \]
      7. 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} \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      4. lift-*.f6438.4

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
    7. Applied rewrites38.4%

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

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

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      3. lift-/.f64N/A

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

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

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

        \[\leadsto \frac{9 \cdot x}{c \cdot z} \cdot y \]
      7. *-commutativeN/A

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

        \[\leadsto \frac{x \cdot 9}{c \cdot z} \cdot y \]
      9. lift-*.f6438.3

        \[\leadsto \frac{x \cdot 9}{c \cdot z} \cdot y \]
    9. Applied rewrites38.3%

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

    if -inf.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000004e189

    1. Initial program 80.0%

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

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

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

        \[\leadsto \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\color{blue}{\left(z \cdot 4\right)} \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
      6. 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} \]
      7. 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} \]
      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

      \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{c} \cdot 9 + \frac{b}{c \cdot y}}{z} \cdot y \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
      6. lift-*.f6456.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    8. Taylor expanded in c around 0

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(9, x, \frac{b}{y}\right)}{c \cdot z} \cdot y \]
      4. lift-*.f6456.1

        \[\leadsto \frac{\mathsf{fma}\left(9, x, \frac{b}{y}\right)}{c \cdot z} \cdot y \]
    10. Applied rewrites56.1%

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

Alternative 4: 71.5% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{c} \cdot 9}{z} \cdot y\\


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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

      \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{c} \cdot 9 + \frac{b}{c \cdot y}}{z} \cdot y \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
      6. lift-*.f6456.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    8. Taylor expanded in c around 0

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(9, x, \frac{b}{y}\right)}{c \cdot z} \cdot y \]
      4. lift-*.f6456.1

        \[\leadsto \frac{\mathsf{fma}\left(9, x, \frac{b}{y}\right)}{c \cdot z} \cdot y \]
    10. Applied rewrites56.1%

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

    if -1.00000000000000003e40 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

      \[\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 0

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

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

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

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

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

        \[\leadsto \frac{b - \left(\left(t \cdot z\right) \cdot a\right) \cdot 4}{z \cdot c} \]
      6. lower-*.f6456.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(t \cdot z\right) \cdot a, -4, b\right)}{z \cdot c} \]
      14. lift-*.f6456.7

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

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

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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

      \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{c} \cdot 9 + \frac{b}{c \cdot y}}{z} \cdot y \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
      6. lift-*.f6456.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    8. Taylor expanded in x around inf

      \[\leadsto \frac{9 \cdot \frac{x}{c}}{z} \cdot y \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\frac{x}{c} \cdot 9}{z} \cdot y \]
      3. lift-/.f6438.5

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

      \[\leadsto \frac{\frac{x}{c} \cdot 9}{z} \cdot y \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 70.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;t\_1 \leq 10^{+109}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(t \cdot z\right) \cdot a, -4, b\right)}{z \cdot 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) < -4.0000000000000003e50 or 9.99999999999999982e108 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

      \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{c} \cdot 9 + \frac{b}{c \cdot y}}{z} \cdot y \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
      6. lift-*.f6456.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    8. Taylor expanded in x around inf

      \[\leadsto \frac{9 \cdot \frac{x}{c}}{z} \cdot y \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\frac{x}{c} \cdot 9}{z} \cdot y \]
      3. lift-/.f6438.5

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

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

    if -4.0000000000000003e50 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

      \[\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 0

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

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

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

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

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

        \[\leadsto \frac{b - \left(\left(t \cdot z\right) \cdot a\right) \cdot 4}{z \cdot c} \]
      6. lower-*.f6456.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(t \cdot z\right) \cdot a, -4, b\right)}{z \cdot c} \]
      14. lift-*.f6456.7

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

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

Alternative 6: 64.4% accurate, 1.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1e230

    1. Initial program 80.0%

      \[\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 a around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{t}{c} \cdot -4\right) \cdot a \]
      3. lift-/.f6440.1

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

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

    if -1.1e230 < t

    1. Initial program 80.0%

      \[\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. +-commutativeN/A

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

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

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

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

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

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

Alternative 7: 54.0% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ t_2 := \frac{\frac{x}{c} \cdot 9}{z} \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+98}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+109}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \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.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* x 9.0) y)) (t_2 (* (/ (* (/ x c) 9.0) z) y)))
   (if (<= t_1 -1e+98)
     t_2
     (if (<= t_1 -4e-21)
       (* -4.0 (/ (* a t) c))
       (if (<= t_1 1e+109) (/ b (* c z)) t_2)))))
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 = (((x / c) * 9.0) / z) * y;
	double tmp;
	if (t_1 <= -1e+98) {
		tmp = t_2;
	} else if (t_1 <= -4e-21) {
		tmp = -4.0 * ((a * t) / c);
	} else if (t_1 <= 1e+109) {
		tmp = b / (c * z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * 9.0d0) * y
    t_2 = (((x / c) * 9.0d0) / z) * y
    if (t_1 <= (-1d+98)) then
        tmp = t_2
    else if (t_1 <= (-4d-21)) then
        tmp = (-4.0d0) * ((a * t) / c)
    else if (t_1 <= 1d+109) then
        tmp = b / (c * z)
    else
        tmp = t_2
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * 9.0) * y;
	double t_2 = (((x / c) * 9.0) / z) * y;
	double tmp;
	if (t_1 <= -1e+98) {
		tmp = t_2;
	} else if (t_1 <= -4e-21) {
		tmp = -4.0 * ((a * t) / c);
	} else if (t_1 <= 1e+109) {
		tmp = b / (c * z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (x * 9.0) * y
	t_2 = (((x / c) * 9.0) / z) * y
	tmp = 0
	if t_1 <= -1e+98:
		tmp = t_2
	elif t_1 <= -4e-21:
		tmp = -4.0 * ((a * t) / c)
	elif t_1 <= 1e+109:
		tmp = b / (c * z)
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * 9.0) * y)
	t_2 = Float64(Float64(Float64(Float64(x / c) * 9.0) / z) * y)
	tmp = 0.0
	if (t_1 <= -1e+98)
		tmp = t_2;
	elseif (t_1 <= -4e-21)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	elseif (t_1 <= 1e+109)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = t_2;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * 9.0) * y;
	t_2 = (((x / c) * 9.0) / z) * y;
	tmp = 0.0;
	if (t_1 <= -1e+98)
		tmp = t_2;
	elseif (t_1 <= -4e-21)
		tmp = -4.0 * ((a * t) / c);
	elseif (t_1 <= 1e+109)
		tmp = b / (c * z);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x / c), $MachinePrecision] * 9.0), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+98], t$95$2, If[LessEqual[t$95$1, -4e-21], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+109], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[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{\frac{x}{c} \cdot 9}{z} \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+98}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\

\mathbf{elif}\;t\_1 \leq 10^{+109}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

      \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{9 \cdot \frac{x}{c} + \frac{b}{c \cdot y}}{z} \cdot y \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{x}{c} \cdot 9 + \frac{b}{c \cdot y}}{z} \cdot y \]
      3. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
      6. lift-*.f6456.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{x}{c}, 9, \frac{b}{c \cdot y}\right)}{z} \cdot y \]
    8. Taylor expanded in x around inf

      \[\leadsto \frac{9 \cdot \frac{x}{c}}{z} \cdot y \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\frac{x}{c} \cdot 9}{z} \cdot y \]
      3. lift-/.f6438.5

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

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

    if -9.99999999999999998e97 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999963e-21

    1. Initial program 80.0%

      \[\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 -3.99999999999999963e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

      \[\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.9

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

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

Alternative 8: 52.7% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ t_2 := \frac{x \cdot 9}{c \cdot z} \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+98}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+109}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \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.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* x 9.0) y)) (t_2 (* (/ (* x 9.0) (* c z)) y)))
   (if (<= t_1 -1e+98)
     t_2
     (if (<= t_1 -4e-21)
       (* -4.0 (/ (* a t) c))
       (if (<= t_1 1e+109) (/ b (* c z)) t_2)))))
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 = ((x * 9.0) / (c * z)) * y;
	double tmp;
	if (t_1 <= -1e+98) {
		tmp = t_2;
	} else if (t_1 <= -4e-21) {
		tmp = -4.0 * ((a * t) / c);
	} else if (t_1 <= 1e+109) {
		tmp = b / (c * z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * 9.0d0) * y
    t_2 = ((x * 9.0d0) / (c * z)) * y
    if (t_1 <= (-1d+98)) then
        tmp = t_2
    else if (t_1 <= (-4d-21)) then
        tmp = (-4.0d0) * ((a * t) / c)
    else if (t_1 <= 1d+109) then
        tmp = b / (c * z)
    else
        tmp = t_2
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * 9.0) * y;
	double t_2 = ((x * 9.0) / (c * z)) * y;
	double tmp;
	if (t_1 <= -1e+98) {
		tmp = t_2;
	} else if (t_1 <= -4e-21) {
		tmp = -4.0 * ((a * t) / c);
	} else if (t_1 <= 1e+109) {
		tmp = b / (c * z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (x * 9.0) * y
	t_2 = ((x * 9.0) / (c * z)) * y
	tmp = 0
	if t_1 <= -1e+98:
		tmp = t_2
	elif t_1 <= -4e-21:
		tmp = -4.0 * ((a * t) / c)
	elif t_1 <= 1e+109:
		tmp = b / (c * z)
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * 9.0) * y)
	t_2 = Float64(Float64(Float64(x * 9.0) / Float64(c * z)) * y)
	tmp = 0.0
	if (t_1 <= -1e+98)
		tmp = t_2;
	elseif (t_1 <= -4e-21)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	elseif (t_1 <= 1e+109)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = t_2;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * 9.0) * y;
	t_2 = ((x * 9.0) / (c * z)) * y;
	tmp = 0.0;
	if (t_1 <= -1e+98)
		tmp = t_2;
	elseif (t_1 <= -4e-21)
		tmp = -4.0 * ((a * t) / c);
	elseif (t_1 <= 1e+109)
		tmp = b / (c * z);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * 9.0), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+98], t$95$2, If[LessEqual[t$95$1, -4e-21], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+109], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[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{x \cdot 9}{c \cdot z} \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+98}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\

\mathbf{elif}\;t\_1 \leq 10^{+109}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      4. lift-*.f6438.4

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
    7. Applied rewrites38.4%

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

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

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      3. lift-/.f64N/A

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

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

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

        \[\leadsto \frac{9 \cdot x}{c \cdot z} \cdot y \]
      7. *-commutativeN/A

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

        \[\leadsto \frac{x \cdot 9}{c \cdot z} \cdot y \]
      9. lift-*.f6438.3

        \[\leadsto \frac{x \cdot 9}{c \cdot z} \cdot y \]
    9. Applied rewrites38.3%

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

    if -9.99999999999999998e97 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999963e-21

    1. Initial program 80.0%

      \[\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 -3.99999999999999963e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

      \[\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.9

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

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

Alternative 9: 52.6% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot 9\right) \cdot y\\ t_2 := \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+98}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;t\_1 \leq 10^{+109}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \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.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* x 9.0) y)) (t_2 (* (* (/ x (* c z)) 9.0) y)))
   (if (<= t_1 -1e+98)
     t_2
     (if (<= t_1 -4e-21)
       (* -4.0 (/ (* a t) c))
       (if (<= t_1 1e+109) (/ b (* c z)) t_2)))))
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 = ((x / (c * z)) * 9.0) * y;
	double tmp;
	if (t_1 <= -1e+98) {
		tmp = t_2;
	} else if (t_1 <= -4e-21) {
		tmp = -4.0 * ((a * t) / c);
	} else if (t_1 <= 1e+109) {
		tmp = b / (c * z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-21}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\

\mathbf{elif}\;t\_1 \leq 10^{+109}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 80.0%

      \[\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 y around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
      4. lift-*.f6438.4

        \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]
    7. Applied rewrites38.4%

      \[\leadsto \left(\frac{x}{c \cdot z} \cdot 9\right) \cdot y \]

    if -9.99999999999999998e97 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999963e-21

    1. Initial program 80.0%

      \[\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 -3.99999999999999963e-21 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999982e108

    1. Initial program 80.0%

      \[\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.9

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

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

Alternative 10: 50.5% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+56}:\\ \;\;\;\;\left(\frac{t}{c} \cdot -4\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= b -3.8e+56)
   (/ (/ b c) z)
   (if (<= b 3.6e+56) (* (* (/ t c) -4.0) a) (/ (* b (/ 1.0 c)) z))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (b <= -3.8e+56) {
		tmp = (b / c) / z;
	} else if (b <= 3.6e+56) {
		tmp = ((t / c) * -4.0) * a;
	} else {
		tmp = (b * (1.0 / c)) / z;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-3.8d+56)) then
        tmp = (b / c) / z
    else if (b <= 3.6d+56) then
        tmp = ((t / c) * (-4.0d0)) * a
    else
        tmp = (b * (1.0d0 / c)) / z
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (b <= -3.8e+56) {
		tmp = (b / c) / z;
	} else if (b <= 3.6e+56) {
		tmp = ((t / c) * -4.0) * a;
	} else {
		tmp = (b * (1.0 / c)) / z;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if b <= -3.8e+56:
		tmp = (b / c) / z
	elif b <= 3.6e+56:
		tmp = ((t / c) * -4.0) * a
	else:
		tmp = (b * (1.0 / c)) / z
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (b <= -3.8e+56)
		tmp = Float64(Float64(b / c) / z);
	elseif (b <= 3.6e+56)
		tmp = Float64(Float64(Float64(t / c) * -4.0) * a);
	else
		tmp = Float64(Float64(b * Float64(1.0 / c)) / z);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (b <= -3.8e+56)
		tmp = (b / c) / z;
	elseif (b <= 3.6e+56)
		tmp = ((t / c) * -4.0) * a;
	else
		tmp = (b * (1.0 / c)) / z;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3.8e+56], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 3.6e+56], N[(N[(N[(t / c), $MachinePrecision] * -4.0), $MachinePrecision] * a), $MachinePrecision], N[(N[(b * N[(1.0 / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{+56}:\\
\;\;\;\;\left(\frac{t}{c} \cdot -4\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;\frac{b \cdot \frac{1}{c}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.79999999999999996e56

    1. Initial program 80.0%

      \[\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.9

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

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

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot 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.1

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.1%

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

    if -3.79999999999999996e56 < b < 3.59999999999999998e56

    1. Initial program 80.0%

      \[\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 a around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{t}{c} \cdot -4\right) \cdot a \]
      3. lift-/.f6440.1

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

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

    if 3.59999999999999998e56 < b

    1. Initial program 80.0%

      \[\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.9

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

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

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot 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.1

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.1%

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

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

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

        \[\leadsto \frac{b \cdot \frac{1}{c}}{z} \]
      4. lift-/.f6434.1

        \[\leadsto \frac{b \cdot \frac{1}{c}}{z} \]
    8. Applied rewrites34.1%

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

Alternative 11: 50.5% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\frac{b}{c}}{z}\\ \mathbf{if}\;b \leq -3.8 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+56}:\\ \;\;\;\;\left(\frac{t}{c} \cdot -4\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (/ (/ b c) z)))
   (if (<= b -3.8e+56) t_1 (if (<= b 3.6e+56) (* (* (/ t c) -4.0) a) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b / c) / z;
	double tmp;
	if (b <= -3.8e+56) {
		tmp = t_1;
	} else if (b <= 3.6e+56) {
		tmp = ((t / c) * -4.0) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (b / c) / z
    if (b <= (-3.8d+56)) then
        tmp = t_1
    else if (b <= 3.6d+56) then
        tmp = ((t / c) * (-4.0d0)) * a
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b / c) / z;
	double tmp;
	if (b <= -3.8e+56) {
		tmp = t_1;
	} else if (b <= 3.6e+56) {
		tmp = ((t / c) * -4.0) * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (b / c) / z
	tmp = 0
	if b <= -3.8e+56:
		tmp = t_1
	elif b <= 3.6e+56:
		tmp = ((t / c) * -4.0) * a
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(b / c) / z)
	tmp = 0.0
	if (b <= -3.8e+56)
		tmp = t_1;
	elseif (b <= 3.6e+56)
		tmp = Float64(Float64(Float64(t / c) * -4.0) * a);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (b / c) / z;
	tmp = 0.0;
	if (b <= -3.8e+56)
		tmp = t_1;
	elseif (b <= 3.6e+56)
		tmp = ((t / c) * -4.0) * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[b, -3.8e+56], t$95$1, If[LessEqual[b, 3.6e+56], N[(N[(N[(t / c), $MachinePrecision] * -4.0), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{+56}:\\
\;\;\;\;\left(\frac{t}{c} \cdot -4\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.79999999999999996e56 or 3.59999999999999998e56 < b

    1. Initial program 80.0%

      \[\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.9

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

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

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot 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.1

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.1%

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

    if -3.79999999999999996e56 < b < 3.59999999999999998e56

    1. Initial program 80.0%

      \[\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 a around inf

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

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

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

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

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

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

        \[\leadsto \left(\frac{t}{c} \cdot -4\right) \cdot a \]
      3. lift-/.f6440.1

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

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

Alternative 12: 49.9% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{\frac{b}{c}}{z}\\ \mathbf{if}\;b \leq -3.6 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{+56}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{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.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (/ (/ b c) z)))
   (if (<= b -3.6e+56) t_1 (if (<= b 1.9e+56) (* -4.0 (/ (* a t) c)) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b / c) / z;
	double tmp;
	if (b <= -3.6e+56) {
		tmp = t_1;
	} else if (b <= 1.9e+56) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (b / c) / z
    if (b <= (-3.6d+56)) then
        tmp = t_1
    else if (b <= 1.9d+56) then
        tmp = (-4.0d0) * ((a * t) / c)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b / c) / z;
	double tmp;
	if (b <= -3.6e+56) {
		tmp = t_1;
	} else if (b <= 1.9e+56) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (b / c) / z
	tmp = 0
	if b <= -3.6e+56:
		tmp = t_1
	elif b <= 1.9e+56:
		tmp = -4.0 * ((a * t) / c)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(b / c) / z)
	tmp = 0.0
	if (b <= -3.6e+56)
		tmp = t_1;
	elseif (b <= 1.9e+56)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (b / c) / z;
	tmp = 0.0;
	if (b <= -3.6e+56)
		tmp = t_1;
	elseif (b <= 1.9e+56)
		tmp = -4.0 * ((a * t) / c);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[b, -3.6e+56], t$95$1, If[LessEqual[b, 1.9e+56], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;b \leq -3.6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{+56}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.59999999999999998e56 or 1.89999999999999998e56 < b

    1. Initial program 80.0%

      \[\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.9

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

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

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot 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.1

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.1%

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

    if -3.59999999999999998e56 < b < 1.89999999999999998e56

    1. Initial program 80.0%

      \[\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}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 34.9% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq 1.8 \cdot 10^{-280}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= a 1.8e-280) (/ (/ b c) z) (/ b (* c z))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (a <= 1.8e-280) {
		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.
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 (a <= 1.8d-280) 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;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (a <= 1.8e-280) {
		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])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if a <= 1.8e-280:
		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])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (a <= 1.8e-280)
		tmp = Float64(Float64(b / c) / z);
	else
		tmp = Float64(b / Float64(c * z));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (a <= 1.8e-280)
		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.
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 1.8e-280], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.8 \cdot 10^{-280}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.79999999999999997e-280

    1. Initial program 80.0%

      \[\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.9

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

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

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

        \[\leadsto \frac{b}{\color{blue}{c \cdot 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.1

        \[\leadsto \frac{\frac{b}{c}}{z} \]
    6. Applied rewrites34.1%

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

    if 1.79999999999999997e-280 < a

    1. Initial program 80.0%

      \[\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.9

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

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

Alternative 14: 34.8% accurate, 3.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \frac{b}{c \cdot z} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return b / (c * z);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

    \[\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.9

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

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

Reproduce

?
herbie shell --seed 2025136 
(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)))