quad2m (problem 3.2.1, negative)

Percentage Accurate: 52.0% → 85.7%
Time: 11.6s
Alternatives: 10
Speedup: 15.9×

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;
}
real(8) function code(a, b_2, c)
    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}

Sampling outcomes in binary64 precision:

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 10 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: 52.0% 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;
}
real(8) function code(a, b_2, c)
    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.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b_2 \cdot b_2 - c \cdot a\\ t_1 := \frac{-0.5 \cdot c}{b_2}\\ \mathbf{if}\;b_2 \leq -2.65 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b_2 \leq -2.3 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{t_0 + 2 \cdot \left(a \cdot \left(c \cdot 0\right)\right)} - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq -5.1 \cdot 10^{-127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b_2 \leq 1.15 \cdot 10^{+97}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{t_0}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (let* ((t_0 (- (* b_2 b_2) (* c a))) (t_1 (/ (* -0.5 c) b_2)))
   (if (<= b_2 -2.65e+87)
     t_1
     (if (<= b_2 -2.3e-64)
       (/ (/ (* c a) (- (sqrt (+ t_0 (* 2.0 (* a (* c 0.0))))) b_2)) a)
       (if (<= b_2 -5.1e-127)
         t_1
         (if (<= b_2 1.15e+97)
           (/ (- (- b_2) (sqrt t_0)) a)
           (/ (* b_2 -2.0) a)))))))
double code(double a, double b_2, double c) {
	double t_0 = (b_2 * b_2) - (c * a);
	double t_1 = (-0.5 * c) / b_2;
	double tmp;
	if (b_2 <= -2.65e+87) {
		tmp = t_1;
	} else if (b_2 <= -2.3e-64) {
		tmp = ((c * a) / (sqrt((t_0 + (2.0 * (a * (c * 0.0))))) - b_2)) / a;
	} else if (b_2 <= -5.1e-127) {
		tmp = t_1;
	} else if (b_2 <= 1.15e+97) {
		tmp = (-b_2 - sqrt(t_0)) / a;
	} else {
		tmp = (b_2 * -2.0) / a;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (b_2 * b_2) - (c * a)
    t_1 = ((-0.5d0) * c) / b_2
    if (b_2 <= (-2.65d+87)) then
        tmp = t_1
    else if (b_2 <= (-2.3d-64)) then
        tmp = ((c * a) / (sqrt((t_0 + (2.0d0 * (a * (c * 0.0d0))))) - b_2)) / a
    else if (b_2 <= (-5.1d-127)) then
        tmp = t_1
    else if (b_2 <= 1.15d+97) then
        tmp = (-b_2 - sqrt(t_0)) / a
    else
        tmp = (b_2 * (-2.0d0)) / a
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double t_0 = (b_2 * b_2) - (c * a);
	double t_1 = (-0.5 * c) / b_2;
	double tmp;
	if (b_2 <= -2.65e+87) {
		tmp = t_1;
	} else if (b_2 <= -2.3e-64) {
		tmp = ((c * a) / (Math.sqrt((t_0 + (2.0 * (a * (c * 0.0))))) - b_2)) / a;
	} else if (b_2 <= -5.1e-127) {
		tmp = t_1;
	} else if (b_2 <= 1.15e+97) {
		tmp = (-b_2 - Math.sqrt(t_0)) / a;
	} else {
		tmp = (b_2 * -2.0) / a;
	}
	return tmp;
}
def code(a, b_2, c):
	t_0 = (b_2 * b_2) - (c * a)
	t_1 = (-0.5 * c) / b_2
	tmp = 0
	if b_2 <= -2.65e+87:
		tmp = t_1
	elif b_2 <= -2.3e-64:
		tmp = ((c * a) / (math.sqrt((t_0 + (2.0 * (a * (c * 0.0))))) - b_2)) / a
	elif b_2 <= -5.1e-127:
		tmp = t_1
	elif b_2 <= 1.15e+97:
		tmp = (-b_2 - math.sqrt(t_0)) / a
	else:
		tmp = (b_2 * -2.0) / a
	return tmp
function code(a, b_2, c)
	t_0 = Float64(Float64(b_2 * b_2) - Float64(c * a))
	t_1 = Float64(Float64(-0.5 * c) / b_2)
	tmp = 0.0
	if (b_2 <= -2.65e+87)
		tmp = t_1;
	elseif (b_2 <= -2.3e-64)
		tmp = Float64(Float64(Float64(c * a) / Float64(sqrt(Float64(t_0 + Float64(2.0 * Float64(a * Float64(c * 0.0))))) - b_2)) / a);
	elseif (b_2 <= -5.1e-127)
		tmp = t_1;
	elseif (b_2 <= 1.15e+97)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(t_0)) / a);
	else
		tmp = Float64(Float64(b_2 * -2.0) / a);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	t_0 = (b_2 * b_2) - (c * a);
	t_1 = (-0.5 * c) / b_2;
	tmp = 0.0;
	if (b_2 <= -2.65e+87)
		tmp = t_1;
	elseif (b_2 <= -2.3e-64)
		tmp = ((c * a) / (sqrt((t_0 + (2.0 * (a * (c * 0.0))))) - b_2)) / a;
	elseif (b_2 <= -5.1e-127)
		tmp = t_1;
	elseif (b_2 <= 1.15e+97)
		tmp = (-b_2 - sqrt(t_0)) / a;
	else
		tmp = (b_2 * -2.0) / a;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision]}, If[LessEqual[b$95$2, -2.65e+87], t$95$1, If[LessEqual[b$95$2, -2.3e-64], N[(N[(N[(c * a), $MachinePrecision] / N[(N[Sqrt[N[(t$95$0 + N[(2.0 * N[(a * N[(c * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -5.1e-127], t$95$1, If[LessEqual[b$95$2, 1.15e+97], N[(N[((-b$95$2) - N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b_2 \cdot b_2 - c \cdot a\\
t_1 := \frac{-0.5 \cdot c}{b_2}\\
\mathbf{if}\;b_2 \leq -2.65 \cdot 10^{+87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b_2 \leq -2.3 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{c \cdot a}{\sqrt{t_0 + 2 \cdot \left(a \cdot \left(c \cdot 0\right)\right)} - b_2}}{a}\\

\mathbf{elif}\;b_2 \leq -5.1 \cdot 10^{-127}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b_2 \leq 1.15 \cdot 10^{+97}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{t_0}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b_2 < -2.65000000000000002e87 or -2.3000000000000001e-64 < b_2 < -5.10000000000000019e-127

    1. Initial program 10.0%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
    3. Step-by-step derivation
      1. associate-*r/88.2%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
    4. Simplified88.2%

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

    if -2.65000000000000002e87 < b_2 < -2.3000000000000001e-64

    1. Initial program 33.6%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}}{a} \]
      2. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
      3. fma-neg33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
      4. prod-diff33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
      5. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
      6. fma-neg33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
      7. associate-+l+33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}}{a} \]
      8. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      9. fma-udef33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      10. distribute-lft-neg-in33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      11. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      12. distribute-rgt-neg-in33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      13. fma-def33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
      14. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
      15. fma-udef33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a} \]
      16. distribute-lft-neg-in33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a} \]
      17. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a} \]
      18. distribute-rgt-neg-in33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a} \]
      19. fma-def33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
    3. Applied egg-rr33.5%

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}}{a} \]
    4. Step-by-step derivation
      1. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a} \]
      2. count-233.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + \color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a} \]
      3. *-commutative33.5%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, \color{blue}{c \cdot a}\right)}}{a} \]
    5. Simplified33.5%

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
    6. Step-by-step derivation
      1. flip--33.5%

        \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)} \cdot \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}}{a} \]
      2. add-sqr-sqrt33.5%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \color{blue}{\left(\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)\right)}}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      3. *-commutative33.5%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - \color{blue}{a \cdot c}\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)\right)}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      4. *-commutative33.5%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}\right)}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      5. *-commutative33.5%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - a \cdot c\right) + \mathsf{fma}\left(a, -c, \color{blue}{a \cdot c}\right) \cdot 2\right)}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      6. *-commutative33.5%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right) \cdot 2\right)}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - \color{blue}{a \cdot c}\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
    7. Applied egg-rr33.5%

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right) \cdot 2\right)}{\left(-b_2\right) + \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right) \cdot 2}}}}{a} \]
    8. Step-by-step derivation
      1. Simplified33.5%

        \[\leadsto \frac{\color{blue}{\frac{b_2 \cdot b_2 - \left(\left(b_2 \cdot b_2 - a \cdot c\right) + 2 \cdot \left(a \cdot \left(0 \cdot c\right)\right)\right)}{\sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + 2 \cdot \left(a \cdot \left(0 \cdot c\right)\right)} + \left(-b_2\right)}}}{a} \]
      2. Taylor expanded in b_2 around 0 91.6%

        \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + 2 \cdot \left(a \cdot \left(0 \cdot c\right)\right)} + \left(-b_2\right)}}{a} \]

      if -5.10000000000000019e-127 < b_2 < 1.15000000000000003e97

      1. Initial program 83.2%

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

      if 1.15000000000000003e97 < b_2

      1. Initial program 43.4%

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

        \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
      3. Step-by-step derivation
        1. *-commutative93.7%

          \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
      4. Simplified93.7%

        \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
    9. Recombined 4 regimes into one program.
    10. Final simplification87.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.65 \cdot 10^{+87}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq -2.3 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \left(a \cdot \left(c \cdot 0\right)\right)} - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq -5.1 \cdot 10^{-127}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 1.15 \cdot 10^{+97}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

    Alternative 2: 85.4% accurate, 1.0× speedup?

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

      1. Initial program 18.3%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/84.0%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified84.0%

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

      if -1.20000000000000003e-126 < b_2 < 1.1e97

      1. Initial program 83.2%

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

      if 1.1e97 < b_2

      1. Initial program 43.4%

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

        \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
      3. Step-by-step derivation
        1. *-commutative93.7%

          \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
      4. Simplified93.7%

        \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification85.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.2 \cdot 10^{-126}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 1.1 \cdot 10^{+97}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

    Alternative 3: 80.7% accurate, 1.0× speedup?

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

      1. Initial program 18.3%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/84.0%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified84.0%

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

      if -1.20000000000000003e-126 < b_2 < 1.8000000000000001e-93

      1. Initial program 79.6%

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

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{-1 \cdot \left(c \cdot a\right)}}}{a} \]
      3. Step-by-step derivation
        1. mul-1-neg74.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{-c \cdot a}}}{a} \]
        2. distribute-rgt-neg-out74.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{c \cdot \left(-a\right)}}}{a} \]
      4. Simplified74.1%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{c \cdot \left(-a\right)}}}{a} \]

      if 1.8000000000000001e-93 < b_2

      1. Initial program 66.6%

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

        \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification81.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.2 \cdot 10^{-126}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 1.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{c \cdot \left(-a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]

    Alternative 4: 80.3% accurate, 1.0× speedup?

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

      1. Initial program 18.3%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/84.0%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified84.0%

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

      if -3.89999999999999997e-128 < b_2 < 2.4e-94

      1. Initial program 79.6%

        \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
      2. Step-by-step derivation
        1. prod-diff79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}}{a} \]
        2. *-commutative79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        3. fma-neg79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        4. prod-diff79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        5. *-commutative79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        6. fma-neg79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        7. associate-+l+79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}}{a} \]
        8. *-commutative79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        9. fma-udef79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        10. distribute-lft-neg-in79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        11. *-commutative79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        12. distribute-rgt-neg-in79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        13. fma-def79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        14. *-commutative79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
        15. fma-udef79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a} \]
        16. distribute-lft-neg-in79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a} \]
        17. *-commutative79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a} \]
        18. distribute-rgt-neg-in79.3%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a} \]
        19. fma-def79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
      3. Applied egg-rr79.2%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}}{a} \]
      4. Step-by-step derivation
        1. *-commutative79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a} \]
        2. count-279.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + \color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a} \]
        3. *-commutative79.2%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, \color{blue}{c \cdot a}\right)}}{a} \]
      5. Simplified79.2%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      6. Taylor expanded in b_2 around 0 71.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot \sqrt{2 \cdot \left(-1 \cdot \left(c \cdot a\right) + c \cdot a\right) - c \cdot a}}}{a} \]
      7. Step-by-step derivation
        1. mul-1-neg71.9%

          \[\leadsto \frac{\color{blue}{-\sqrt{2 \cdot \left(-1 \cdot \left(c \cdot a\right) + c \cdot a\right) - c \cdot a}}}{a} \]
        2. fma-neg71.9%

          \[\leadsto \frac{-\sqrt{\color{blue}{\mathsf{fma}\left(2, -1 \cdot \left(c \cdot a\right) + c \cdot a, -c \cdot a\right)}}}{a} \]
        3. associate-*r*71.9%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(-1 \cdot c\right) \cdot a} + c \cdot a, -c \cdot a\right)}}{a} \]
        4. neg-mul-171.9%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(-c\right)} \cdot a + c \cdot a, -c \cdot a\right)}}{a} \]
        5. *-commutative71.9%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(2, \color{blue}{a \cdot \left(-c\right)} + c \cdot a, -c \cdot a\right)}}{a} \]
        6. *-commutative71.9%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(2, a \cdot \left(-c\right) + \color{blue}{a \cdot c}, -c \cdot a\right)}}{a} \]
        7. fma-def71.8%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(2, \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}, -c \cdot a\right)}}{a} \]
        8. fma-neg71.8%

          \[\leadsto \frac{-\sqrt{\color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right) - c \cdot a}}}{a} \]
        9. fma-def71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(a \cdot \left(-c\right) + a \cdot c\right)} - c \cdot a}}{a} \]
        10. *-commutative71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(-c\right) \cdot a} + a \cdot c\right) - c \cdot a}}{a} \]
        11. neg-mul-171.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(-1 \cdot c\right)} \cdot a + a \cdot c\right) - c \cdot a}}{a} \]
        12. associate-*r*71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{-1 \cdot \left(c \cdot a\right)} + a \cdot c\right) - c \cdot a}}{a} \]
        13. *-commutative71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(-1 \cdot \left(c \cdot a\right) + \color{blue}{c \cdot a}\right) - c \cdot a}}{a} \]
        14. distribute-lft1-in71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \left(c \cdot a\right)\right)} - c \cdot a}}{a} \]
        15. metadata-eval71.9%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{0} \cdot \left(c \cdot a\right)\right) - c \cdot a}}{a} \]
        16. mul0-lft72.2%

          \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{0} - c \cdot a}}{a} \]
        17. metadata-eval72.2%

          \[\leadsto \frac{-\sqrt{\color{blue}{0} - c \cdot a}}{a} \]
        18. neg-sub072.2%

          \[\leadsto \frac{-\sqrt{\color{blue}{-c \cdot a}}}{a} \]
        19. distribute-lft-neg-in72.2%

          \[\leadsto \frac{-\sqrt{\color{blue}{\left(-c\right) \cdot a}}}{a} \]
        20. *-commutative72.2%

          \[\leadsto \frac{-\sqrt{\color{blue}{a \cdot \left(-c\right)}}}{a} \]
      8. Simplified72.2%

        \[\leadsto \frac{\color{blue}{-\sqrt{a \cdot \left(-c\right)}}}{a} \]

      if 2.4e-94 < b_2

      1. Initial program 66.6%

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

        \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification80.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -3.9 \cdot 10^{-128}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.4 \cdot 10^{-94}:\\ \;\;\;\;\frac{-\sqrt{c \cdot \left(-a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]

    Alternative 5: 68.5% accurate, 8.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \end{array} \]
    (FPCore (a b_2 c)
     :precision binary64
     (if (<= b_2 -2e-310)
       (/ (* -0.5 c) b_2)
       (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))))
    double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
    	}
    	return tmp;
    }
    
    real(8) function code(a, b_2, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b_2
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b_2 <= (-2d-310)) then
            tmp = ((-0.5d0) * c) / b_2
        else
            tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
        end if
        code = tmp
    end function
    
    public static double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
    	}
    	return tmp;
    }
    
    def code(a, b_2, c):
    	tmp = 0
    	if b_2 <= -2e-310:
    		tmp = (-0.5 * c) / b_2
    	else:
    		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
    	return tmp
    
    function code(a, b_2, c)
    	tmp = 0.0
    	if (b_2 <= -2e-310)
    		tmp = Float64(Float64(-0.5 * c) / b_2);
    	else
    		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b_2, c)
    	tmp = 0.0;
    	if (b_2 <= -2e-310)
    		tmp = (-0.5 * c) / b_2;
    	else
    		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e-310], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\
    \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b_2 < -1.999999999999994e-310

      1. Initial program 30.8%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/68.9%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified68.9%

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

      if -1.999999999999994e-310 < b_2

      1. Initial program 70.5%

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

        \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification67.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]

    Alternative 6: 68.2% accurate, 15.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c \cdot \frac{-0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \end{array} \]
    (FPCore (a b_2 c)
     :precision binary64
     (if (<= b_2 -2e-310) (* c (/ -0.5 b_2)) (/ -2.0 (/ a b_2))))
    double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = c * (-0.5 / b_2);
    	} else {
    		tmp = -2.0 / (a / b_2);
    	}
    	return tmp;
    }
    
    real(8) function code(a, b_2, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b_2
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b_2 <= (-2d-310)) then
            tmp = c * ((-0.5d0) / b_2)
        else
            tmp = (-2.0d0) / (a / b_2)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = c * (-0.5 / b_2);
    	} else {
    		tmp = -2.0 / (a / b_2);
    	}
    	return tmp;
    }
    
    def code(a, b_2, c):
    	tmp = 0
    	if b_2 <= -2e-310:
    		tmp = c * (-0.5 / b_2)
    	else:
    		tmp = -2.0 / (a / b_2)
    	return tmp
    
    function code(a, b_2, c)
    	tmp = 0.0
    	if (b_2 <= -2e-310)
    		tmp = Float64(c * Float64(-0.5 / b_2));
    	else
    		tmp = Float64(-2.0 / Float64(a / b_2));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b_2, c)
    	tmp = 0.0;
    	if (b_2 <= -2e-310)
    		tmp = c * (-0.5 / b_2);
    	else
    		tmp = -2.0 / (a / b_2);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e-310], N[(c * N[(-0.5 / b$95$2), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\
    \;\;\;\;c \cdot \frac{-0.5}{b_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b_2 < -1.999999999999994e-310

      1. Initial program 30.8%

        \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
      2. Step-by-step derivation
        1. frac-2neg30.8%

          \[\leadsto \color{blue}{\frac{-\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}{-a}} \]
        2. div-inv30.8%

          \[\leadsto \color{blue}{\left(-\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)\right) \cdot \frac{1}{-a}} \]
      3. Applied egg-rr37.1%

        \[\leadsto \color{blue}{\left(b_2 + \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right) \cdot \frac{1}{-a}} \]
      4. Taylor expanded in b_2 around -inf 0.0%

        \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
      5. Step-by-step derivation
        1. associate-*r/0.0%

          \[\leadsto \color{blue}{\frac{0.5 \cdot \left(c \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{b_2}} \]
        2. *-commutative0.0%

          \[\leadsto \frac{0.5 \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot c\right)}}{b_2} \]
        3. unpow20.0%

          \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
        4. rem-square-sqrt68.9%

          \[\leadsto \frac{0.5 \cdot \left(\color{blue}{-1} \cdot c\right)}{b_2} \]
        5. associate-*r*68.9%

          \[\leadsto \frac{\color{blue}{\left(0.5 \cdot -1\right) \cdot c}}{b_2} \]
        6. metadata-eval68.9%

          \[\leadsto \frac{\color{blue}{-0.5} \cdot c}{b_2} \]
        7. associate-/l*68.6%

          \[\leadsto \color{blue}{\frac{-0.5}{\frac{b_2}{c}}} \]
      6. Simplified68.6%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{b_2}{c}}} \]
      7. Step-by-step derivation
        1. associate-/r/68.7%

          \[\leadsto \color{blue}{\frac{-0.5}{b_2} \cdot c} \]
      8. Applied egg-rr68.7%

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

      if -1.999999999999994e-310 < b_2

      1. Initial program 70.5%

        \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
      2. Step-by-step derivation
        1. prod-diff70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}}{a} \]
        2. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        3. fma-neg70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        4. prod-diff70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        5. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        6. fma-neg70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        7. associate-+l+70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}}{a} \]
        8. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        9. fma-udef70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        10. distribute-lft-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        11. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        12. distribute-rgt-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        13. fma-def70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        14. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
        15. fma-udef70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a} \]
        16. distribute-lft-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a} \]
        17. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a} \]
        18. distribute-rgt-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a} \]
        19. fma-def70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
      3. Applied egg-rr70.1%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}}{a} \]
      4. Step-by-step derivation
        1. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a} \]
        2. count-270.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + \color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a} \]
        3. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, \color{blue}{c \cdot a}\right)}}{a} \]
      5. Simplified70.1%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      6. Taylor expanded in b_2 around inf 64.6%

        \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}} \]
      7. Step-by-step derivation
        1. associate-*r/64.6%

          \[\leadsto \color{blue}{\frac{-2 \cdot b_2}{a}} \]
        2. associate-/l*64.4%

          \[\leadsto \color{blue}{\frac{-2}{\frac{a}{b_2}}} \]
      8. Simplified64.4%

        \[\leadsto \color{blue}{\frac{-2}{\frac{a}{b_2}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification66.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c \cdot \frac{-0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \]

    Alternative 7: 68.3% accurate, 15.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \end{array} \]
    (FPCore (a b_2 c)
     :precision binary64
     (if (<= b_2 -2e-310) (/ (* -0.5 c) b_2) (/ -2.0 (/ a b_2))))
    double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = -2.0 / (a / b_2);
    	}
    	return tmp;
    }
    
    real(8) function code(a, b_2, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b_2
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b_2 <= (-2d-310)) then
            tmp = ((-0.5d0) * c) / b_2
        else
            tmp = (-2.0d0) / (a / b_2)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = -2.0 / (a / b_2);
    	}
    	return tmp;
    }
    
    def code(a, b_2, c):
    	tmp = 0
    	if b_2 <= -2e-310:
    		tmp = (-0.5 * c) / b_2
    	else:
    		tmp = -2.0 / (a / b_2)
    	return tmp
    
    function code(a, b_2, c)
    	tmp = 0.0
    	if (b_2 <= -2e-310)
    		tmp = Float64(Float64(-0.5 * c) / b_2);
    	else
    		tmp = Float64(-2.0 / Float64(a / b_2));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b_2, c)
    	tmp = 0.0;
    	if (b_2 <= -2e-310)
    		tmp = (-0.5 * c) / b_2;
    	else
    		tmp = -2.0 / (a / b_2);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e-310], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(-2.0 / N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\
    \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b_2 < -1.999999999999994e-310

      1. Initial program 30.8%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/68.9%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified68.9%

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

      if -1.999999999999994e-310 < b_2

      1. Initial program 70.5%

        \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
      2. Step-by-step derivation
        1. prod-diff70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}}{a} \]
        2. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        3. fma-neg70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        4. prod-diff70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        5. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        6. fma-neg70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a} \]
        7. associate-+l+70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}}{a} \]
        8. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        9. fma-udef70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        10. distribute-lft-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        11. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        12. distribute-rgt-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        13. fma-def70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a} \]
        14. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
        15. fma-udef70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a} \]
        16. distribute-lft-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a} \]
        17. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a} \]
        18. distribute-rgt-neg-in70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a} \]
        19. fma-def70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
      3. Applied egg-rr70.1%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}}{a} \]
      4. Step-by-step derivation
        1. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a} \]
        2. count-270.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + \color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a} \]
        3. *-commutative70.1%

          \[\leadsto \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, \color{blue}{c \cdot a}\right)}}{a} \]
      5. Simplified70.1%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}}{a} \]
      6. Taylor expanded in b_2 around inf 64.6%

        \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}} \]
      7. Step-by-step derivation
        1. associate-*r/64.6%

          \[\leadsto \color{blue}{\frac{-2 \cdot b_2}{a}} \]
        2. associate-/l*64.4%

          \[\leadsto \color{blue}{\frac{-2}{\frac{a}{b_2}}} \]
      8. Simplified64.4%

        \[\leadsto \color{blue}{\frac{-2}{\frac{a}{b_2}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification66.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \]

    Alternative 8: 68.3% accurate, 15.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \end{array} \]
    (FPCore (a b_2 c)
     :precision binary64
     (if (<= b_2 -2e-310) (/ (* -0.5 c) b_2) (/ (* b_2 -2.0) a)))
    double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = (b_2 * -2.0) / a;
    	}
    	return tmp;
    }
    
    real(8) function code(a, b_2, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b_2
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b_2 <= (-2d-310)) then
            tmp = ((-0.5d0) * c) / b_2
        else
            tmp = (b_2 * (-2.0d0)) / a
        end if
        code = tmp
    end function
    
    public static double code(double a, double b_2, double c) {
    	double tmp;
    	if (b_2 <= -2e-310) {
    		tmp = (-0.5 * c) / b_2;
    	} else {
    		tmp = (b_2 * -2.0) / a;
    	}
    	return tmp;
    }
    
    def code(a, b_2, c):
    	tmp = 0
    	if b_2 <= -2e-310:
    		tmp = (-0.5 * c) / b_2
    	else:
    		tmp = (b_2 * -2.0) / a
    	return tmp
    
    function code(a, b_2, c)
    	tmp = 0.0
    	if (b_2 <= -2e-310)
    		tmp = Float64(Float64(-0.5 * c) / b_2);
    	else
    		tmp = Float64(Float64(b_2 * -2.0) / a);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b_2, c)
    	tmp = 0.0;
    	if (b_2 <= -2e-310)
    		tmp = (-0.5 * c) / b_2;
    	else
    		tmp = (b_2 * -2.0) / a;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2e-310], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\
    \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{b_2 \cdot -2}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b_2 < -1.999999999999994e-310

      1. Initial program 30.8%

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
      3. Step-by-step derivation
        1. associate-*r/68.9%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      4. Simplified68.9%

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

      if -1.999999999999994e-310 < b_2

      1. Initial program 70.5%

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

        \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
      3. Step-by-step derivation
        1. *-commutative64.6%

          \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
      4. Simplified64.6%

        \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification66.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

    Alternative 9: 10.6% accurate, 22.4× speedup?

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

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b_2 + 0.5 \cdot \frac{c \cdot a}{b_2}}}{a} \]
    3. Step-by-step derivation
      1. div-inv30.6%

        \[\leadsto \frac{-2 \cdot b_2 + 0.5 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot \frac{1}{b_2}\right)}}{a} \]
      2. *-commutative30.6%

        \[\leadsto \frac{-2 \cdot b_2 + 0.5 \cdot \left(\color{blue}{\left(a \cdot c\right)} \cdot \frac{1}{b_2}\right)}{a} \]
    4. Applied egg-rr30.6%

      \[\leadsto \frac{-2 \cdot b_2 + 0.5 \cdot \color{blue}{\left(\left(a \cdot c\right) \cdot \frac{1}{b_2}\right)}}{a} \]
    5. Step-by-step derivation
      1. associate-*l*33.3%

        \[\leadsto \frac{-2 \cdot b_2 + 0.5 \cdot \color{blue}{\left(a \cdot \left(c \cdot \frac{1}{b_2}\right)\right)}}{a} \]
    6. Simplified33.3%

      \[\leadsto \frac{-2 \cdot b_2 + 0.5 \cdot \color{blue}{\left(a \cdot \left(c \cdot \frac{1}{b_2}\right)\right)}}{a} \]
    7. Taylor expanded in b_2 around 0 9.5%

      \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b_2}} \]
    8. Step-by-step derivation
      1. *-commutative9.5%

        \[\leadsto \color{blue}{\frac{c}{b_2} \cdot 0.5} \]
      2. associate-*l/9.5%

        \[\leadsto \color{blue}{\frac{c \cdot 0.5}{b_2}} \]
      3. associate-*r/9.5%

        \[\leadsto \color{blue}{c \cdot \frac{0.5}{b_2}} \]
    9. Simplified9.5%

      \[\leadsto \color{blue}{c \cdot \frac{0.5}{b_2}} \]
    10. Final simplification9.5%

      \[\leadsto c \cdot \frac{0.5}{b_2} \]

    Alternative 10: 34.7% accurate, 22.4× speedup?

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

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. frac-2neg50.5%

        \[\leadsto \color{blue}{\frac{-\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}{-a}} \]
      2. div-inv50.3%

        \[\leadsto \color{blue}{\left(-\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)\right) \cdot \frac{1}{-a}} \]
    3. Applied egg-rr47.8%

      \[\leadsto \color{blue}{\left(b_2 + \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right) \cdot \frac{1}{-a}} \]
    4. Taylor expanded in b_2 around -inf 0.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    5. Step-by-step derivation
      1. associate-*r/0.0%

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(c \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{b_2}} \]
      2. *-commutative0.0%

        \[\leadsto \frac{0.5 \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot c\right)}}{b_2} \]
      3. unpow20.0%

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt35.8%

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{-1} \cdot c\right)}{b_2} \]
      5. associate-*r*35.8%

        \[\leadsto \frac{\color{blue}{\left(0.5 \cdot -1\right) \cdot c}}{b_2} \]
      6. metadata-eval35.8%

        \[\leadsto \frac{\color{blue}{-0.5} \cdot c}{b_2} \]
      7. associate-/l*35.7%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{b_2}{c}}} \]
    6. Simplified35.7%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{b_2}{c}}} \]
    7. Step-by-step derivation
      1. associate-/r/35.8%

        \[\leadsto \color{blue}{\frac{-0.5}{b_2} \cdot c} \]
    8. Applied egg-rr35.8%

      \[\leadsto \color{blue}{\frac{-0.5}{b_2} \cdot c} \]
    9. Final simplification35.8%

      \[\leadsto c \cdot \frac{-0.5}{b_2} \]

    Reproduce

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