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

Percentage Accurate: 79.6% → 91.8%
Time: 6.2s
Alternatives: 15
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 15 alternatives:

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.9000000000000003e110 or 0.10000000000000001 < z

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

    if -3.9000000000000003e110 < z < 9.8e-247

    1. Initial program 79.6%

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

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

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

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

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

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

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

    if 9.8e-247 < z < 0.10000000000000001

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.5000000000000001e-164

    1. Initial program 79.6%

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

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

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

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

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

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

    if -9.5000000000000001e-164 < t < 5.89999999999999967e88

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.89999999999999967e88 < t

    1. Initial program 79.6%

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

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

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}}{z \cdot c} \]
      3. add-flipN/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) - \left(\mathsf{neg}\left(b\right)\right)}}{z \cdot c} \]
      4. 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)} - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      5. 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) - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      6. 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)} - \left(\mathsf{neg}\left(b\right)\right)}{z \cdot c} \]
      7. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.00000000000000001e-57 or 3.5e-66 < z

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

    if -6.00000000000000001e-57 < z < 3.5e-66

    1. Initial program 79.6%

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

Alternative 4: 82.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999997e-265 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -0.0

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.6%

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

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

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

Alternative 5: 81.0% 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 8.6 \cdot 10^{+143}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\ \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 8.6e+143)
   (/ (/ (fma (* a (* -4.0 z)) t (fma (* y x) 9.0 b)) z) c)
   (/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) 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 (a <= 8.6e+143) {
		tmp = (fma((a * (-4.0 * z)), t, fma((y * x), 9.0, b)) / z) / c;
	} else {
		tmp = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), 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 (a <= 8.6e+143)
		tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, fma(Float64(y * x), 9.0, b)) / z) / c);
	else
		tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), 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[a, 8.6e+143], N[(N[(N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\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 8.6 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}\\

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

    if 8.60000000000000003e143 < a

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 1.14999999999999995e-12

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.14999999999999995e-12 < c

    1. Initial program 79.6%

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

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

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

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

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

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

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

Alternative 7: 77.1% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(9 \cdot y\right)}{c \cdot \color{blue}{z}} \]
      9. times-fracN/A

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

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

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

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

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

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

    if -4.99999999999999976e246 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 4.99999999999999997e-91 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999997e-91

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6464.2

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

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

Alternative 8: 76.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(9 \cdot y\right)}{c \cdot \color{blue}{z}} \]
      9. times-fracN/A

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

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

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

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

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

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

    if -2.0000000000000001e148 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999991e131

    1. Initial program 79.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}}{c}} \]
    4. 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} \]
    5. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c} \]
    8. Step-by-step derivation
      1. lower-/.f6464.2

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

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

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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

        \[\leadsto 9 \cdot \frac{y \cdot x}{c \cdot \color{blue}{z}} \]
      5. times-fracN/A

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

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

        \[\leadsto 9 \cdot \left(\frac{y}{c} \cdot \frac{\color{blue}{x}}{z}\right) \]
      8. lower-/.f6435.4

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

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

Alternative 9: 52.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 -5 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{c} \cdot \frac{9 \cdot y}{z}\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+132}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{else}:\\ \;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* x 9.0) y)))
   (if (<= t_1 -5e+114)
     (* (/ x c) (/ (* 9.0 y) z))
     (if (<= t_1 0.0)
       (/ (/ b c) z)
       (if (<= t_1 1e+132)
         (* -4.0 (/ (* a t) c))
         (* 9.0 (* (/ y c) (/ x z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * 9.0) * y;
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = (x / c) * ((9.0 * y) / z);
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+132) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = 9.0 * ((y / c) * (x / z));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(9 \cdot y\right)}{c \cdot \color{blue}{z}} \]
      9. times-fracN/A

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

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

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

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

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

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

    if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999991e131

    1. Initial program 79.6%

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

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

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

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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

        \[\leadsto 9 \cdot \frac{y \cdot x}{c \cdot \color{blue}{z}} \]
      5. times-fracN/A

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

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

        \[\leadsto 9 \cdot \left(\frac{y}{c} \cdot \frac{\color{blue}{x}}{z}\right) \]
      8. lower-/.f6435.4

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

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

Alternative 10: 51.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\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\ \;\;\;\;9 \cdot \left(y \cdot \frac{x}{c \cdot z}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+132}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\ \mathbf{else}:\\ \;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* x 9.0) y)))
   (if (<= t_1 -5e+114)
     (* 9.0 (* y (/ x (* c z))))
     (if (<= t_1 0.0)
       (/ (/ b c) z)
       (if (<= t_1 1e+132)
         (* -4.0 (/ (* a t) c))
         (* 9.0 (* (/ y c) (/ x z))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * 9.0) * y;
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = 9.0 * (y * (x / (c * z)));
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+132) {
		tmp = -4.0 * ((a * t) / c);
	} else {
		tmp = 9.0 * ((y / c) * (x / z));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

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

        \[\leadsto 9 \cdot \left(y \cdot \color{blue}{\frac{x}{c \cdot z}}\right) \]
      6. lower-/.f6436.7

        \[\leadsto 9 \cdot \left(y \cdot \frac{x}{\color{blue}{c \cdot z}}\right) \]
    8. Applied rewrites36.7%

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

    if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999991e131

    1. Initial program 79.6%

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

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

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

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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

        \[\leadsto 9 \cdot \frac{y \cdot x}{c \cdot \color{blue}{z}} \]
      5. times-fracN/A

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

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

        \[\leadsto 9 \cdot \left(\frac{y}{c} \cdot \frac{\color{blue}{x}}{z}\right) \]
      8. lower-/.f6435.4

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

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

Alternative 11: 51.2% 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 := 9 \cdot \left(y \cdot \frac{x}{c \cdot z}\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+155}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{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 (* 9.0 (* y (/ x (* c z))))))
   (if (<= t_1 -5e+114)
     t_2
     (if (<= t_1 0.0)
       (/ (/ b c) z)
       (if (<= t_1 1e+155) (* -4.0 (/ (* a t) 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 = 9.0 * (y * (x / (c * z)));
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+155) {
		tmp = -4.0 * ((a * t) / c);
	} 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 = 9.0d0 * (y * (x / (c * z)))
    if (t_1 <= (-5d+114)) then
        tmp = t_2
    else if (t_1 <= 0.0d0) then
        tmp = (b / c) / z
    else if (t_1 <= 1d+155) then
        tmp = (-4.0d0) * ((a * t) / c)
    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 = 9.0 * (y * (x / (c * z)));
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+155) {
		tmp = -4.0 * ((a * t) / c);
	} 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 = 9.0 * (y * (x / (c * z)))
	tmp = 0
	if t_1 <= -5e+114:
		tmp = t_2
	elif t_1 <= 0.0:
		tmp = (b / c) / z
	elif t_1 <= 1e+155:
		tmp = -4.0 * ((a * t) / 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(9.0 * Float64(y * Float64(x / Float64(c * z))))
	tmp = 0.0
	if (t_1 <= -5e+114)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(b / c) / z);
	elseif (t_1 <= 1e+155)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	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 = 9.0 * (y * (x / (c * z)));
	tmp = 0.0;
	if (t_1 <= -5e+114)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = (b / c) / z;
	elseif (t_1 <= 1e+155)
		tmp = -4.0 * ((a * t) / c);
	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[(9.0 * N[(y * N[(x / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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 := 9 \cdot \left(y \cdot \frac{x}{c \cdot z}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

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

\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) < -5.0000000000000001e114 or 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 9 \cdot \frac{x \cdot y}{c \cdot \color{blue}{z}} \]
    6. Applied rewrites34.7%

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

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

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

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

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

        \[\leadsto 9 \cdot \left(y \cdot \color{blue}{\frac{x}{c \cdot z}}\right) \]
      6. lower-/.f6436.7

        \[\leadsto 9 \cdot \left(y \cdot \frac{x}{\color{blue}{c \cdot z}}\right) \]
    8. Applied rewrites36.7%

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

    if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155

    1. Initial program 79.6%

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

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

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

Alternative 12: 49.4% 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 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+155}:\\ \;\;\;\;-4 \cdot \frac{a \cdot t}{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 (* 9.0 (/ (* x y) (* c z)))))
   (if (<= t_1 -5e+114)
     t_2
     (if (<= t_1 0.0)
       (/ (/ b c) z)
       (if (<= t_1 1e+155) (* -4.0 (/ (* a t) 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 = 9.0 * ((x * y) / (c * z));
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+155) {
		tmp = -4.0 * ((a * t) / c);
	} 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 = 9.0d0 * ((x * y) / (c * z))
    if (t_1 <= (-5d+114)) then
        tmp = t_2
    else if (t_1 <= 0.0d0) then
        tmp = (b / c) / z
    else if (t_1 <= 1d+155) then
        tmp = (-4.0d0) * ((a * t) / c)
    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 = 9.0 * ((x * y) / (c * z));
	double tmp;
	if (t_1 <= -5e+114) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (b / c) / z;
	} else if (t_1 <= 1e+155) {
		tmp = -4.0 * ((a * t) / c);
	} 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 = 9.0 * ((x * y) / (c * z))
	tmp = 0
	if t_1 <= -5e+114:
		tmp = t_2
	elif t_1 <= 0.0:
		tmp = (b / c) / z
	elif t_1 <= 1e+155:
		tmp = -4.0 * ((a * t) / 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(9.0 * Float64(Float64(x * y) / Float64(c * z)))
	tmp = 0.0
	if (t_1 <= -5e+114)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(b / c) / z);
	elseif (t_1 <= 1e+155)
		tmp = Float64(-4.0 * Float64(Float64(a * t) / c));
	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 = 9.0 * ((x * y) / (c * z));
	tmp = 0.0;
	if (t_1 <= -5e+114)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = (b / c) / z;
	elseif (t_1 <= 1e+155)
		tmp = -4.0 * ((a * t) / c);
	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[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\

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

\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) < -5.0000000000000001e114 or 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y)

    1. Initial program 79.6%

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

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

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

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

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

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

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

    if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155

    1. Initial program 79.6%

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

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

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

Alternative 13: 47.3% 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 := -4 \cdot \frac{a \cdot t}{c}\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{+89}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{b}{z}}{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 (* -4.0 (/ (* a t) c))))
   (if (<= t -5.5e+89) t_1 (if (<= t 9e-8) (/ (/ 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (t <= -5.5e+89) {
		tmp = t_1;
	} else if (t <= 9e-8) {
		tmp = (b / z) / 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 = (-4.0d0) * ((a * t) / c)
    if (t <= (-5.5d+89)) then
        tmp = t_1
    else if (t <= 9d-8) then
        tmp = (b / z) / 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 = -4.0 * ((a * t) / c);
	double tmp;
	if (t <= -5.5e+89) {
		tmp = t_1;
	} else if (t <= 9e-8) {
		tmp = (b / z) / 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 = -4.0 * ((a * t) / c)
	tmp = 0
	if t <= -5.5e+89:
		tmp = t_1
	elif t <= 9e-8:
		tmp = (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(-4.0 * Float64(Float64(a * t) / c))
	tmp = 0.0
	if (t <= -5.5e+89)
		tmp = t_1;
	elseif (t <= 9e-8)
		tmp = Float64(Float64(b / z) / 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 = -4.0 * ((a * t) / c);
	tmp = 0.0;
	if (t <= -5.5e+89)
		tmp = t_1;
	elseif (t <= 9e-8)
		tmp = (b / z) / 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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+89], t$95$1, If[LessEqual[t, 9e-8], N[(N[(b / z), $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 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 9 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.49999999999999976e89 or 8.99999999999999986e-8 < t

    1. Initial program 79.6%

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

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

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

    if -5.49999999999999976e89 < t < 8.99999999999999986e-8

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

Alternative 14: 36.1% 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}\;x \leq -8.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{b}{c \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= x -8.2e+65) (/ 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 (x <= -8.2e+65) {
		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 (x <= (-8.2d+65)) 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 (x <= -8.2e+65) {
		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 x <= -8.2e+65:
		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 (x <= -8.2e+65)
		tmp = Float64(b / Float64(c * z));
	else
		tmp = Float64(Float64(b / c) / z);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (x <= -8.2e+65)
		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[x, -8.2e+65], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{+65}:\\
\;\;\;\;\frac{b}{c \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.2000000000000003e65

    1. Initial program 79.6%

      \[\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-*.f6436.1

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

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

    if -8.2000000000000003e65 < x

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 35.9% accurate, 3.8× speedup?

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

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

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

    \[\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-*.f6436.1

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

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

Reproduce

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