quad2m (problem 3.2.1, negative)

Percentage Accurate: 51.9% → 86.5%
Time: 9.2s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 51.9% 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: 86.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\ \mathbf{if}\;b_2 \leq -1.9 \cdot 10^{+69}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq -1.1 \cdot 10^{-105}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b_2, t_0\right)}}{a}\\ \mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{+118}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_0}{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
 (let* ((t_0 (sqrt (- (* b_2 b_2) (* a c)))))
   (if (<= b_2 -1.9e+69)
     (/ 1.0 (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))))
     (if (<= b_2 -1.1e-105)
       (/ (/ (* a c) (fma -1.0 b_2 t_0)) a)
       (if (<= b_2 7.5e+118)
         (/ (- (- b_2) t_0) a)
         (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2))))))))
double code(double a, double b_2, double c) {
	double t_0 = sqrt(((b_2 * b_2) - (a * c)));
	double tmp;
	if (b_2 <= -1.9e+69) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= -1.1e-105) {
		tmp = ((a * c) / fma(-1.0, b_2, t_0)) / a;
	} else if (b_2 <= 7.5e+118) {
		tmp = (-b_2 - t_0) / a;
	} else {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	}
	return tmp;
}
function code(a, b_2, c)
	t_0 = sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))
	tmp = 0.0
	if (b_2 <= -1.9e+69)
		tmp = Float64(1.0 / Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))));
	elseif (b_2 <= -1.1e-105)
		tmp = Float64(Float64(Float64(a * c) / fma(-1.0, b_2, t_0)) / a);
	elseif (b_2 <= 7.5e+118)
		tmp = Float64(Float64(Float64(-b_2) - t_0) / 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_] := Block[{t$95$0 = N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$2, -1.9e+69], N[(1.0 / N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, -1.1e-105], N[(N[(N[(a * c), $MachinePrecision] / N[(-1.0 * b$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 7.5e+118], N[(N[((-b$95$2) - t$95$0), $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}
t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\
\mathbf{if}\;b_2 \leq -1.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\

\mathbf{elif}\;b_2 \leq -1.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b_2, t_0\right)}}{a}\\

\mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{+118}:\\
\;\;\;\;\frac{\left(-b_2\right) - t_0}{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 < -1.90000000000000014e69

    1. Initial program 12.5%

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

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

        \[\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-udef12.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-in12.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. *-commutative12.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-in12.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-def12.3%

        \[\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. *-commutative12.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) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
      15. fma-udef12.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-in12.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. *-commutative12.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-in12.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-def12.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}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
    3. Applied egg-rr12.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\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)}}}} \]
      2. inv-pow12.3%

        \[\leadsto \color{blue}{{\left(\frac{a}{\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)}}\right)}^{-1}} \]
      3. +-commutative12.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{0} \cdot \left(a \cdot c\right)\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      10. mul0-lft12.5%

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\color{blue}{0} \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      11. metadata-eval12.5%

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

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

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}} \]

    if -1.90000000000000014e69 < b_2 < -1.10000000000000002e-105

    1. Initial program 44.5%

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

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

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

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

        \[\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-neg44.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+44.3%

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

        \[\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-udef44.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-in44.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. *-commutative44.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-in44.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-def44.3%

        \[\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. *-commutative44.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) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
      15. fma-udef44.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-in44.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. *-commutative44.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-in44.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-def44.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}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
    3. Applied egg-rr44.3%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{{\left(-b_2\right)}^{2}} - \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} \]
      3. add-sqr-sqrt44.5%

        \[\leadsto \frac{\frac{{\left(-b_2\right)}^{2} - \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} \]
      4. +-commutative44.5%

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

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

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

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

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

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

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

    if -1.10000000000000002e-105 < b_2 < 7.50000000000000003e118

    1. Initial program 82.4%

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

    if 7.50000000000000003e118 < b_2

    1. Initial program 50.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.9 \cdot 10^{+69}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq -1.1 \cdot 10^{-105}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b_2, \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\\ \mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{+118}:\\ \;\;\;\;\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: 85.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -1.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 2.15 \cdot 10^{+120}:\\ \;\;\;\;\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 -1.5e-62)
   (/ 1.0 (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))))
   (if (<= b_2 2.15e+120)
     (/ (- (- 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 <= -1.5e-62) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 2.15e+120) {
		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 <= (-1.5d-62)) then
        tmp = 1.0d0 / ((0.5d0 * (a / b_2)) + ((-2.0d0) * (b_2 / c)))
    else if (b_2 <= 2.15d+120) 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 <= -1.5e-62) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 2.15e+120) {
		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 <= -1.5e-62:
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)))
	elif b_2 <= 2.15e+120:
		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 <= -1.5e-62)
		tmp = Float64(1.0 / Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))));
	elseif (b_2 <= 2.15e+120)
		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 <= -1.5e-62)
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	elseif (b_2 <= 2.15e+120)
		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, -1.5e-62], N[(1.0 / N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 2.15e+120], 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 -1.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\

\mathbf{elif}\;b_2 \leq 2.15 \cdot 10^{+120}:\\
\;\;\;\;\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 < -1.5000000000000001e-62

    1. Initial program 21.2%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff21.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. *-commutative21.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-neg21.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-diff21.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. *-commutative21.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-neg21.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+21.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. *-commutative21.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-udef21.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-in21.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. *-commutative21.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-in21.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-def21.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. *-commutative21.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-udef21.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-in21.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. *-commutative21.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-in21.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-def21.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-rr21.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. *-commutative21.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-221.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. *-commutative21.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. Simplified21.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. clear-num21.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\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)}}}} \]
      2. inv-pow21.1%

        \[\leadsto \color{blue}{{\left(\frac{a}{\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)}}\right)}^{-1}} \]
      3. +-commutative21.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{-1 \cdot \left(c \cdot a\right)} + a \cdot c\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      7. *-commutative21.0%

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{0} \cdot \left(a \cdot c\right)\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      10. mul0-lft21.2%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}} \]

    if -1.5000000000000001e-62 < b_2 < 2.1500000000000001e120

    1. Initial program 80.2%

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

    if 2.1500000000000001e120 < b_2

    1. Initial program 50.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.5 \cdot 10^{-62}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 2.15 \cdot 10^{+120}:\\ \;\;\;\;\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: 80.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -7.5 \cdot 10^{-67}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 3.2 \cdot 10^{-42}:\\ \;\;\;\;\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 -7.5e-67)
   (/ 1.0 (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))))
   (if (<= b_2 3.2e-42)
     (/ (- (- 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 <= -7.5e-67) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 3.2e-42) {
		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 <= (-7.5d-67)) then
        tmp = 1.0d0 / ((0.5d0 * (a / b_2)) + ((-2.0d0) * (b_2 / c)))
    else if (b_2 <= 3.2d-42) 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 <= -7.5e-67) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 3.2e-42) {
		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 <= -7.5e-67:
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)))
	elif b_2 <= 3.2e-42:
		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 <= -7.5e-67)
		tmp = Float64(1.0 / Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))));
	elseif (b_2 <= 3.2e-42)
		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 <= -7.5e-67)
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	elseif (b_2 <= 3.2e-42)
		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, -7.5e-67], N[(1.0 / N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 3.2e-42], 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 -7.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\

\mathbf{elif}\;b_2 \leq 3.2 \cdot 10^{-42}:\\
\;\;\;\;\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 < -7.5000000000000005e-67

    1. Initial program 22.4%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff22.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. *-commutative22.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-neg22.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-diff22.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. *-commutative22.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-neg22.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+22.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. *-commutative22.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-udef22.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-in22.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. *-commutative22.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-in22.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-def22.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. *-commutative22.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-udef22.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-in22.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. *-commutative22.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-in22.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-def22.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-rr22.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. *-commutative22.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-222.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. *-commutative22.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. Simplified22.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. clear-num22.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\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)}}}} \]
      2. inv-pow22.2%

        \[\leadsto \color{blue}{{\left(\frac{a}{\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)}}\right)}^{-1}} \]
      3. +-commutative22.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{0} \cdot \left(a \cdot c\right)\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      10. mul0-lft22.3%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}} \]

    if -7.5000000000000005e-67 < b_2 < 3.20000000000000025e-42

    1. Initial program 74.3%

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

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

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

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

    if 3.20000000000000025e-42 < b_2

    1. Initial program 70.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -7.5 \cdot 10^{-67}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 3.2 \cdot 10^{-42}:\\ \;\;\;\;\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 4: 80.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 5.5 \cdot 10^{-42}:\\ \;\;\;\;\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 -4.6e-69)
   (/ 1.0 (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))))
   (if (<= b_2 5.5e-42)
     (/ (- (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.6e-69) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 5.5e-42) {
		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 <= (-4.6d-69)) then
        tmp = 1.0d0 / ((0.5d0 * (a / b_2)) + ((-2.0d0) * (b_2 / c)))
    else if (b_2 <= 5.5d-42) 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 <= -4.6e-69) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} else if (b_2 <= 5.5e-42) {
		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 <= -4.6e-69:
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)))
	elif b_2 <= 5.5e-42:
		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 <= -4.6e-69)
		tmp = Float64(1.0 / Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))));
	elseif (b_2 <= 5.5e-42)
		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 <= -4.6e-69)
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	elseif (b_2 <= 5.5e-42)
		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, -4.6e-69], N[(1.0 / N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 5.5e-42], 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.6 \cdot 10^{-69}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\

\mathbf{elif}\;b_2 \leq 5.5 \cdot 10^{-42}:\\
\;\;\;\;\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 < -4.6000000000000001e-69

    1. Initial program 22.4%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. prod-diff22.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. *-commutative22.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-neg22.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-diff22.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. *-commutative22.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-neg22.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+22.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. *-commutative22.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-udef22.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-in22.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. *-commutative22.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-in22.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-def22.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. *-commutative22.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-udef22.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-in22.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. *-commutative22.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-in22.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-def22.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-rr22.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. *-commutative22.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-222.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. *-commutative22.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. Simplified22.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. clear-num22.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\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)}}}} \]
      2. inv-pow22.2%

        \[\leadsto \color{blue}{{\left(\frac{a}{\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)}}\right)}^{-1}} \]
      3. +-commutative22.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{0} \cdot \left(a \cdot c\right)\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      10. mul0-lft22.3%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}} \]

    if -4.6000000000000001e-69 < b_2 < 5.5e-42

    1. Initial program 74.3%

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

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

        \[\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-udef73.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-in73.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. *-commutative73.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-in73.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-def73.7%

        \[\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. *-commutative73.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) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
      15. fma-udef73.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-in73.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. *-commutative73.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-in73.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-def73.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}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
    3. Applied egg-rr73.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\sqrt{\color{blue}{0} - c \cdot a}}{a} \]
      7. *-commutative62.5%

        \[\leadsto \frac{-\sqrt{0 - \color{blue}{a \cdot c}}}{a} \]
      8. neg-sub062.5%

        \[\leadsto \frac{-\sqrt{\color{blue}{-a \cdot c}}}{a} \]
      9. distribute-rgt-neg-out62.5%

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

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

    if 5.5e-42 < b_2

    1. Initial program 70.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -4.6 \cdot 10^{-69}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \mathbf{elif}\;b_2 \leq 5.5 \cdot 10^{-42}:\\ \;\;\;\;\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 5: 67.6% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\ \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-310)
   (/ 1.0 (+ (* 0.5 (/ a b_2)) (* -2.0 (/ b_2 c))))
   (+ (* -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-310) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} 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-310)) then
        tmp = 1.0d0 / ((0.5d0 * (a / b_2)) + ((-2.0d0) * (b_2 / c)))
    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-310) {
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	} 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-310:
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)))
	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-310)
		tmp = Float64(1.0 / Float64(Float64(0.5 * Float64(a / b_2)) + Float64(-2.0 * Float64(b_2 / c))));
	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-310)
		tmp = 1.0 / ((0.5 * (a / b_2)) + (-2.0 * (b_2 / c)));
	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-310], N[(1.0 / N[(N[(0.5 * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b$95$2 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{-310}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}\\

\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 < -3.999999999999988e-310

    1. Initial program 33.9%

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

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

        \[\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.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-in33.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. *-commutative33.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-in33.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-def33.7%

        \[\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.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) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a} \]
      15. fma-udef33.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-in33.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. *-commutative33.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-in33.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-def33.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}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a} \]
    3. Applied egg-rr33.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\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)}}}} \]
      2. inv-pow33.7%

        \[\leadsto \color{blue}{{\left(\frac{a}{\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)}}\right)}^{-1}} \]
      3. +-commutative33.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{\left(\color{blue}{0} \cdot \left(a \cdot c\right)\right) \cdot 2 + \left(b_2 \cdot b_2 - a \cdot c\right)}}} \]
      10. mul0-lft33.9%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b_2} + -2 \cdot \frac{b_2}{c}}} \]

    if -3.999999999999988e-310 < b_2

    1. Initial program 73.0%

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

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

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

Alternative 6: 67.9% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4 \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 -4e-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 <= -4e-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 <= (-4d-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 <= -4e-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 <= -4e-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 <= -4e-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 <= -4e-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, -4e-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 -4 \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 < -3.999999999999988e-310

    1. Initial program 33.9%

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

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

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 73.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -4 \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.7% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\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 -4e-310) (/ (* c -0.5) b_2) (/ (- b_2) a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -4e-310) {
		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 <= (-4d-310)) 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 <= -4e-310) {
		tmp = (c * -0.5) / b_2;
	} else {
		tmp = -b_2 / a;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -4e-310:
		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 <= -4e-310)
		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 <= -4e-310)
		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, -4e-310], 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 -4 \cdot 10^{-310}:\\
\;\;\;\;\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 < -3.999999999999988e-310

    1. Initial program 33.9%

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

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

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 73.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot b_2}{a}} \]
      2. mul-1-neg26.0%

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

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

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

Alternative 8: 67.7% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -3 \cdot 10^{-309}:\\ \;\;\;\;\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 -3e-309) (/ (* c -0.5) b_2) (/ (* b_2 -2.0) a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -3e-309) {
		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 <= (-3d-309)) 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 <= -3e-309) {
		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 <= -3e-309:
		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 <= -3e-309)
		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 <= -3e-309)
		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, -3e-309], 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 -3 \cdot 10^{-309}:\\
\;\;\;\;\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 < -3.000000000000001e-309

    1. Initial program 33.9%

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

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

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

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

    if -3.000000000000001e-309 < b_2

    1. Initial program 73.0%

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

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

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

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

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

Alternative 9: 15.3% 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 55.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot b_2}{a}} \]
    2. mul-1-neg15.3%

      \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
  7. Simplified15.3%

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

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

Reproduce

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