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

Percentage Accurate: 91.2% → 94.0%
Time: 3.0s
Alternatives: 9
Speedup: 1.0×

Specification

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

\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\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 9 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: 91.2% accurate, 1.0× speedup?

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

\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}

Alternative 1: 94.0% accurate, 0.7× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 1.02 \cdot 10^{-103}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t \cdot z, -9, x \cdot y\right)}{a\_m + a\_m}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a\_m + a\_m}, x, \left(z \cdot -9\right) \cdot \frac{t}{a\_m + a\_m}\right)\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 1.02e-103)
    (/ (fma (* t z) -9.0 (* x y)) (+ a_m a_m))
    (fma (/ y (+ a_m a_m)) x (* (* z -9.0) (/ t (+ a_m a_m)))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 1.02e-103) {
		tmp = fma((t * z), -9.0, (x * y)) / (a_m + a_m);
	} else {
		tmp = fma((y / (a_m + a_m)), x, ((z * -9.0) * (t / (a_m + a_m))));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 1.02e-103)
		tmp = Float64(fma(Float64(t * z), -9.0, Float64(x * y)) / Float64(a_m + a_m));
	else
		tmp = fma(Float64(y / Float64(a_m + a_m)), x, Float64(Float64(z * -9.0) * Float64(t / Float64(a_m + a_m))));
	end
	return Float64(a_s * tmp)
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 1.02e-103], N[(N[(N[(t * z), $MachinePrecision] * -9.0 + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(z * -9.0), $MachinePrecision] * N[(t / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 1.02 \cdot 10^{-103}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t \cdot z, -9, x \cdot y\right)}{a\_m + a\_m}\\

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


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

    1. Initial program 91.2%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
      5. distribute-lft-neg-outN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
      11. metadata-eval91.5

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}{\color{blue}{a + a}} \]
      18. lower-+.f6491.5

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(t \cdot z\right) \cdot -9} + x \cdot y}{a + a} \]
      10. lower-fma.f6491.3

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

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

    if 1.01999999999999998e-103 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{\color{blue}{2 \cdot a}}, \frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}\right) \]
      11. count-2-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2}\right) \]
      15. distribute-lft-neg-outN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{\left(\left(\mathsf{neg}\left(9\right)\right) \cdot z\right)} \cdot t}{a \cdot 2}\right) \]
      21. metadata-eval88.9

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\left(-9 \cdot z\right) \cdot t}{\color{blue}{2 \cdot a}}\right) \]
      24. count-2-revN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\left(-9 \cdot z\right) \cdot t}{\color{blue}{a + a}}\right) \]
      25. lower-+.f6488.9

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a + a} \cdot x} + \frac{\left(-9 \cdot z\right) \cdot t}{a + a} \]
      3. lower-fma.f6488.9

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a + a}, x, \color{blue}{\left(z \cdot -9\right)} \cdot \frac{t}{a + a}\right) \]
      11. lower-/.f6488.1

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

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

Alternative 2: 93.1% accurate, 0.7× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \begin{array}{l} \mathbf{if}\;a\_m \leq 0.0098:\\ \;\;\;\;\frac{x \cdot y - \left(t \cdot 9\right) \cdot z}{a\_m \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y}{a\_m + a\_m}, \frac{\left(-9 \cdot z\right) \cdot t}{a\_m + a\_m}\right)\\ \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (*
  a_s
  (if (<= a_m 0.0098)
    (/ (- (* x y) (* (* t 9.0) z)) (* a_m 2.0))
    (fma x (/ y (+ a_m a_m)) (/ (* (* -9.0 z) t) (+ a_m a_m))))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double tmp;
	if (a_m <= 0.0098) {
		tmp = ((x * y) - ((t * 9.0) * z)) / (a_m * 2.0);
	} else {
		tmp = fma(x, (y / (a_m + a_m)), (((-9.0 * z) * t) / (a_m + a_m)));
	}
	return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	tmp = 0.0
	if (a_m <= 0.0098)
		tmp = Float64(Float64(Float64(x * y) - Float64(Float64(t * 9.0) * z)) / Float64(a_m * 2.0));
	else
		tmp = fma(x, Float64(y / Float64(a_m + a_m)), Float64(Float64(Float64(-9.0 * z) * t) / Float64(a_m + a_m)));
	end
	return Float64(a_s * tmp)
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[a$95$m, 0.0098], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(t * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-9.0 * z), $MachinePrecision] * t), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 0.0098:\\
\;\;\;\;\frac{x \cdot y - \left(t \cdot 9\right) \cdot z}{a\_m \cdot 2}\\

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


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

    1. Initial program 91.2%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y - \color{blue}{\left(t \cdot 9\right)} \cdot z}{a \cdot 2} \]
      7. lower-*.f6491.2

        \[\leadsto \frac{x \cdot y - \color{blue}{\left(t \cdot 9\right)} \cdot z}{a \cdot 2} \]
    3. Applied rewrites91.2%

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

    if 0.0097999999999999997 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{\color{blue}{2 \cdot a}}, \frac{\mathsf{neg}\left(\left(z \cdot 9\right) \cdot t\right)}{a \cdot 2}\right) \]
      11. count-2-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)}{a \cdot 2}\right) \]
      15. distribute-lft-neg-outN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\color{blue}{\left(\left(\mathsf{neg}\left(9\right)\right) \cdot z\right)} \cdot t}{a \cdot 2}\right) \]
      21. metadata-eval88.9

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\left(-9 \cdot z\right) \cdot t}{\color{blue}{2 \cdot a}}\right) \]
      24. count-2-revN/A

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{a + a}, \frac{\left(-9 \cdot z\right) \cdot t}{\color{blue}{a + a}}\right) \]
      25. lower-+.f6488.9

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

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

Alternative 3: 91.5% accurate, 1.0× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \frac{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}{a\_m + a\_m} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (* a_s (/ (fma (* -9.0 z) t (* y x)) (+ a_m a_m))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	return a_s * (fma((-9.0 * z), t, (y * x)) / (a_m + a_m));
}
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	return Float64(a_s * Float64(fma(Float64(-9.0 * z), t, Float64(y * x)) / Float64(a_m + a_m)))
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(N[(N[(-9.0 * z), $MachinePrecision] * t + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \frac{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}{a\_m + a\_m}
\end{array}
Derivation
  1. Initial program 91.2%

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

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

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

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
    5. distribute-lft-neg-outN/A

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
    11. metadata-eval91.5

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}{\color{blue}{a + a}} \]
    18. lower-+.f6491.5

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

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

Alternative 4: 66.9% accurate, 0.9× speedup?

\[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y \cdot x}{a\_m + a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\ \;\;\;\;\frac{1}{-0.2222222222222222 \cdot \frac{\frac{a\_m}{t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
 :precision binary64
 (let* ((t_1 (/ (* y x) (+ a_m a_m))))
   (*
    a_s
    (if (<= y -8.2e-82)
      t_1
      (if (<= y 2e+95) (/ 1.0 (* -0.2222222222222222 (/ (/ a_m t) z))) t_1)))))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (y * x) / (a_m + a_m);
	double tmp;
	if (y <= -8.2e-82) {
		tmp = t_1;
	} else if (y <= 2e+95) {
		tmp = 1.0 / (-0.2222222222222222 * ((a_m / t) / z));
	} else {
		tmp = t_1;
	}
	return a_s * tmp;
}
a\_m =     private
a\_s =     private
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
use fmin_fmax_functions
    real(8), intent (in) :: a_s
    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_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y * x) / (a_m + a_m)
    if (y <= (-8.2d-82)) then
        tmp = t_1
    else if (y <= 2d+95) then
        tmp = 1.0d0 / ((-0.2222222222222222d0) * ((a_m / t) / z))
    else
        tmp = t_1
    end if
    code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
	double t_1 = (y * x) / (a_m + a_m);
	double tmp;
	if (y <= -8.2e-82) {
		tmp = t_1;
	} else if (y <= 2e+95) {
		tmp = 1.0 / (-0.2222222222222222 * ((a_m / t) / z));
	} else {
		tmp = t_1;
	}
	return a_s * tmp;
}
a\_m = math.fabs(a)
a\_s = math.copysign(1.0, a)
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
[x, y, z, t, a_m] = sort([x, y, z, t, a_m])
def code(a_s, x, y, z, t, a_m):
	t_1 = (y * x) / (a_m + a_m)
	tmp = 0
	if y <= -8.2e-82:
		tmp = t_1
	elif y <= 2e+95:
		tmp = 1.0 / (-0.2222222222222222 * ((a_m / t) / z))
	else:
		tmp = t_1
	return a_s * tmp
a\_m = abs(a)
a\_s = copysign(1.0, a)
x, y, z, t, a_m = sort([x, y, z, t, a_m])
x, y, z, t, a_m = sort([x, y, z, t, a_m])
function code(a_s, x, y, z, t, a_m)
	t_1 = Float64(Float64(y * x) / Float64(a_m + a_m))
	tmp = 0.0
	if (y <= -8.2e-82)
		tmp = t_1;
	elseif (y <= 2e+95)
		tmp = Float64(1.0 / Float64(-0.2222222222222222 * Float64(Float64(a_m / t) / z)));
	else
		tmp = t_1;
	end
	return Float64(a_s * tmp)
end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
	t_1 = (y * x) / (a_m + a_m);
	tmp = 0.0;
	if (y <= -8.2e-82)
		tmp = t_1;
	elseif (y <= 2e+95)
		tmp = 1.0 / (-0.2222222222222222 * ((a_m / t) / z));
	else
		tmp = t_1;
	end
	tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[y, -8.2e-82], t$95$1, If[LessEqual[y, 2e+95], N[(1.0 / N[(-0.2222222222222222 * N[(N[(a$95$m / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := \frac{y \cdot x}{a\_m + a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\
\;\;\;\;\frac{1}{-0.2222222222222222 \cdot \frac{\frac{a\_m}{t}}{z}}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.19999999999999992e-82 or 2.00000000000000004e95 < y

    1. Initial program 91.2%

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
      5. lower-*.f6486.6

        \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
    4. Applied rewrites86.6%

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

      \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
    6. Step-by-step derivation
      1. Applied rewrites50.5%

        \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
        2. *-commutativeN/A

          \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
        3. lower-*.f6450.5

          \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
      3. Applied rewrites50.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]

      if -8.19999999999999992e-82 < y < 2.00000000000000004e95

      1. Initial program 91.2%

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{x \cdot y - \left(z \cdot 9\right) \cdot t}} \]
        7. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{x \cdot y - \left(z \cdot 9\right) \cdot t}} \]
        8. lower-+.f6491.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}} \]
        13. distribute-lft-neg-outN/A

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}} \]
        19. metadata-eval91.2

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

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

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

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

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

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

          \[\leadsto \frac{1}{\frac{-2}{9} \cdot \color{blue}{\frac{a}{t \cdot z}}} \]
        2. lower-/.f64N/A

          \[\leadsto \frac{1}{\frac{-2}{9} \cdot \frac{a}{\color{blue}{t \cdot z}}} \]
        3. lower-*.f6451.2

          \[\leadsto \frac{1}{-0.2222222222222222 \cdot \frac{a}{t \cdot \color{blue}{z}}} \]
      6. Applied rewrites51.2%

        \[\leadsto \frac{1}{\color{blue}{-0.2222222222222222 \cdot \frac{a}{t \cdot z}}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{1}{\frac{-2}{9} \cdot \frac{a}{\color{blue}{t \cdot z}}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{1}{\frac{-2}{9} \cdot \frac{a}{t \cdot \color{blue}{z}}} \]
        3. associate-/r*N/A

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

          \[\leadsto \frac{1}{\frac{-2}{9} \cdot \frac{\frac{a}{t}}{\color{blue}{z}}} \]
        5. lower-/.f6451.6

          \[\leadsto \frac{1}{-0.2222222222222222 \cdot \frac{\frac{a}{t}}{z}} \]
      8. Applied rewrites51.6%

        \[\leadsto \frac{1}{-0.2222222222222222 \cdot \frac{\frac{a}{t}}{\color{blue}{z}}} \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 5: 66.9% accurate, 0.9× speedup?

    \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y \cdot x}{a\_m + a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\ \;\;\;\;\frac{z \cdot \left(-9 \cdot t\right)}{a\_m + a\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
    a\_m = (fabs.f64 a)
    a\_s = (copysign.f64 #s(literal 1 binary64) a)
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    (FPCore (a_s x y z t a_m)
     :precision binary64
     (let* ((t_1 (/ (* y x) (+ a_m a_m))))
       (*
        a_s
        (if (<= y -1.75e-82)
          t_1
          (if (<= y 2e+95) (/ (* z (* -9.0 t)) (+ a_m a_m)) t_1)))))
    a\_m = fabs(a);
    a\_s = copysign(1.0, a);
    assert(x < y && y < z && z < t && t < a_m);
    assert(x < y && y < z && z < t && t < a_m);
    double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = (y * x) / (a_m + a_m);
    	double tmp;
    	if (y <= -1.75e-82) {
    		tmp = t_1;
    	} else if (y <= 2e+95) {
    		tmp = (z * (-9.0 * t)) / (a_m + a_m);
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m =     private
    a\_s =     private
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
    use fmin_fmax_functions
        real(8), intent (in) :: a_s
        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_m
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (y * x) / (a_m + a_m)
        if (y <= (-1.75d-82)) then
            tmp = t_1
        else if (y <= 2d+95) then
            tmp = (z * ((-9.0d0) * t)) / (a_m + a_m)
        else
            tmp = t_1
        end if
        code = a_s * tmp
    end function
    
    a\_m = Math.abs(a);
    a\_s = Math.copySign(1.0, a);
    assert x < y && y < z && z < t && t < a_m;
    assert x < y && y < z && z < t && t < a_m;
    public static double code(double a_s, double x, double y, double z, double t, double a_m) {
    	double t_1 = (y * x) / (a_m + a_m);
    	double tmp;
    	if (y <= -1.75e-82) {
    		tmp = t_1;
    	} else if (y <= 2e+95) {
    		tmp = (z * (-9.0 * t)) / (a_m + a_m);
    	} else {
    		tmp = t_1;
    	}
    	return a_s * tmp;
    }
    
    a\_m = math.fabs(a)
    a\_s = math.copysign(1.0, a)
    [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
    [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
    def code(a_s, x, y, z, t, a_m):
    	t_1 = (y * x) / (a_m + a_m)
    	tmp = 0
    	if y <= -1.75e-82:
    		tmp = t_1
    	elif y <= 2e+95:
    		tmp = (z * (-9.0 * t)) / (a_m + a_m)
    	else:
    		tmp = t_1
    	return a_s * tmp
    
    a\_m = abs(a)
    a\_s = copysign(1.0, a)
    x, y, z, t, a_m = sort([x, y, z, t, a_m])
    x, y, z, t, a_m = sort([x, y, z, t, a_m])
    function code(a_s, x, y, z, t, a_m)
    	t_1 = Float64(Float64(y * x) / Float64(a_m + a_m))
    	tmp = 0.0
    	if (y <= -1.75e-82)
    		tmp = t_1;
    	elseif (y <= 2e+95)
    		tmp = Float64(Float64(z * Float64(-9.0 * t)) / Float64(a_m + a_m));
    	else
    		tmp = t_1;
    	end
    	return Float64(a_s * tmp)
    end
    
    a\_m = abs(a);
    a\_s = sign(a) * abs(1.0);
    x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
    x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
    function tmp_2 = code(a_s, x, y, z, t, a_m)
    	t_1 = (y * x) / (a_m + a_m);
    	tmp = 0.0;
    	if (y <= -1.75e-82)
    		tmp = t_1;
    	elseif (y <= 2e+95)
    		tmp = (z * (-9.0 * t)) / (a_m + a_m);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = a_s * tmp;
    end
    
    a\_m = N[Abs[a], $MachinePrecision]
    a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
    code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[y, -1.75e-82], t$95$1, If[LessEqual[y, 2e+95], N[(N[(z * N[(-9.0 * t), $MachinePrecision]), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
    
    \begin{array}{l}
    a\_m = \left|a\right|
    \\
    a\_s = \mathsf{copysign}\left(1, a\right)
    \\
    [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
    [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
    \\
    \begin{array}{l}
    t_1 := \frac{y \cdot x}{a\_m + a\_m}\\
    a\_s \cdot \begin{array}{l}
    \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\
    \;\;\;\;\frac{z \cdot \left(-9 \cdot t\right)}{a\_m + a\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -1.7499999999999999e-82 or 2.00000000000000004e95 < y

      1. Initial program 91.2%

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

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

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

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

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

          \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
        5. lower-*.f6486.6

          \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
      4. Applied rewrites86.6%

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

        \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
      6. Step-by-step derivation
        1. Applied rewrites50.5%

          \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
          2. *-commutativeN/A

            \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
          3. lower-*.f6450.5

            \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
          7. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
        3. Applied rewrites50.5%

          \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]

        if -1.7499999999999999e-82 < y < 2.00000000000000004e95

        1. Initial program 91.2%

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

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

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

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

            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(z \cdot 9\right) \cdot t}\right)\right) + x \cdot y}{a \cdot 2} \]
          5. distribute-lft-neg-outN/A

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

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

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

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

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

            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(9\right)\right) \cdot z}, t, x \cdot y\right)}{a \cdot 2} \]
          11. metadata-eval91.5

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

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

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

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

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

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

            \[\leadsto \frac{\mathsf{fma}\left(-9 \cdot z, t, y \cdot x\right)}{\color{blue}{a + a}} \]
          18. lower-+.f6491.5

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

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

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

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

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

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

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

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

          \[\leadsto \frac{z \cdot \left(-9 \cdot \color{blue}{t}\right)}{a + a} \]
        8. Step-by-step derivation
          1. lower-*.f6451.2

            \[\leadsto \frac{z \cdot \left(-9 \cdot t\right)}{a + a} \]
        9. Applied rewrites51.2%

          \[\leadsto \frac{z \cdot \left(-9 \cdot \color{blue}{t}\right)}{a + a} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 6: 66.8% accurate, 1.1× speedup?

      \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y \cdot x}{a\_m + a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\ \;\;\;\;\frac{-4.5 \cdot \left(t \cdot z\right)}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
      a\_m = (fabs.f64 a)
      a\_s = (copysign.f64 #s(literal 1 binary64) a)
      NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
      NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
      (FPCore (a_s x y z t a_m)
       :precision binary64
       (let* ((t_1 (/ (* y x) (+ a_m a_m))))
         (*
          a_s
          (if (<= y -1.75e-82) t_1 (if (<= y 2e+95) (/ (* -4.5 (* t z)) a_m) t_1)))))
      a\_m = fabs(a);
      a\_s = copysign(1.0, a);
      assert(x < y && y < z && z < t && t < a_m);
      assert(x < y && y < z && z < t && t < a_m);
      double code(double a_s, double x, double y, double z, double t, double a_m) {
      	double t_1 = (y * x) / (a_m + a_m);
      	double tmp;
      	if (y <= -1.75e-82) {
      		tmp = t_1;
      	} else if (y <= 2e+95) {
      		tmp = (-4.5 * (t * z)) / a_m;
      	} else {
      		tmp = t_1;
      	}
      	return a_s * tmp;
      }
      
      a\_m =     private
      a\_s =     private
      NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
      NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
      use fmin_fmax_functions
          real(8), intent (in) :: a_s
          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_m
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (y * x) / (a_m + a_m)
          if (y <= (-1.75d-82)) then
              tmp = t_1
          else if (y <= 2d+95) then
              tmp = ((-4.5d0) * (t * z)) / a_m
          else
              tmp = t_1
          end if
          code = a_s * tmp
      end function
      
      a\_m = Math.abs(a);
      a\_s = Math.copySign(1.0, a);
      assert x < y && y < z && z < t && t < a_m;
      assert x < y && y < z && z < t && t < a_m;
      public static double code(double a_s, double x, double y, double z, double t, double a_m) {
      	double t_1 = (y * x) / (a_m + a_m);
      	double tmp;
      	if (y <= -1.75e-82) {
      		tmp = t_1;
      	} else if (y <= 2e+95) {
      		tmp = (-4.5 * (t * z)) / a_m;
      	} else {
      		tmp = t_1;
      	}
      	return a_s * tmp;
      }
      
      a\_m = math.fabs(a)
      a\_s = math.copysign(1.0, a)
      [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
      [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
      def code(a_s, x, y, z, t, a_m):
      	t_1 = (y * x) / (a_m + a_m)
      	tmp = 0
      	if y <= -1.75e-82:
      		tmp = t_1
      	elif y <= 2e+95:
      		tmp = (-4.5 * (t * z)) / a_m
      	else:
      		tmp = t_1
      	return a_s * tmp
      
      a\_m = abs(a)
      a\_s = copysign(1.0, a)
      x, y, z, t, a_m = sort([x, y, z, t, a_m])
      x, y, z, t, a_m = sort([x, y, z, t, a_m])
      function code(a_s, x, y, z, t, a_m)
      	t_1 = Float64(Float64(y * x) / Float64(a_m + a_m))
      	tmp = 0.0
      	if (y <= -1.75e-82)
      		tmp = t_1;
      	elseif (y <= 2e+95)
      		tmp = Float64(Float64(-4.5 * Float64(t * z)) / a_m);
      	else
      		tmp = t_1;
      	end
      	return Float64(a_s * tmp)
      end
      
      a\_m = abs(a);
      a\_s = sign(a) * abs(1.0);
      x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
      x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
      function tmp_2 = code(a_s, x, y, z, t, a_m)
      	t_1 = (y * x) / (a_m + a_m);
      	tmp = 0.0;
      	if (y <= -1.75e-82)
      		tmp = t_1;
      	elseif (y <= 2e+95)
      		tmp = (-4.5 * (t * z)) / a_m;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = a_s * tmp;
      end
      
      a\_m = N[Abs[a], $MachinePrecision]
      a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
      NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
      code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[y, -1.75e-82], t$95$1, If[LessEqual[y, 2e+95], N[(N[(-4.5 * N[(t * z), $MachinePrecision]), $MachinePrecision] / a$95$m), $MachinePrecision], t$95$1]]), $MachinePrecision]]
      
      \begin{array}{l}
      a\_m = \left|a\right|
      \\
      a\_s = \mathsf{copysign}\left(1, a\right)
      \\
      [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
      [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
      \\
      \begin{array}{l}
      t_1 := \frac{y \cdot x}{a\_m + a\_m}\\
      a\_s \cdot \begin{array}{l}
      \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\
      \;\;\;\;\frac{-4.5 \cdot \left(t \cdot z\right)}{a\_m}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.7499999999999999e-82 or 2.00000000000000004e95 < y

        1. Initial program 91.2%

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

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

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

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

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

            \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
          5. lower-*.f6486.6

            \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
        4. Applied rewrites86.6%

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

          \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
        6. Step-by-step derivation
          1. Applied rewrites50.5%

            \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
            2. *-commutativeN/A

              \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
            3. lower-*.f6450.5

              \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
            7. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
          3. Applied rewrites50.5%

            \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]

          if -1.7499999999999999e-82 < y < 2.00000000000000004e95

          1. Initial program 91.2%

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

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

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

              \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
            3. lower-*.f6451.4

              \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
          4. Applied rewrites51.4%

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

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

              \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
            3. associate-*r/N/A

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

              \[\leadsto \frac{\frac{-9}{2} \cdot \left(t \cdot z\right)}{\color{blue}{a}} \]
            5. lower-*.f6451.3

              \[\leadsto \frac{-4.5 \cdot \left(t \cdot z\right)}{a} \]
          6. Applied rewrites51.3%

            \[\leadsto \frac{-4.5 \cdot \left(t \cdot z\right)}{\color{blue}{a}} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 66.6% accurate, 1.1× speedup?

        \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y \cdot x}{a\_m + a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
        a\_m = (fabs.f64 a)
        a\_s = (copysign.f64 #s(literal 1 binary64) a)
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        (FPCore (a_s x y z t a_m)
         :precision binary64
         (let* ((t_1 (/ (* y x) (+ a_m a_m))))
           (*
            a_s
            (if (<= y -1.75e-82) t_1 (if (<= y 2e+95) (* -4.5 (/ (* t z) a_m)) t_1)))))
        a\_m = fabs(a);
        a\_s = copysign(1.0, a);
        assert(x < y && y < z && z < t && t < a_m);
        assert(x < y && y < z && z < t && t < a_m);
        double code(double a_s, double x, double y, double z, double t, double a_m) {
        	double t_1 = (y * x) / (a_m + a_m);
        	double tmp;
        	if (y <= -1.75e-82) {
        		tmp = t_1;
        	} else if (y <= 2e+95) {
        		tmp = -4.5 * ((t * z) / a_m);
        	} else {
        		tmp = t_1;
        	}
        	return a_s * tmp;
        }
        
        a\_m =     private
        a\_s =     private
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
        use fmin_fmax_functions
            real(8), intent (in) :: a_s
            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_m
            real(8) :: t_1
            real(8) :: tmp
            t_1 = (y * x) / (a_m + a_m)
            if (y <= (-1.75d-82)) then
                tmp = t_1
            else if (y <= 2d+95) then
                tmp = (-4.5d0) * ((t * z) / a_m)
            else
                tmp = t_1
            end if
            code = a_s * tmp
        end function
        
        a\_m = Math.abs(a);
        a\_s = Math.copySign(1.0, a);
        assert x < y && y < z && z < t && t < a_m;
        assert x < y && y < z && z < t && t < a_m;
        public static double code(double a_s, double x, double y, double z, double t, double a_m) {
        	double t_1 = (y * x) / (a_m + a_m);
        	double tmp;
        	if (y <= -1.75e-82) {
        		tmp = t_1;
        	} else if (y <= 2e+95) {
        		tmp = -4.5 * ((t * z) / a_m);
        	} else {
        		tmp = t_1;
        	}
        	return a_s * tmp;
        }
        
        a\_m = math.fabs(a)
        a\_s = math.copysign(1.0, a)
        [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
        [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
        def code(a_s, x, y, z, t, a_m):
        	t_1 = (y * x) / (a_m + a_m)
        	tmp = 0
        	if y <= -1.75e-82:
        		tmp = t_1
        	elif y <= 2e+95:
        		tmp = -4.5 * ((t * z) / a_m)
        	else:
        		tmp = t_1
        	return a_s * tmp
        
        a\_m = abs(a)
        a\_s = copysign(1.0, a)
        x, y, z, t, a_m = sort([x, y, z, t, a_m])
        x, y, z, t, a_m = sort([x, y, z, t, a_m])
        function code(a_s, x, y, z, t, a_m)
        	t_1 = Float64(Float64(y * x) / Float64(a_m + a_m))
        	tmp = 0.0
        	if (y <= -1.75e-82)
        		tmp = t_1;
        	elseif (y <= 2e+95)
        		tmp = Float64(-4.5 * Float64(Float64(t * z) / a_m));
        	else
        		tmp = t_1;
        	end
        	return Float64(a_s * tmp)
        end
        
        a\_m = abs(a);
        a\_s = sign(a) * abs(1.0);
        x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
        x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
        function tmp_2 = code(a_s, x, y, z, t, a_m)
        	t_1 = (y * x) / (a_m + a_m);
        	tmp = 0.0;
        	if (y <= -1.75e-82)
        		tmp = t_1;
        	elseif (y <= 2e+95)
        		tmp = -4.5 * ((t * z) / a_m);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = a_s * tmp;
        end
        
        a\_m = N[Abs[a], $MachinePrecision]
        a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
        code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[y, -1.75e-82], t$95$1, If[LessEqual[y, 2e+95], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
        
        \begin{array}{l}
        a\_m = \left|a\right|
        \\
        a\_s = \mathsf{copysign}\left(1, a\right)
        \\
        [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
        [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
        \\
        \begin{array}{l}
        t_1 := \frac{y \cdot x}{a\_m + a\_m}\\
        a\_s \cdot \begin{array}{l}
        \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 2 \cdot 10^{+95}:\\
        \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a\_m}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.7499999999999999e-82 or 2.00000000000000004e95 < y

          1. Initial program 91.2%

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

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

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

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

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

              \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
            5. lower-*.f6486.6

              \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
          4. Applied rewrites86.6%

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

            \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
          6. Step-by-step derivation
            1. Applied rewrites50.5%

              \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
              2. *-commutativeN/A

                \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
              3. lower-*.f6450.5

                \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
              5. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
              6. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
            3. Applied rewrites50.5%

              \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]

            if -1.7499999999999999e-82 < y < 2.00000000000000004e95

            1. Initial program 91.2%

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

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

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

                \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
              3. lower-*.f6451.4

                \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
            4. Applied rewrites51.4%

              \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a}} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 8: 66.2% accurate, 1.1× speedup?

          \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ \begin{array}{l} t_1 := \frac{y \cdot x}{a\_m + a\_m}\\ a\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+95}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
          a\_m = (fabs.f64 a)
          a\_s = (copysign.f64 #s(literal 1 binary64) a)
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          (FPCore (a_s x y z t a_m)
           :precision binary64
           (let* ((t_1 (/ (* y x) (+ a_m a_m))))
             (*
              a_s
              (if (<= y -1.75e-82)
                t_1
                (if (<= y 2.4e+95) (* -4.5 (* t (/ z a_m))) t_1)))))
          a\_m = fabs(a);
          a\_s = copysign(1.0, a);
          assert(x < y && y < z && z < t && t < a_m);
          assert(x < y && y < z && z < t && t < a_m);
          double code(double a_s, double x, double y, double z, double t, double a_m) {
          	double t_1 = (y * x) / (a_m + a_m);
          	double tmp;
          	if (y <= -1.75e-82) {
          		tmp = t_1;
          	} else if (y <= 2.4e+95) {
          		tmp = -4.5 * (t * (z / a_m));
          	} else {
          		tmp = t_1;
          	}
          	return a_s * tmp;
          }
          
          a\_m =     private
          a\_s =     private
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
          use fmin_fmax_functions
              real(8), intent (in) :: a_s
              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_m
              real(8) :: t_1
              real(8) :: tmp
              t_1 = (y * x) / (a_m + a_m)
              if (y <= (-1.75d-82)) then
                  tmp = t_1
              else if (y <= 2.4d+95) then
                  tmp = (-4.5d0) * (t * (z / a_m))
              else
                  tmp = t_1
              end if
              code = a_s * tmp
          end function
          
          a\_m = Math.abs(a);
          a\_s = Math.copySign(1.0, a);
          assert x < y && y < z && z < t && t < a_m;
          assert x < y && y < z && z < t && t < a_m;
          public static double code(double a_s, double x, double y, double z, double t, double a_m) {
          	double t_1 = (y * x) / (a_m + a_m);
          	double tmp;
          	if (y <= -1.75e-82) {
          		tmp = t_1;
          	} else if (y <= 2.4e+95) {
          		tmp = -4.5 * (t * (z / a_m));
          	} else {
          		tmp = t_1;
          	}
          	return a_s * tmp;
          }
          
          a\_m = math.fabs(a)
          a\_s = math.copysign(1.0, a)
          [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
          [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
          def code(a_s, x, y, z, t, a_m):
          	t_1 = (y * x) / (a_m + a_m)
          	tmp = 0
          	if y <= -1.75e-82:
          		tmp = t_1
          	elif y <= 2.4e+95:
          		tmp = -4.5 * (t * (z / a_m))
          	else:
          		tmp = t_1
          	return a_s * tmp
          
          a\_m = abs(a)
          a\_s = copysign(1.0, a)
          x, y, z, t, a_m = sort([x, y, z, t, a_m])
          x, y, z, t, a_m = sort([x, y, z, t, a_m])
          function code(a_s, x, y, z, t, a_m)
          	t_1 = Float64(Float64(y * x) / Float64(a_m + a_m))
          	tmp = 0.0
          	if (y <= -1.75e-82)
          		tmp = t_1;
          	elseif (y <= 2.4e+95)
          		tmp = Float64(-4.5 * Float64(t * Float64(z / a_m)));
          	else
          		tmp = t_1;
          	end
          	return Float64(a_s * tmp)
          end
          
          a\_m = abs(a);
          a\_s = sign(a) * abs(1.0);
          x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
          x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
          function tmp_2 = code(a_s, x, y, z, t, a_m)
          	t_1 = (y * x) / (a_m + a_m);
          	tmp = 0.0;
          	if (y <= -1.75e-82)
          		tmp = t_1;
          	elseif (y <= 2.4e+95)
          		tmp = -4.5 * (t * (z / a_m));
          	else
          		tmp = t_1;
          	end
          	tmp_2 = a_s * tmp;
          end
          
          a\_m = N[Abs[a], $MachinePrecision]
          a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
          code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[y, -1.75e-82], t$95$1, If[LessEqual[y, 2.4e+95], N[(-4.5 * N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
          
          \begin{array}{l}
          a\_m = \left|a\right|
          \\
          a\_s = \mathsf{copysign}\left(1, a\right)
          \\
          [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
          [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
          \\
          \begin{array}{l}
          t_1 := \frac{y \cdot x}{a\_m + a\_m}\\
          a\_s \cdot \begin{array}{l}
          \mathbf{if}\;y \leq -1.75 \cdot 10^{-82}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq 2.4 \cdot 10^{+95}:\\
          \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a\_m}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1.7499999999999999e-82 or 2.4e95 < y

            1. Initial program 91.2%

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

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

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

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

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

                \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
              5. lower-*.f6486.6

                \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
            4. Applied rewrites86.6%

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

              \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
            6. Step-by-step derivation
              1. Applied rewrites50.5%

                \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
                3. lower-*.f6450.5

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
              3. Applied rewrites50.5%

                \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]

              if -1.7499999999999999e-82 < y < 2.4e95

              1. Initial program 91.2%

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

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

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

                  \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{\color{blue}{a}} \]
                3. lower-*.f6451.4

                  \[\leadsto -4.5 \cdot \frac{t \cdot z}{a} \]
              4. Applied rewrites51.4%

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

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

                  \[\leadsto \frac{-9}{2} \cdot \frac{t \cdot z}{a} \]
                3. associate-/l*N/A

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

                  \[\leadsto \frac{-9}{2} \cdot \left(t \cdot \frac{z}{\color{blue}{a}}\right) \]
                5. lower-*.f6452.3

                  \[\leadsto -4.5 \cdot \left(t \cdot \color{blue}{\frac{z}{a}}\right) \]
              6. Applied rewrites52.3%

                \[\leadsto -4.5 \cdot \left(t \cdot \color{blue}{\frac{z}{a}}\right) \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 9: 50.5% accurate, 1.9× speedup?

            \[\begin{array}{l} a\_m = \left|a\right| \\ a\_s = \mathsf{copysign}\left(1, a\right) \\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\ [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\ \\ a\_s \cdot \frac{y \cdot x}{a\_m + a\_m} \end{array} \]
            a\_m = (fabs.f64 a)
            a\_s = (copysign.f64 #s(literal 1 binary64) a)
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (/ (* y x) (+ a_m a_m))))
            a\_m = fabs(a);
            a\_s = copysign(1.0, a);
            assert(x < y && y < z && z < t && t < a_m);
            assert(x < y && y < z && z < t && t < a_m);
            double code(double a_s, double x, double y, double z, double t, double a_m) {
            	return a_s * ((y * x) / (a_m + a_m));
            }
            
            a\_m =     private
            a\_s =     private
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            NOTE: x, y, z, t, and a_m 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(a_s, x, y, z, t, a_m)
            use fmin_fmax_functions
                real(8), intent (in) :: a_s
                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_m
                code = a_s * ((y * x) / (a_m + a_m))
            end function
            
            a\_m = Math.abs(a);
            a\_s = Math.copySign(1.0, a);
            assert x < y && y < z && z < t && t < a_m;
            assert x < y && y < z && z < t && t < a_m;
            public static double code(double a_s, double x, double y, double z, double t, double a_m) {
            	return a_s * ((y * x) / (a_m + a_m));
            }
            
            a\_m = math.fabs(a)
            a\_s = math.copysign(1.0, a)
            [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
            [x, y, z, t, a_m] = sort([x, y, z, t, a_m])
            def code(a_s, x, y, z, t, a_m):
            	return a_s * ((y * x) / (a_m + a_m))
            
            a\_m = abs(a)
            a\_s = copysign(1.0, a)
            x, y, z, t, a_m = sort([x, y, z, t, a_m])
            x, y, z, t, a_m = sort([x, y, z, t, a_m])
            function code(a_s, x, y, z, t, a_m)
            	return Float64(a_s * Float64(Float64(y * x) / Float64(a_m + a_m)))
            end
            
            a\_m = abs(a);
            a\_s = sign(a) * abs(1.0);
            x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
            x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
            function tmp = code(a_s, x, y, z, t, a_m)
            	tmp = a_s * ((y * x) / (a_m + a_m));
            end
            
            a\_m = N[Abs[a], $MachinePrecision]
            a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
            code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(N[(y * x), $MachinePrecision] / N[(a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            a\_m = \left|a\right|
            \\
            a\_s = \mathsf{copysign}\left(1, a\right)
            \\
            [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\\\
            [x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
            \\
            a\_s \cdot \frac{y \cdot x}{a\_m + a\_m}
            \end{array}
            
            Derivation
            1. Initial program 91.2%

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

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

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

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

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

                \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{\color{blue}{x}}\right)}{a \cdot 2} \]
              5. lower-*.f6486.6

                \[\leadsto \frac{x \cdot \left(y + -9 \cdot \frac{t \cdot z}{x}\right)}{a \cdot 2} \]
            4. Applied rewrites86.6%

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

              \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
            6. Step-by-step derivation
              1. Applied rewrites50.5%

                \[\leadsto \frac{x \cdot y}{a \cdot 2} \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{x \cdot \color{blue}{y}}{a \cdot 2} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
                3. lower-*.f6450.5

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{a \cdot 2} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot 2\right)\right)} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot a\right)\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(count-2, \left(a + a\right)\right)} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{x}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(a + a\right)\right)} \]
              3. Applied rewrites50.5%

                \[\leadsto \color{blue}{\frac{y \cdot x}{a + a}} \]
              4. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2025150 
              (FPCore (x y z t a)
                :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"
                :precision binary64
                (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))