quad2m (problem 3.2.1, negative)

Percentage Accurate: 53.3% → 85.9%
Time: 4.8s
Alternatives: 7
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
	return (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
}
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, b_2, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    code = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
	return (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c):
	return (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
function code(a, b_2, c)
	return Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a)
end
function tmp = code(a, b_2, c)
	tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}
\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 7 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: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
	return (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
}
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, b_2, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    code = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
	return (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c):
	return (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
function code(a, b_2, c)
	return Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a)
end
function tmp = code(a, b_2, c)
	tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}
\end{array}

Alternative 1: 85.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -80000000000:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{elif}\;b\_2 \leq -4.3 \cdot 10^{-74}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}\right)}}{a}\\ \mathbf{elif}\;b\_2 \leq 1.36 \cdot 10^{+78}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\_2\right) - b\_2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -80000000000.0)
   (* -0.5 (/ c b_2))
   (if (<= b_2 -4.3e-74)
     (/
      (/
       (* a c)
       (fma
        -1.0
        b_2
        (pow (fma (pow b_2 1.0) (pow b_2 1.0) (* -1.0 (* c a))) 0.5)))
      a)
     (if (<= b_2 1.36e+78)
       (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
       (/ (- (- b_2) b_2) a)))))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -80000000000.0) {
		tmp = -0.5 * (c / b_2);
	} else if (b_2 <= -4.3e-74) {
		tmp = ((a * c) / fma(-1.0, b_2, pow(fma(pow(b_2, 1.0), pow(b_2, 1.0), (-1.0 * (c * a))), 0.5))) / a;
	} else if (b_2 <= 1.36e+78) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
	} else {
		tmp = (-b_2 - b_2) / a;
	}
	return tmp;
}
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -80000000000.0)
		tmp = Float64(-0.5 * Float64(c / b_2));
	elseif (b_2 <= -4.3e-74)
		tmp = Float64(Float64(Float64(a * c) / fma(-1.0, b_2, (fma((b_2 ^ 1.0), (b_2 ^ 1.0), Float64(-1.0 * Float64(c * a))) ^ 0.5))) / a);
	elseif (b_2 <= 1.36e+78)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	else
		tmp = Float64(Float64(Float64(-b_2) - b_2) / a);
	end
	return tmp
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -80000000000.0], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, -4.3e-74], N[(N[(N[(a * c), $MachinePrecision] / N[(-1.0 * b$95$2 + N[Power[N[(N[Power[b$95$2, 1.0], $MachinePrecision] * N[Power[b$95$2, 1.0], $MachinePrecision] + N[(-1.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 1.36e+78], N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[((-b$95$2) - b$95$2), $MachinePrecision] / a), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -80000000000:\\
\;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\

\mathbf{elif}\;b\_2 \leq -4.3 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}\right)}}{a}\\

\mathbf{elif}\;b\_2 \leq 1.36 \cdot 10^{+78}:\\
\;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\_2\right) - b\_2}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b_2 < -8e10

    1. Initial program 14.5%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around -inf

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

        \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
      2. lower-/.f6490.7

        \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
    4. Applied rewrites90.7%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

    if -8e10 < b_2 < -4.29999999999999972e-74

    1. Initial program 40.3%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(b\_2\right)\right)} - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
      2. lift--.f64N/A

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - \color{blue}{a \cdot c}}}{a} \]
      7. flip--N/A

        \[\leadsto \frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\_2\right)\right) \cdot \left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c} \cdot \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{\left(\mathsf{neg}\left(b\_2\right)\right) + \sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
      8. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\_2\right)\right) \cdot \left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c} \cdot \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{\left(\mathsf{neg}\left(b\_2\right)\right) + \sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
    3. Applied rewrites39.9%

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

      \[\leadsto \frac{\frac{\color{blue}{a \cdot c}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
    5. Step-by-step derivation
      1. lower-*.f6475.4

        \[\leadsto \frac{\frac{a \cdot \color{blue}{c}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}\right)}}{a} \]
    6. Applied rewrites75.4%

      \[\leadsto \frac{\frac{\color{blue}{a \cdot c}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}\right)}}{a} \]

    if -4.29999999999999972e-74 < b_2 < 1.35999999999999999e78

    1. Initial program 79.3%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]

    if 1.35999999999999999e78 < b_2

    1. Initial program 57.4%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Taylor expanded in a around 0

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{b\_2}}{a} \]
    3. Step-by-step derivation
      1. Applied rewrites94.5%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{b\_2}}{a} \]
    4. Recombined 4 regimes into one program.
    5. Add Preprocessing

    Alternative 2: 84.7% accurate, N/A× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -9 \cdot 10^{-73}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{elif}\;b\_2 \leq 1.36 \cdot 10^{+78}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\_2\right) - b\_2}{a}\\ \end{array} \end{array} \]
    (FPCore (a b_2 c)
     :precision binary64
     (if (<= b_2 -9e-73)
       (* -0.5 (/ c b_2))
       (if (<= b_2 1.36e+78)
         (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
         (/ (- (- b_2) b_2) a))))
    double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -9e-73) {
    		tmp = -0.5 * (c / b_2);
    	} else if (b_2 <= 1.36e+78) {
    		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
    	} else {
    		tmp = (-b_2 - b_2) / a;
    	}
    	return tmp;
    }
    
    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, b_2, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b_2
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b_2 <= (-9d-73)) then
            tmp = (-0.5d0) * (c / b_2)
        else if (b_2 <= 1.36d+78) then
            tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a
        else
            tmp = (-b_2 - b_2) / a
        end if
        code = tmp
    end function
    
    public static double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -9e-73) {
    		tmp = -0.5 * (c / b_2);
    	} else if (b_2 <= 1.36e+78) {
    		tmp = (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
    	} else {
    		tmp = (-b_2 - b_2) / a;
    	}
    	return tmp;
    }
    
    def code(a, b_2, c):
    	tmp = 0
    	if b_2 <= -9e-73:
    		tmp = -0.5 * (c / b_2)
    	elif b_2 <= 1.36e+78:
    		tmp = (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
    	else:
    		tmp = (-b_2 - b_2) / a
    	return tmp
    
    function code(a, b_2, c)
    	tmp = 0.0
    	if (b_2 <= -9e-73)
    		tmp = Float64(-0.5 * Float64(c / b_2));
    	elseif (b_2 <= 1.36e+78)
    		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
    	else
    		tmp = Float64(Float64(Float64(-b_2) - b_2) / a);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b_2, c)
    	tmp = 0.0;
    	if (b_2 <= -9e-73)
    		tmp = -0.5 * (c / b_2);
    	elseif (b_2 <= 1.36e+78)
    		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
    	else
    		tmp = (-b_2 - b_2) / a;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -9e-73], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 1.36e+78], N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[((-b$95$2) - b$95$2), $MachinePrecision] / a), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b\_2 \leq -9 \cdot 10^{-73}:\\
    \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\
    
    \mathbf{elif}\;b\_2 \leq 1.36 \cdot 10^{+78}:\\
    \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(-b\_2\right) - b\_2}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b_2 < -9e-73

      1. Initial program 19.1%

        \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
      2. Taylor expanded in b_2 around -inf

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

          \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
        2. lower-/.f6484.5

          \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
      4. Applied rewrites84.5%

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

      if -9e-73 < b_2 < 1.35999999999999999e78

      1. Initial program 79.2%

        \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]

      if 1.35999999999999999e78 < b_2

      1. Initial program 57.4%

        \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
      2. Taylor expanded in a around 0

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{b\_2}}{a} \]
      3. Step-by-step derivation
        1. Applied rewrites94.5%

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

      Alternative 3: 79.5% accurate, N/A× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -8.5 \cdot 10^{-73}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{elif}\;b\_2 \leq 2.35 \cdot 10^{-101}:\\ \;\;\;\;-1 \cdot \left({a}^{-1} \cdot {\left(\mathsf{fma}\left(-1, a \cdot c, b\_2 \cdot b\_2\right)\right)}^{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right)\\ \end{array} \end{array} \]
      (FPCore (a b_2 c)
       :precision binary64
       (if (<= b_2 -8.5e-73)
         (* -0.5 (/ c b_2))
         (if (<= b_2 2.35e-101)
           (* -1.0 (* (pow a -1.0) (pow (fma -1.0 (* a c) (* b_2 b_2)) 0.5)))
           (fma (/ c b_2) 0.5 (* (/ b_2 a) -2.0)))))
      double code(double a, double b_2, double c) {
      	double tmp;
      	if (b_2 <= -8.5e-73) {
      		tmp = -0.5 * (c / b_2);
      	} else if (b_2 <= 2.35e-101) {
      		tmp = -1.0 * (pow(a, -1.0) * pow(fma(-1.0, (a * c), (b_2 * b_2)), 0.5));
      	} else {
      		tmp = fma((c / b_2), 0.5, ((b_2 / a) * -2.0));
      	}
      	return tmp;
      }
      
      function code(a, b_2, c)
      	tmp = 0.0
      	if (b_2 <= -8.5e-73)
      		tmp = Float64(-0.5 * Float64(c / b_2));
      	elseif (b_2 <= 2.35e-101)
      		tmp = Float64(-1.0 * Float64((a ^ -1.0) * (fma(-1.0, Float64(a * c), Float64(b_2 * b_2)) ^ 0.5)));
      	else
      		tmp = fma(Float64(c / b_2), 0.5, Float64(Float64(b_2 / a) * -2.0));
      	end
      	return tmp
      end
      
      code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -8.5e-73], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 2.35e-101], N[(-1.0 * N[(N[Power[a, -1.0], $MachinePrecision] * N[Power[N[(-1.0 * N[(a * c), $MachinePrecision] + N[(b$95$2 * b$95$2), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * 0.5 + N[(N[(b$95$2 / a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b\_2 \leq -8.5 \cdot 10^{-73}:\\
      \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\
      
      \mathbf{elif}\;b\_2 \leq 2.35 \cdot 10^{-101}:\\
      \;\;\;\;-1 \cdot \left({a}^{-1} \cdot {\left(\mathsf{fma}\left(-1, a \cdot c, b\_2 \cdot b\_2\right)\right)}^{0.5}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b_2 < -8.4999999999999996e-73

        1. Initial program 19.1%

          \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
        2. Taylor expanded in b_2 around -inf

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

            \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
          2. lower-/.f6484.5

            \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
        4. Applied rewrites84.5%

          \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

        if -8.4999999999999996e-73 < b_2 < 2.35e-101

        1. Initial program 72.5%

          \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
        2. Step-by-step derivation
          1. lift-neg.f64N/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(b\_2\right)\right)} - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. lift--.f64N/A

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

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

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

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

            \[\leadsto \frac{\left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - \color{blue}{a \cdot c}}}{a} \]
          7. flip--N/A

            \[\leadsto \frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\_2\right)\right) \cdot \left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c} \cdot \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{\left(\mathsf{neg}\left(b\_2\right)\right) + \sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
          8. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\_2\right)\right) \cdot \left(\mathsf{neg}\left(b\_2\right)\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c} \cdot \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{\left(\mathsf{neg}\left(b\_2\right)\right) + \sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
        3. Applied rewrites67.2%

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

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          2. lift-pow.f64N/A

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{fma}\left(\color{blue}{{b\_2}^{1}}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          3. lift-pow.f64N/A

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

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \left(c \cdot a\right)\right)}}^{\frac{1}{2}}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot {\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \color{blue}{\left(c \cdot a\right)}\right)}^{\frac{1}{2}}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot {\left({b\_2}^{1} \cdot {b\_2}^{1} + \color{blue}{-1 \cdot \left(c \cdot a\right)}\right)}^{\frac{1}{2}}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          7. sqr-powN/A

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot \color{blue}{\left({\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \left(c \cdot a\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \left(c \cdot a\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
          8. lower-*.f64N/A

            \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}} \cdot \color{blue}{\left({\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \left(c \cdot a\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left({b\_2}^{1} \cdot {b\_2}^{1} + -1 \cdot \left(c \cdot a\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{\frac{1}{2}}\right)}}{a} \]
        5. Applied rewrites67.0%

          \[\leadsto \frac{\frac{b\_2 \cdot b\_2 - {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5} \cdot \color{blue}{\left({\left(\mathsf{fma}\left(\left|b\_2\right|, \left|b\_2\right|, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(\left|b\_2\right|, \left|b\_2\right|, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.25}\right)}}{\mathsf{fma}\left(-1, b\_2, {\left(\mathsf{fma}\left({b\_2}^{1}, {b\_2}^{1}, -1 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}\right)}}{a} \]
        6. Taylor expanded in b_2 around 0

          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{a} \cdot \sqrt{-1 \cdot \left(a \cdot c\right) + {\left(\left|b\_2\right|\right)}^{2}}\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites67.5%

            \[\leadsto \color{blue}{-1 \cdot \left({a}^{-1} \cdot {\left(\mathsf{fma}\left(-1, a \cdot c, b\_2 \cdot b\_2\right)\right)}^{0.5}\right)} \]

          if 2.35e-101 < b_2

          1. Initial program 70.4%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in c around 0

            \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a} + \frac{1}{2} \cdot \frac{c}{b\_2}} \]
          3. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \frac{1}{2} \cdot \frac{c}{b\_2} + \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{c}{b\_2} \cdot \frac{1}{2} + \color{blue}{-2} \cdot \frac{b\_2}{a} \]
            3. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, -2 \cdot \frac{b\_2}{a}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, \frac{b\_2}{a} \cdot -2\right) \]
            6. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, \frac{b\_2}{a} \cdot -2\right) \]
            7. lower-/.f6483.6

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right) \]
          4. Applied rewrites83.6%

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

        Alternative 4: 66.7% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right)\\ \end{array} \end{array} \]
        (FPCore (a b_2 c)
         :precision binary64
         (if (<= b_2 -5e-310)
           (* -0.5 (/ c b_2))
           (fma (/ c b_2) 0.5 (* (/ b_2 a) -2.0))))
        double code(double a, double b_2, double c) {
        	double tmp;
        	if (b_2 <= -5e-310) {
        		tmp = -0.5 * (c / b_2);
        	} else {
        		tmp = fma((c / b_2), 0.5, ((b_2 / a) * -2.0));
        	}
        	return tmp;
        }
        
        function code(a, b_2, c)
        	tmp = 0.0
        	if (b_2 <= -5e-310)
        		tmp = Float64(-0.5 * Float64(c / b_2));
        	else
        		tmp = fma(Float64(c / b_2), 0.5, Float64(Float64(b_2 / a) * -2.0));
        	end
        	return tmp
        end
        
        code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * 0.5 + N[(N[(b$95$2 / a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b\_2 \leq -5 \cdot 10^{-310}:\\
        \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b_2 < -4.999999999999985e-310

          1. Initial program 33.0%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in b_2 around -inf

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

              \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
            2. lower-/.f6466.0

              \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
          4. Applied rewrites66.0%

            \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

          if -4.999999999999985e-310 < b_2

          1. Initial program 72.8%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in c around 0

            \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a} + \frac{1}{2} \cdot \frac{c}{b\_2}} \]
          3. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \frac{1}{2} \cdot \frac{c}{b\_2} + \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{c}{b\_2} \cdot \frac{1}{2} + \color{blue}{-2} \cdot \frac{b\_2}{a} \]
            3. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, -2 \cdot \frac{b\_2}{a}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, \frac{b\_2}{a} \cdot -2\right) \]
            6. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, \frac{1}{2}, \frac{b\_2}{a} \cdot -2\right) \]
            7. lower-/.f6467.4

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2}, 0.5, \frac{b\_2}{a} \cdot -2\right) \]
          4. Applied rewrites67.4%

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

        Alternative 5: 65.8% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2\\ \end{array} \end{array} \]
        (FPCore (a b_2 c)
         :precision binary64
         (if (<= b_2 -5e-310)
           (* -0.5 (/ c b_2))
           (* (fma (/ c (exp (* (log b_2) 2.0))) 0.5 (* -2.0 (pow a -1.0))) b_2)))
        double code(double a, double b_2, double c) {
        	double tmp;
        	if (b_2 <= -5e-310) {
        		tmp = -0.5 * (c / b_2);
        	} else {
        		tmp = fma((c / exp((log(b_2) * 2.0))), 0.5, (-2.0 * pow(a, -1.0))) * b_2;
        	}
        	return tmp;
        }
        
        function code(a, b_2, c)
        	tmp = 0.0
        	if (b_2 <= -5e-310)
        		tmp = Float64(-0.5 * Float64(c / b_2));
        	else
        		tmp = Float64(fma(Float64(c / exp(Float64(log(b_2) * 2.0))), 0.5, Float64(-2.0 * (a ^ -1.0))) * b_2);
        	end
        	return tmp
        end
        
        code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c / N[Exp[N[(N[Log[b$95$2], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(-2.0 * N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b$95$2), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b\_2 \leq -5 \cdot 10^{-310}:\\
        \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b_2 < -4.999999999999985e-310

          1. Initial program 33.0%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in b_2 around -inf

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

              \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
            2. lower-/.f6466.0

              \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
          4. Applied rewrites66.0%

            \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

          if -4.999999999999985e-310 < b_2

          1. Initial program 72.8%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in b_2 around inf

            \[\leadsto \color{blue}{b\_2 \cdot \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right) \cdot \color{blue}{b\_2} \]
            2. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right) \cdot \color{blue}{b\_2} \]
            3. fp-cancel-sub-sign-invN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            4. *-commutativeN/A

              \[\leadsto \left(\frac{c}{{b\_2}^{2}} \cdot \frac{1}{2} + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            5. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{{b\_2}^{2}}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            6. lower-/.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{{b\_2}^{2}}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            7. pow2N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            8. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            10. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            11. inv-powN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            12. lower-pow.f6465.6

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
          4. Applied rewrites65.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            2. pow2N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{{b\_2}^{2}}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            3. pow-to-expN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            4. lower-exp.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            5. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            6. lower-log.f6465.6

              \[\leadsto \mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
          6. Applied rewrites65.6%

            \[\leadsto \mathsf{fma}\left(\frac{c}{e^{\log b\_2 \cdot 2}}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 6: 44.9% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {a}^{-1} \cdot 2\\ t_1 := \frac{\frac{c}{b\_2}}{b\_2} \cdot 0.5\\ \mathbf{if}\;b\_2 \leq 7.2 \cdot 10^{-125}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_1}^{3} - {t\_0}^{3}}{\mathsf{fma}\left(t\_1, t\_1, \mathsf{fma}\left(t\_0, t\_0, t\_1 \cdot t\_0\right)\right)} \cdot b\_2\\ \end{array} \end{array} \]
        (FPCore (a b_2 c)
         :precision binary64
         (let* ((t_0 (* (pow a -1.0) 2.0)) (t_1 (* (/ (/ c b_2) b_2) 0.5)))
           (if (<= b_2 7.2e-125)
             (* -0.5 (/ c b_2))
             (*
              (/
               (- (pow t_1 3.0) (pow t_0 3.0))
               (fma t_1 t_1 (fma t_0 t_0 (* t_1 t_0))))
              b_2))))
        double code(double a, double b_2, double c) {
        	double t_0 = pow(a, -1.0) * 2.0;
        	double t_1 = ((c / b_2) / b_2) * 0.5;
        	double tmp;
        	if (b_2 <= 7.2e-125) {
        		tmp = -0.5 * (c / b_2);
        	} else {
        		tmp = ((pow(t_1, 3.0) - pow(t_0, 3.0)) / fma(t_1, t_1, fma(t_0, t_0, (t_1 * t_0)))) * b_2;
        	}
        	return tmp;
        }
        
        function code(a, b_2, c)
        	t_0 = Float64((a ^ -1.0) * 2.0)
        	t_1 = Float64(Float64(Float64(c / b_2) / b_2) * 0.5)
        	tmp = 0.0
        	if (b_2 <= 7.2e-125)
        		tmp = Float64(-0.5 * Float64(c / b_2));
        	else
        		tmp = Float64(Float64(Float64((t_1 ^ 3.0) - (t_0 ^ 3.0)) / fma(t_1, t_1, fma(t_0, t_0, Float64(t_1 * t_0)))) * b_2);
        	end
        	return tmp
        end
        
        code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[Power[a, -1.0], $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c / b$95$2), $MachinePrecision] / b$95$2), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[b$95$2, 7.2e-125], N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] - N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$1 + N[(t$95$0 * t$95$0 + N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b$95$2), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := {a}^{-1} \cdot 2\\
        t_1 := \frac{\frac{c}{b\_2}}{b\_2} \cdot 0.5\\
        \mathbf{if}\;b\_2 \leq 7.2 \cdot 10^{-125}:\\
        \;\;\;\;-0.5 \cdot \frac{c}{b\_2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{{t\_1}^{3} - {t\_0}^{3}}{\mathsf{fma}\left(t\_1, t\_1, \mathsf{fma}\left(t\_0, t\_0, t\_1 \cdot t\_0\right)\right)} \cdot b\_2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b_2 < 7.2000000000000004e-125

          1. Initial program 41.6%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in b_2 around -inf

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

              \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
            2. lower-/.f6453.9

              \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
          4. Applied rewrites53.9%

            \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]

          if 7.2000000000000004e-125 < b_2

          1. Initial program 71.0%

            \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
          2. Taylor expanded in b_2 around inf

            \[\leadsto \color{blue}{b\_2 \cdot \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right) \cdot \color{blue}{b\_2} \]
            2. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right) \cdot \color{blue}{b\_2} \]
            3. fp-cancel-sub-sign-invN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            4. *-commutativeN/A

              \[\leadsto \left(\frac{c}{{b\_2}^{2}} \cdot \frac{1}{2} + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            5. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{{b\_2}^{2}}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            6. lower-/.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{{b\_2}^{2}}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            7. pow2N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            8. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            10. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            11. inv-powN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, \frac{1}{2}, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            12. lower-pow.f6481.5

              \[\leadsto \mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
          4. Applied rewrites81.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{c}{b\_2 \cdot b\_2}, 0.5, -2 \cdot {a}^{-1}\right) \cdot b\_2} \]
          5. Step-by-step derivation
            1. lift-fma.f64N/A

              \[\leadsto \left(\frac{c}{b\_2 \cdot b\_2} \cdot \frac{1}{2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            2. lift-*.f64N/A

              \[\leadsto \left(\frac{c}{b\_2 \cdot b\_2} \cdot \frac{1}{2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            3. lift-/.f64N/A

              \[\leadsto \left(\frac{c}{b\_2 \cdot b\_2} \cdot \frac{1}{2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            4. lift-*.f64N/A

              \[\leadsto \left(\frac{c}{b\_2 \cdot b\_2} \cdot \frac{1}{2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            5. lift-pow.f64N/A

              \[\leadsto \left(\frac{c}{b\_2 \cdot b\_2} \cdot \frac{1}{2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            6. *-commutativeN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{b\_2 \cdot b\_2} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            7. pow2N/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} + -2 \cdot {a}^{-1}\right) \cdot b\_2 \]
            8. inv-powN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} + -2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            9. metadata-evalN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{1}{a}\right) \cdot b\_2 \]
            10. fp-cancel-sub-sign-invN/A

              \[\leadsto \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}} - 2 \cdot \frac{1}{a}\right) \cdot b\_2 \]
            11. flip3--N/A

              \[\leadsto \frac{{\left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right)}^{3} - {\left(2 \cdot \frac{1}{a}\right)}^{3}}{\left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) \cdot \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) + \left(\left(2 \cdot \frac{1}{a}\right) \cdot \left(2 \cdot \frac{1}{a}\right) + \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) \cdot \left(2 \cdot \frac{1}{a}\right)\right)} \cdot b\_2 \]
            12. lower-/.f64N/A

              \[\leadsto \frac{{\left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right)}^{3} - {\left(2 \cdot \frac{1}{a}\right)}^{3}}{\left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) \cdot \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) + \left(\left(2 \cdot \frac{1}{a}\right) \cdot \left(2 \cdot \frac{1}{a}\right) + \left(\frac{1}{2} \cdot \frac{c}{{b\_2}^{2}}\right) \cdot \left(2 \cdot \frac{1}{a}\right)\right)} \cdot b\_2 \]
          6. Applied rewrites31.3%

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

        Alternative 7: 33.4% accurate, N/A× speedup?

        \[\begin{array}{l} \\ -0.5 \cdot \frac{c}{b\_2} \end{array} \]
        (FPCore (a b_2 c) :precision binary64 (* -0.5 (/ c b_2)))
        double code(double a, double b_2, double c) {
        	return -0.5 * (c / b_2);
        }
        
        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, b_2, c)
        use fmin_fmax_functions
            real(8), intent (in) :: a
            real(8), intent (in) :: b_2
            real(8), intent (in) :: c
            code = (-0.5d0) * (c / b_2)
        end function
        
        public static double code(double a, double b_2, double c) {
        	return -0.5 * (c / b_2);
        }
        
        def code(a, b_2, c):
        	return -0.5 * (c / b_2)
        
        function code(a, b_2, c)
        	return Float64(-0.5 * Float64(c / b_2))
        end
        
        function tmp = code(a, b_2, c)
        	tmp = -0.5 * (c / b_2);
        end
        
        code[a_, b$95$2_, c_] := N[(-0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        -0.5 \cdot \frac{c}{b\_2}
        \end{array}
        
        Derivation
        1. Initial program 53.3%

          \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
        2. Taylor expanded in b_2 around -inf

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

            \[\leadsto \frac{-1}{2} \cdot \color{blue}{\frac{c}{b\_2}} \]
          2. lower-/.f6433.4

            \[\leadsto -0.5 \cdot \frac{c}{\color{blue}{b\_2}} \]
        4. Applied rewrites33.4%

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

        Reproduce

        ?
        herbie shell --seed 2025093 
        (FPCore (a b_2 c)
          :name "quad2m (problem 3.2.1, negative)"
          :precision binary64
          :herbie-expected 10
          (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))