quad2m (problem 3.2.1, negative)

Percentage Accurate: 53.3% → 88.9%
Time: 9.9s
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: 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;
}
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: 88.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -2.9 \cdot 10^{+32}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\ \mathbf{elif}\;b_2 \leq -2 \cdot 10^{-309}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right) - b_2}\\ \mathbf{elif}\;b_2 \leq 10^{+127}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 -2.9e+32)
   (* (/ a a) (/ c (fma b_2 -2.0 (* c (* 0.5 (/ a b_2))))))
   (if (<= b_2 -2e-309)
     (* (/ a a) (/ c (- (hypot b_2 (sqrt (* a (- c)))) b_2)))
     (if (<= b_2 1e+127)
       (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) 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 <= -2.9e+32) {
		tmp = (a / a) * (c / fma(b_2, -2.0, (c * (0.5 * (a / b_2)))));
	} else if (b_2 <= -2e-309) {
		tmp = (a / a) * (c / (hypot(b_2, sqrt((a * -c))) - b_2));
	} else if (b_2 <= 1e+127) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / 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 <= -2.9e+32)
		tmp = Float64(Float64(a / a) * Float64(c / fma(b_2, -2.0, Float64(c * Float64(0.5 * Float64(a / b_2))))));
	elseif (b_2 <= -2e-309)
		tmp = Float64(Float64(a / a) * Float64(c / Float64(hypot(b_2, sqrt(Float64(a * Float64(-c)))) - b_2)));
	elseif (b_2 <= 1e+127)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	else
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	end
	return tmp
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -2.9e+32], N[(N[(a / a), $MachinePrecision] * N[(c / N[(b$95$2 * -2.0 + N[(c * N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, -2e-309], N[(N[(a / a), $MachinePrecision] * N[(c / N[(N[Sqrt[b$95$2 ^ 2 + N[Sqrt[N[(a * (-c)), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision] - b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 1e+127], 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[(-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.9 \cdot 10^{+32}:\\
\;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\

\mathbf{elif}\;b_2 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right) - b_2}\\

\mathbf{elif}\;b_2 \leq 10^{+127}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 4 regimes
  2. if b_2 < -2.90000000000000003e32

    1. Initial program 8.2%

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

        \[\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. *-commutative8.2%

        \[\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-neg8.2%

        \[\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-diff8.2%

        \[\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. *-commutative8.2%

        \[\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-neg8.2%

        \[\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+8.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. *-commutative8.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-udef8.2%

        \[\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-in8.2%

        \[\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. *-commutative8.2%

        \[\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-in8.2%

        \[\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-def8.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. *-commutative8.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-udef8.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}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a} \]
      16. distribute-lft-neg-in8.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) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a} \]
      17. *-commutative8.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) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a} \]
      18. distribute-rgt-neg-in8.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) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a} \]
      19. fma-def8.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-rr8.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. *-commutative8.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-28.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. *-commutative8.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. Simplified8.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. Step-by-step derivation
      1. flip--7.1%

        \[\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-sqrt7.1%

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

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\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} \]
      4. *-commutative7.1%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \color{blue}{\mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    7. Applied egg-rr7.1%

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    8. Simplified59.9%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}}{a} \]
    9. Step-by-step derivation
      1. div-inv59.9%

        \[\leadsto \color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2} \cdot \frac{1}{a}} \]
      2. sub-neg59.9%

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

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{c \cdot \left(-a\right)}} - b_2} \cdot \frac{1}{a} \]
      4. add-sqr-sqrt35.2%

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{\sqrt{c \cdot \left(-a\right)} \cdot \sqrt{c \cdot \left(-a\right)}}} - b_2} \cdot \frac{1}{a} \]
      5. hypot-udef51.1%

        \[\leadsto \frac{c \cdot a}{\color{blue}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)} - b_2} \cdot \frac{1}{a} \]
    10. Applied egg-rr51.1%

      \[\leadsto \color{blue}{\frac{c \cdot a}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2} \cdot \frac{1}{a}} \]
    11. Step-by-step derivation
      1. times-frac48.9%

        \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot 1}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a}} \]
      2. *-rgt-identity48.9%

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

        \[\leadsto \frac{\color{blue}{a \cdot c}}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a} \]
      4. *-commutative48.9%

        \[\leadsto \frac{a \cdot c}{\color{blue}{a \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right)}} \]
      5. times-frac54.8%

        \[\leadsto \color{blue}{\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2}} \]
    12. Simplified54.8%

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

      \[\leadsto \frac{a}{a} \cdot \frac{c}{\color{blue}{-2 \cdot b_2 + -0.5 \cdot \frac{c \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot a\right)}{b_2}}} \]
    14. Step-by-step derivation
      1. *-commutative0.0%

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

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\frac{-0.5 \cdot \left(c \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot a\right)\right)}{b_2}}\right)} \]
      4. associate-*r*0.0%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{-0.5 \cdot \color{blue}{\left(\left(c \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot a\right)}}{b_2}\right)} \]
      5. associate-*r*0.0%

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(-0.5 \cdot \left(c \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right)\right) \cdot a}{b_2}\right)} \]
      7. rem-square-sqrt96.1%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(-0.5 \cdot \left(c \cdot \color{blue}{-1}\right)\right) \cdot a}{b_2}\right)} \]
      8. associate-*l*96.1%

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(\color{blue}{\left(c \cdot -0.5\right)} \cdot -1\right) \cdot a}{b_2}\right)} \]
      10. associate-*l*96.1%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\color{blue}{\left(c \cdot \left(-0.5 \cdot -1\right)\right)} \cdot a}{b_2}\right)} \]
      11. metadata-eval96.1%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(c \cdot \color{blue}{0.5}\right) \cdot a}{b_2}\right)} \]
      12. associate-/l*98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\frac{c \cdot 0.5}{\frac{b_2}{a}}}\right)} \]
      13. *-rgt-identity98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\color{blue}{\left(c \cdot 0.5\right) \cdot 1}}{\frac{b_2}{a}}\right)} \]
      14. associate-*r/98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\left(c \cdot 0.5\right) \cdot \frac{1}{\frac{b_2}{a}}}\right)} \]
      15. associate-*l*98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{c \cdot \left(0.5 \cdot \frac{1}{\frac{b_2}{a}}\right)}\right)} \]
      16. associate-/r/98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \color{blue}{\left(\frac{1}{b_2} \cdot a\right)}\right)\right)} \]
      17. *-commutative98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot \frac{1}{b_2}\right)}\right)\right)} \]
      18. associate-*r/98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \color{blue}{\frac{a \cdot 1}{b_2}}\right)\right)} \]
      19. *-rgt-identity98.7%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{\color{blue}{a}}{b_2}\right)\right)} \]
    15. Simplified98.7%

      \[\leadsto \frac{a}{a} \cdot \frac{c}{\color{blue}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}} \]

    if -2.90000000000000003e32 < b_2 < -1.9999999999999988e-309

    1. Initial program 59.5%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff59.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. *-commutative59.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-neg59.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-diff59.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. *-commutative59.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-neg59.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+59.0%

        \[\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. *-commutative59.0%

        \[\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-udef59.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-in59.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. *-commutative59.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-in59.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-def59.0%

        \[\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. *-commutative59.0%

        \[\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-udef59.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-in59.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. *-commutative59.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-in59.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-def59.0%

        \[\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-rr59.0%

      \[\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. *-commutative59.0%

        \[\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-259.0%

        \[\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. *-commutative59.0%

        \[\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. Simplified59.0%

      \[\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--58.9%

        \[\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-sqrt59.0%

        \[\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. *-commutative59.0%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\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} \]
      4. *-commutative59.0%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \color{blue}{\mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    7. Applied egg-rr59.0%

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    8. Simplified71.7%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}}{a} \]
    9. Step-by-step derivation
      1. div-inv71.5%

        \[\leadsto \color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2} \cdot \frac{1}{a}} \]
      2. sub-neg71.5%

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

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{c \cdot \left(-a\right)}} - b_2} \cdot \frac{1}{a} \]
      4. add-sqr-sqrt69.8%

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{\sqrt{c \cdot \left(-a\right)} \cdot \sqrt{c \cdot \left(-a\right)}}} - b_2} \cdot \frac{1}{a} \]
      5. hypot-udef69.8%

        \[\leadsto \frac{c \cdot a}{\color{blue}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)} - b_2} \cdot \frac{1}{a} \]
    10. Applied egg-rr69.8%

      \[\leadsto \color{blue}{\frac{c \cdot a}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2} \cdot \frac{1}{a}} \]
    11. Step-by-step derivation
      1. times-frac63.8%

        \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot 1}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a}} \]
      2. *-rgt-identity63.8%

        \[\leadsto \frac{\color{blue}{c \cdot a}}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a} \]
      3. *-commutative63.8%

        \[\leadsto \frac{\color{blue}{a \cdot c}}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a} \]
      4. *-commutative63.8%

        \[\leadsto \frac{a \cdot c}{\color{blue}{a \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right)}} \]
      5. times-frac85.4%

        \[\leadsto \color{blue}{\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2}} \]
    12. Simplified85.4%

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

    if -1.9999999999999988e-309 < b_2 < 9.99999999999999955e126

    1. Initial program 85.8%

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

    if 9.99999999999999955e126 < b_2

    1. Initial program 45.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.9 \cdot 10^{+32}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\ \mathbf{elif}\;b_2 \leq -2 \cdot 10^{-309}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right) - b_2}\\ \mathbf{elif}\;b_2 \leq 10^{+127}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]

Alternative 2: 86.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -9.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\ \mathbf{elif}\;b_2 \leq 7.7 \cdot 10^{+127}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 -9.8e-79)
   (* (/ a a) (/ c (fma b_2 -2.0 (* c (* 0.5 (/ a b_2))))))
   (if (<= b_2 7.7e+127)
     (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) 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 <= -9.8e-79) {
		tmp = (a / a) * (c / fma(b_2, -2.0, (c * (0.5 * (a / b_2)))));
	} else if (b_2 <= 7.7e+127) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / 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 <= -9.8e-79)
		tmp = Float64(Float64(a / a) * Float64(c / fma(b_2, -2.0, Float64(c * Float64(0.5 * Float64(a / b_2))))));
	elseif (b_2 <= 7.7e+127)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	else
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	end
	return tmp
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -9.8e-79], N[(N[(a / a), $MachinePrecision] * N[(c / N[(b$95$2 * -2.0 + N[(c * N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 7.7e+127], 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[(-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 -9.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\

\mathbf{elif}\;b_2 \leq 7.7 \cdot 10^{+127}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 < -9.8000000000000001e-79

    1. Initial program 16.2%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff16.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. *-commutative16.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-neg16.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-diff16.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. *-commutative16.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-neg16.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+16.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. *-commutative16.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-udef16.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-in16.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. *-commutative16.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-in16.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-def16.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. *-commutative16.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-udef16.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-in16.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. *-commutative16.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-in16.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-def16.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-rr16.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. *-commutative16.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-216.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. *-commutative16.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. Simplified16.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. Step-by-step derivation
      1. flip--15.3%

        \[\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-sqrt15.3%

        \[\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. *-commutative15.3%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\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} \]
      4. *-commutative15.3%

        \[\leadsto \frac{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \color{blue}{\mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    7. Applied egg-rr15.3%

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \left(\left(b_2 \cdot b_2 - c \cdot a\right) + \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) + \mathsf{fma}\left(a, -c, c \cdot a\right) \cdot 2}}}}{a} \]
    8. Simplified61.6%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}}{a} \]
    9. Step-by-step derivation
      1. div-inv61.6%

        \[\leadsto \color{blue}{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2} \cdot \frac{1}{a}} \]
      2. sub-neg61.6%

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

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{c \cdot \left(-a\right)}} - b_2} \cdot \frac{1}{a} \]
      4. add-sqr-sqrt42.5%

        \[\leadsto \frac{c \cdot a}{\sqrt{b_2 \cdot b_2 + \color{blue}{\sqrt{c \cdot \left(-a\right)} \cdot \sqrt{c \cdot \left(-a\right)}}} - b_2} \cdot \frac{1}{a} \]
      5. hypot-udef54.1%

        \[\leadsto \frac{c \cdot a}{\color{blue}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)} - b_2} \cdot \frac{1}{a} \]
    10. Applied egg-rr54.1%

      \[\leadsto \color{blue}{\frac{c \cdot a}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2} \cdot \frac{1}{a}} \]
    11. Step-by-step derivation
      1. times-frac49.7%

        \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot 1}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a}} \]
      2. *-rgt-identity49.7%

        \[\leadsto \frac{\color{blue}{c \cdot a}}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a} \]
      3. *-commutative49.7%

        \[\leadsto \frac{\color{blue}{a \cdot c}}{\left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right) \cdot a} \]
      4. *-commutative49.7%

        \[\leadsto \frac{a \cdot c}{\color{blue}{a \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2\right)}} \]
      5. times-frac64.0%

        \[\leadsto \color{blue}{\frac{a}{a} \cdot \frac{c}{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right) - b_2}} \]
    12. Simplified64.0%

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

      \[\leadsto \frac{a}{a} \cdot \frac{c}{\color{blue}{-2 \cdot b_2 + -0.5 \cdot \frac{c \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot a\right)}{b_2}}} \]
    14. Step-by-step derivation
      1. *-commutative0.0%

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

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\frac{-0.5 \cdot \left(c \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot a\right)\right)}{b_2}}\right)} \]
      4. associate-*r*0.0%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{-0.5 \cdot \color{blue}{\left(\left(c \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot a\right)}}{b_2}\right)} \]
      5. associate-*r*0.0%

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(-0.5 \cdot \left(c \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right)\right) \cdot a}{b_2}\right)} \]
      7. rem-square-sqrt88.4%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(-0.5 \cdot \left(c \cdot \color{blue}{-1}\right)\right) \cdot a}{b_2}\right)} \]
      8. associate-*l*88.4%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\color{blue}{\left(\left(-0.5 \cdot c\right) \cdot -1\right)} \cdot a}{b_2}\right)} \]
      9. *-commutative88.4%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(\color{blue}{\left(c \cdot -0.5\right)} \cdot -1\right) \cdot a}{b_2}\right)} \]
      10. associate-*l*88.4%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\color{blue}{\left(c \cdot \left(-0.5 \cdot -1\right)\right)} \cdot a}{b_2}\right)} \]
      11. metadata-eval88.4%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\left(c \cdot \color{blue}{0.5}\right) \cdot a}{b_2}\right)} \]
      12. associate-/l*90.3%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\frac{c \cdot 0.5}{\frac{b_2}{a}}}\right)} \]
      13. *-rgt-identity90.3%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \frac{\color{blue}{\left(c \cdot 0.5\right) \cdot 1}}{\frac{b_2}{a}}\right)} \]
      14. associate-*r/90.3%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{\left(c \cdot 0.5\right) \cdot \frac{1}{\frac{b_2}{a}}}\right)} \]
      15. associate-*l*90.3%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, \color{blue}{c \cdot \left(0.5 \cdot \frac{1}{\frac{b_2}{a}}\right)}\right)} \]
      16. associate-/r/90.3%

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

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot \frac{1}{b_2}\right)}\right)\right)} \]
      18. associate-*r/90.3%

        \[\leadsto \frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \color{blue}{\frac{a \cdot 1}{b_2}}\right)\right)} \]
      19. *-rgt-identity90.3%

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

      \[\leadsto \frac{a}{a} \cdot \frac{c}{\color{blue}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}} \]

    if -9.8000000000000001e-79 < b_2 < 7.6999999999999996e127

    1. Initial program 83.0%

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

    if 7.6999999999999996e127 < b_2

    1. Initial program 45.5%

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

      \[\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 simplification88.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -9.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{a}{a} \cdot \frac{c}{\mathsf{fma}\left(b_2, -2, c \cdot \left(0.5 \cdot \frac{a}{b_2}\right)\right)}\\ \mathbf{elif}\;b_2 \leq 7.7 \cdot 10^{+127}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]

Alternative 3: 86.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{elif}\;b_2 \leq 7 \cdot 10^{+127}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 -4.5e-83)
   (/ (* c -0.5) b_2)
   (if (<= b_2 7e+127)
     (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) 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 <= -4.5e-83) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 7e+127) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / 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 <= (-4.5d-83)) then
        tmp = (c * (-0.5d0)) / b_2
    else if (b_2 <= 7d+127) then
        tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / 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 <= -4.5e-83) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 7e+127) {
		tmp = (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / 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 <= -4.5e-83:
		tmp = (c * -0.5) / b_2
	elif b_2 <= 7e+127:
		tmp = (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / 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 <= -4.5e-83)
		tmp = Float64(Float64(c * -0.5) / b_2);
	elseif (b_2 <= 7e+127)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / 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 <= -4.5e-83)
		tmp = (c * -0.5) / b_2;
	elseif (b_2 <= 7e+127)
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / 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, -4.5e-83], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 7e+127], 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[(-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 -4.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{c \cdot -0.5}{b_2}\\

\mathbf{elif}\;b_2 \leq 7 \cdot 10^{+127}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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 < -4.49999999999999997e-83

    1. Initial program 16.2%

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

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

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

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

    if -4.49999999999999997e-83 < b_2 < 6.99999999999999956e127

    1. Initial program 83.0%

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

    if 6.99999999999999956e127 < b_2

    1. Initial program 45.5%

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

      \[\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 simplification88.3%

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

Alternative 4: 81.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{-57}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{a \cdot \left(-c\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 -4.2e-79)
   (/ (* c -0.5) b_2)
   (if (<= b_2 7.5e-57)
     (/ (- (- b_2) (sqrt (* a (- c)))) 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 <= -4.2e-79) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 7.5e-57) {
		tmp = (-b_2 - sqrt((a * -c))) / 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 <= (-4.2d-79)) then
        tmp = (c * (-0.5d0)) / b_2
    else if (b_2 <= 7.5d-57) then
        tmp = (-b_2 - sqrt((a * -c))) / 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 <= -4.2e-79) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 7.5e-57) {
		tmp = (-b_2 - Math.sqrt((a * -c))) / 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 <= -4.2e-79:
		tmp = (c * -0.5) / b_2
	elif b_2 <= 7.5e-57:
		tmp = (-b_2 - math.sqrt((a * -c))) / 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 <= -4.2e-79)
		tmp = Float64(Float64(c * -0.5) / b_2);
	elseif (b_2 <= 7.5e-57)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(a * Float64(-c)))) / 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 <= -4.2e-79)
		tmp = (c * -0.5) / b_2;
	elseif (b_2 <= 7.5e-57)
		tmp = (-b_2 - sqrt((a * -c))) / 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, -4.2e-79], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 7.5e-57], N[(N[((-b$95$2) - N[Sqrt[N[(a * (-c)), $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 -4.2 \cdot 10^{-79}:\\
\;\;\;\;\frac{c \cdot -0.5}{b_2}\\

\mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{a \cdot \left(-c\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 < -4.1999999999999999e-79

    1. Initial program 16.2%

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

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

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

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

    if -4.1999999999999999e-79 < b_2 < 7.49999999999999973e-57

    1. Initial program 76.4%

      \[\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 7.49999999999999973e-57 < b_2

    1. Initial program 69.1%

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

      \[\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 simplification85.5%

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

Alternative 5: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4 \cdot 10^{-80}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{elif}\;b_2 \leq 8 \cdot 10^{-142}:\\ \;\;\;\;\frac{-\sqrt{a \cdot \left(-c\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 -4e-80)
   (/ (* c -0.5) b_2)
   (if (<= b_2 8e-142)
     (/ (- (sqrt (* a (- c)))) 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 <= -4e-80) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 8e-142) {
		tmp = -sqrt((a * -c)) / 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 <= (-4d-80)) then
        tmp = (c * (-0.5d0)) / b_2
    else if (b_2 <= 8d-142) then
        tmp = -sqrt((a * -c)) / 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 <= -4e-80) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 8e-142) {
		tmp = -Math.sqrt((a * -c)) / 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 <= -4e-80:
		tmp = (c * -0.5) / b_2
	elif b_2 <= 8e-142:
		tmp = -math.sqrt((a * -c)) / 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 <= -4e-80)
		tmp = Float64(Float64(c * -0.5) / b_2);
	elseif (b_2 <= 8e-142)
		tmp = Float64(Float64(-sqrt(Float64(a * Float64(-c)))) / 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 <= -4e-80)
		tmp = (c * -0.5) / b_2;
	elseif (b_2 <= 8e-142)
		tmp = -sqrt((a * -c)) / 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, -4e-80], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 8e-142], N[((-N[Sqrt[N[(a * (-c)), $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 -4 \cdot 10^{-80}:\\
\;\;\;\;\frac{c \cdot -0.5}{b_2}\\

\mathbf{elif}\;b_2 \leq 8 \cdot 10^{-142}:\\
\;\;\;\;\frac{-\sqrt{a \cdot \left(-c\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.99999999999999985e-80

    1. Initial program 16.2%

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

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

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

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

    if -3.99999999999999985e-80 < b_2 < 8.0000000000000003e-142

    1. Initial program 76.1%

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

        \[\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. *-commutative75.7%

        \[\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-neg75.7%

        \[\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-diff75.7%

        \[\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. *-commutative75.7%

        \[\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-neg75.7%

        \[\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+75.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. *-commutative75.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-udef75.7%

        \[\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-in75.7%

        \[\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. *-commutative75.7%

        \[\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-in75.7%

        \[\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-def75.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. *-commutative75.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-udef75.7%

        \[\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-in75.7%

        \[\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. *-commutative75.7%

        \[\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-in75.7%

        \[\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-def75.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-rr75.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. *-commutative75.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-275.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. *-commutative75.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. Simplified75.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. Taylor expanded in b_2 around 0 74.3%

      \[\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-neg74.3%

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

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

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

        \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{0} - c \cdot a}}{a} \]
      5. metadata-eval74.7%

        \[\leadsto \frac{-\sqrt{\color{blue}{0} - c \cdot a}}{a} \]
      6. neg-sub074.7%

        \[\leadsto \frac{-\sqrt{\color{blue}{-c \cdot a}}}{a} \]
      7. distribute-rgt-neg-out74.7%

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

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

    if 8.0000000000000003e-142 < b_2

    1. Initial program 69.7%

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

      \[\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 simplification85.0%

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

Alternative 6: 67.8% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c \cdot -0.5}{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 -5e-310)
   (/ (* c -0.5) 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 <= -5e-310) {
		tmp = (c * -0.5) / 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 <= (-5d-310)) then
        tmp = (c * (-0.5d0)) / 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 <= -5e-310) {
		tmp = (c * -0.5) / 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 <= -5e-310:
		tmp = (c * -0.5) / 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 <= -5e-310)
		tmp = Float64(Float64(c * -0.5) / 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 <= -5e-310)
		tmp = (c * -0.5) / 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, -5e-310], N[(N[(c * -0.5), $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 -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c \cdot -0.5}{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 < -4.999999999999985e-310

    1. Initial program 31.5%

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

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

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

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 71.3%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around inf 68.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 simplification68.9%

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

Alternative 7: 47.0% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -3.5 \cdot 10^{-302}:\\ \;\;\;\;c \cdot \frac{-0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b_2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -3.5e-302) (* c (/ -0.5 b_2)) (/ (- b_2) a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -3.5e-302) {
		tmp = c * (-0.5 / b_2);
	} else {
		tmp = -b_2 / 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 <= (-3.5d-302)) then
        tmp = c * ((-0.5d0) / b_2)
    else
        tmp = -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 <= -3.5e-302) {
		tmp = c * (-0.5 / b_2);
	} else {
		tmp = -b_2 / a;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -3.5e-302:
		tmp = c * (-0.5 / b_2)
	else:
		tmp = -b_2 / a
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -3.5e-302)
		tmp = Float64(c * Float64(-0.5 / b_2));
	else
		tmp = Float64(Float64(-b_2) / a);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -3.5e-302)
		tmp = c * (-0.5 / b_2);
	else
		tmp = -b_2 / a;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -3.5e-302], N[(c * N[(-0.5 / b$95$2), $MachinePrecision]), $MachinePrecision], N[((-b$95$2) / a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -3.5 \cdot 10^{-302}:\\
\;\;\;\;c \cdot \frac{-0.5}{b_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -3.5000000000000001e-302

    1. Initial program 31.0%

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

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

        \[\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-rr40.3%

      \[\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-sqrt70.3%

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

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

        \[\leadsto \frac{\color{blue}{-0.5} \cdot c}{b_2} \]
      7. *-commutative70.3%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b_2} \]
      8. *-rgt-identity70.3%

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

        \[\leadsto \color{blue}{\left(c \cdot -0.5\right) \cdot \frac{1}{b_2}} \]
      10. associate-*l*70.1%

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

        \[\leadsto c \cdot \color{blue}{\frac{-0.5 \cdot 1}{b_2}} \]
      12. metadata-eval70.1%

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

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

    if -3.5000000000000001e-302 < b_2

    1. Initial program 71.5%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around 0 41.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-neg41.1%

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

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

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{c \cdot \left(-a\right)}}}{a} \]
    5. Taylor expanded in b_2 around inf 24.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{b_2}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg24.0%

        \[\leadsto \color{blue}{-\frac{b_2}{a}} \]
      2. distribute-frac-neg24.0%

        \[\leadsto \color{blue}{\frac{-b_2}{a}} \]
    7. Simplified24.0%

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

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

Alternative 8: 47.0% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -7 \cdot 10^{-303}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b_2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -7e-303) (/ (* c -0.5) b_2) (/ (- b_2) a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -7e-303) {
		tmp = (c * -0.5) / b_2;
	} else {
		tmp = -b_2 / 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 <= (-7d-303)) then
        tmp = (c * (-0.5d0)) / b_2
    else
        tmp = -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 <= -7e-303) {
		tmp = (c * -0.5) / b_2;
	} else {
		tmp = -b_2 / a;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -7e-303:
		tmp = (c * -0.5) / b_2
	else:
		tmp = -b_2 / a
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -7e-303)
		tmp = Float64(Float64(c * -0.5) / b_2);
	else
		tmp = Float64(Float64(-b_2) / a);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -7e-303)
		tmp = (c * -0.5) / b_2;
	else
		tmp = -b_2 / a;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -7e-303], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision], N[((-b$95$2) / a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -7 \cdot 10^{-303}:\\
\;\;\;\;\frac{c \cdot -0.5}{b_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -7e-303

    1. Initial program 31.0%

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

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

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

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

    if -7e-303 < b_2

    1. Initial program 71.5%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around 0 41.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-neg41.1%

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

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

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{c \cdot \left(-a\right)}}}{a} \]
    5. Taylor expanded in b_2 around inf 24.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{b_2}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg24.0%

        \[\leadsto \color{blue}{-\frac{b_2}{a}} \]
      2. distribute-frac-neg24.0%

        \[\leadsto \color{blue}{\frac{-b_2}{a}} \]
    7. Simplified24.0%

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

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

Alternative 9: 67.6% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -7 \cdot 10^{-303}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -7e-303) (/ (* c -0.5) b_2) (/ (* b_2 -2.0) a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -7e-303) {
		tmp = (c * -0.5) / 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 <= (-7d-303)) then
        tmp = (c * (-0.5d0)) / 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 <= -7e-303) {
		tmp = (c * -0.5) / b_2;
	} else {
		tmp = (b_2 * -2.0) / a;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -7e-303:
		tmp = (c * -0.5) / b_2
	else:
		tmp = (b_2 * -2.0) / a
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -7e-303)
		tmp = Float64(Float64(c * -0.5) / 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 <= -7e-303)
		tmp = (c * -0.5) / 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, -7e-303], N[(N[(c * -0.5), $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 -7 \cdot 10^{-303}:\\
\;\;\;\;\frac{c \cdot -0.5}{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 < -7e-303

    1. Initial program 31.0%

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

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

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

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

    if -7e-303 < b_2

    1. Initial program 71.5%

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

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

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

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

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

Alternative 10: 15.4% accurate, 28.0× speedup?

\[\begin{array}{l} \\ \frac{-b_2}{a} \end{array} \]
(FPCore (a b_2 c) :precision binary64 (/ (- b_2) a))
double code(double a, double b_2, double c) {
	return -b_2 / 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 / a
end function
public static double code(double a, double b_2, double c) {
	return -b_2 / a;
}
def code(a, b_2, c):
	return -b_2 / a
function code(a, b_2, c)
	return Float64(Float64(-b_2) / a)
end
function tmp = code(a, b_2, c)
	tmp = -b_2 / a;
end
code[a_, b$95$2_, c_] := N[((-b$95$2) / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{-b_2}{a}
\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 0 32.9%

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

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

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

    \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{c \cdot \left(-a\right)}}}{a} \]
  5. Taylor expanded in b_2 around inf 12.9%

    \[\leadsto \color{blue}{-1 \cdot \frac{b_2}{a}} \]
  6. Step-by-step derivation
    1. mul-1-neg12.9%

      \[\leadsto \color{blue}{-\frac{b_2}{a}} \]
    2. distribute-frac-neg12.9%

      \[\leadsto \color{blue}{\frac{-b_2}{a}} \]
  7. Simplified12.9%

    \[\leadsto \color{blue}{\frac{-b_2}{a}} \]
  8. Final simplification12.9%

    \[\leadsto \frac{-b_2}{a} \]

Reproduce

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