quad2m (problem 3.2.1, negative)

Percentage Accurate: 52.1% → 85.0%
Time: 14.7s
Alternatives: 9
Speedup: 11.2×

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: 52.1% accurate, 1.0× speedup?

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

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

Alternative 1: 85.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -6.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\ \mathbf{elif}\;b\_2 \leq -5.1 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a}\\ \mathbf{elif}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{c \cdot -0.5}{b\_2}\\ \mathbf{elif}\;b\_2 \leq 5.6 \cdot 10^{+81}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -6.8e-62)
   (/ 1.0 (fma 0.5 (/ a b_2) (/ -2.0 (/ c b_2))))
   (if (<= b_2 -5.1e-124)
     (/ (/ (* a c) (fma -1.0 b_2 (hypot b_2 (sqrt (* a (- c)))))) a)
     (if (<= b_2 -7e-135)
       (/ (* c -0.5) b_2)
       (if (<= b_2 5.6e+81)
         (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
         (* -2.0 (/ b_2 a)))))))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -6.8e-62) {
		tmp = 1.0 / fma(0.5, (a / b_2), (-2.0 / (c / b_2)));
	} else if (b_2 <= -5.1e-124) {
		tmp = ((a * c) / fma(-1.0, b_2, hypot(b_2, sqrt((a * -c))))) / a;
	} else if (b_2 <= -7e-135) {
		tmp = (c * -0.5) / b_2;
	} else if (b_2 <= 5.6e+81) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
	} else {
		tmp = -2.0 * (b_2 / a);
	}
	return tmp;
}
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -6.8e-62)
		tmp = Float64(1.0 / fma(0.5, Float64(a / b_2), Float64(-2.0 / Float64(c / b_2))));
	elseif (b_2 <= -5.1e-124)
		tmp = Float64(Float64(Float64(a * c) / fma(-1.0, b_2, hypot(b_2, sqrt(Float64(a * Float64(-c)))))) / a);
	elseif (b_2 <= -7e-135)
		tmp = Float64(Float64(c * -0.5) / b_2);
	elseif (b_2 <= 5.6e+81)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	else
		tmp = Float64(-2.0 * Float64(b_2 / a));
	end
	return tmp
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -6.8e-62], N[(1.0 / N[(0.5 * N[(a / b$95$2), $MachinePrecision] + N[(-2.0 / N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, -5.1e-124], N[(N[(N[(a * c), $MachinePrecision] / N[(-1.0 * b$95$2 + N[Sqrt[b$95$2 ^ 2 + N[Sqrt[N[(a * (-c)), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -7e-135], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 5.6e+81], 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[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -6.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\

\mathbf{elif}\;b\_2 \leq -5.1 \cdot 10^{-124}:\\
\;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a}\\

\mathbf{elif}\;b\_2 \leq -7 \cdot 10^{-135}:\\
\;\;\;\;\frac{c \cdot -0.5}{b\_2}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b_2 < -6.79999999999999975e-62

    1. Initial program 14.4%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.3%

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

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left(\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}\right)}^{2}}}{a} \]
      3. pow1/212.3%

        \[\leadsto \frac{\left(-b\_2\right) - {\left(\sqrt{\color{blue}{{\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]
      4. sqrt-pow112.2%

        \[\leadsto \frac{\left(-b\_2\right) - {\color{blue}{\left({\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]
      5. pow212.2%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left(\color{blue}{{b\_2}^{2}} - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a} \]
      6. metadata-eval12.2%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    4. Applied egg-rr12.2%

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    5. Step-by-step derivation
      1. clear-num12.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}} \]
      2. inv-pow12.2%

        \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}\right)}^{-1}} \]
      3. pow-pow14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}}}\right)}^{-1} \]
      4. metadata-eval14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}}}\right)}^{-1} \]
      5. pow1/214.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}}}\right)}^{-1} \]
      6. sub-neg14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{{b\_2}^{2} + \left(-a \cdot c\right)}}}\right)}^{-1} \]
      7. unpow214.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{b\_2 \cdot b\_2} + \left(-a \cdot c\right)}}\right)}^{-1} \]
      8. distribute-rgt-neg-out14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{a \cdot \left(-c\right)}}}\right)}^{-1} \]
      9. add-sqr-sqrt10.6%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{\sqrt{a \cdot \left(-c\right)} \cdot \sqrt{a \cdot \left(-c\right)}}}}\right)}^{-1} \]
      10. hypot-undefine16.1%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}\right)}^{-1} \]
    6. Applied egg-rr16.1%

      \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-116.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}} \]
      2. distribute-rgt-neg-out16.1%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{-a \cdot c}}\right)}} \]
      3. distribute-lft-neg-in16.1%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{\left(-a\right) \cdot c}}\right)}} \]
    8. Simplified16.1%

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b\_2} + 2 \cdot \frac{b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}} \]
    10. Step-by-step derivation
      1. fma-define0.0%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2 \cdot b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}\right)} \]
      3. *-commutative0.0%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{2 \cdot b\_2}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt90.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{2 \cdot b\_2}{\color{blue}{-1} \cdot c}\right)} \]
      6. times-frac90.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2}{-1} \cdot \frac{b\_2}{c}}\right)} \]
      7. metadata-eval90.3%

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \frac{b\_2}{c}\right)}} \]
    12. Step-by-step derivation
      1. clear-num90.4%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \color{blue}{\frac{1}{\frac{c}{b\_2}}}\right)} \]
      2. un-div-inv90.4%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{-2}{\frac{c}{b\_2}}}\right)} \]
    13. Applied egg-rr90.4%

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

    if -6.79999999999999975e-62 < b_2 < -5.1000000000000001e-124

    1. Initial program 67.4%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt67.5%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}} \cdot \sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
      2. pow267.5%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left(\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}\right)}^{2}}}{a} \]
      3. pow1/267.5%

        \[\leadsto \frac{\left(-b\_2\right) - {\left(\sqrt{\color{blue}{{\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]
      4. sqrt-pow167.5%

        \[\leadsto \frac{\left(-b\_2\right) - {\color{blue}{\left({\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]
      5. pow267.5%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left(\color{blue}{{b\_2}^{2}} - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a} \]
      6. metadata-eval67.5%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    4. Applied egg-rr67.5%

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    5. Step-by-step derivation
      1. flip--67.3%

        \[\leadsto \frac{\color{blue}{\frac{\left(-b\_2\right) \cdot \left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2} \cdot {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}}{a} \]
      2. pow267.3%

        \[\leadsto \frac{\frac{\color{blue}{{\left(-b\_2\right)}^{2}} - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2} \cdot {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      3. pow-pow67.5%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}} \cdot {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      4. metadata-eval67.5%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}} \cdot {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      5. pow-pow66.9%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - {\left({b\_2}^{2} - a \cdot c\right)}^{0.5} \cdot \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      6. metadata-eval66.9%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - {\left({b\_2}^{2} - a \cdot c\right)}^{0.5} \cdot {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      7. pow1/266.9%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}} \cdot {\left({b\_2}^{2} - a \cdot c\right)}^{0.5}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      8. pow1/266.9%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \sqrt{{b\_2}^{2} - a \cdot c} \cdot \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      9. add-sqr-sqrt67.3%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \color{blue}{\left({b\_2}^{2} - a \cdot c\right)}}{\left(-b\_2\right) + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      10. neg-mul-167.3%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \left({b\_2}^{2} - a \cdot c\right)}{\color{blue}{-1 \cdot b\_2} + {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      11. fma-define67.3%

        \[\leadsto \frac{\frac{{\left(-b\_2\right)}^{2} - \left({b\_2}^{2} - a \cdot c\right)}{\color{blue}{\mathsf{fma}\left(-1, b\_2, {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}\right)}}}{a} \]
      12. pow-pow67.5%

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\_2\right)}^{2} - \left({b\_2}^{2} - a \cdot c\right)}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}}{a} \]
    7. Step-by-step derivation
      1. associate--r-99.8%

        \[\leadsto \frac{\frac{\color{blue}{\left({\left(-b\_2\right)}^{2} - {b\_2}^{2}\right) + a \cdot c}}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a} \]
      2. unpow299.8%

        \[\leadsto \frac{\frac{\left(\color{blue}{\left(-b\_2\right) \cdot \left(-b\_2\right)} - {b\_2}^{2}\right) + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a} \]
      3. sqr-neg99.8%

        \[\leadsto \frac{\frac{\left(\color{blue}{b\_2 \cdot b\_2} - {b\_2}^{2}\right) + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a} \]
      4. unpow299.8%

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

        \[\leadsto \frac{\frac{\color{blue}{0} + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a} \]
      6. distribute-rgt-neg-out99.8%

        \[\leadsto \frac{\frac{0 + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{-a \cdot c}}\right)\right)}}{a} \]
      7. *-commutative99.8%

        \[\leadsto \frac{\frac{0 + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{-\color{blue}{c \cdot a}}\right)\right)}}{a} \]
      8. distribute-rgt-neg-in99.8%

        \[\leadsto \frac{\frac{0 + a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{c \cdot \left(-a\right)}}\right)\right)}}{a} \]
    8. Simplified99.8%

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

    if -5.1000000000000001e-124 < b_2 < -6.9999999999999997e-135

    1. Initial program 3.9%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]
    4. Step-by-step derivation
      1. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b\_2}} \]
    5. Simplified100.0%

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

    if -6.9999999999999997e-135 < b_2 < 5.5999999999999999e81

    1. Initial program 80.3%

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

    if 5.5999999999999999e81 < b_2

    1. Initial program 59.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -6.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\ \mathbf{elif}\;b\_2 \leq -5.1 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{fma}\left(-1, b\_2, \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)\right)}}{a}\\ \mathbf{elif}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{c \cdot -0.5}{b\_2}\\ \mathbf{elif}\;b\_2 \leq 5.6 \cdot 10^{+81}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\ \mathbf{elif}\;b\_2 \leq 3.5 \cdot 10^{+89}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -7e-135)
   (/ 1.0 (fma 0.5 (/ a b_2) (/ -2.0 (/ c b_2))))
   (if (<= b_2 3.5e+89)
     (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
     (* -2.0 (/ b_2 a)))))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -7e-135) {
		tmp = 1.0 / fma(0.5, (a / b_2), (-2.0 / (c / b_2)));
	} else if (b_2 <= 3.5e+89) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
	} else {
		tmp = -2.0 * (b_2 / a);
	}
	return tmp;
}
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -7e-135)
		tmp = Float64(1.0 / fma(0.5, Float64(a / b_2), Float64(-2.0 / Float64(c / b_2))));
	elseif (b_2 <= 3.5e+89)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	else
		tmp = Float64(-2.0 * Float64(b_2 / a));
	end
	return tmp
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -7e-135], N[(1.0 / N[(0.5 * N[(a / b$95$2), $MachinePrecision] + N[(-2.0 / N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 3.5e+89], 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[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -6.9999999999999997e-135

    1. Initial program 17.9%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt15.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}} \cdot \sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
      2. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left(\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}\right)}^{2}}}{a} \]
      3. pow1/215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left(\sqrt{\color{blue}{{\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]
      4. sqrt-pow115.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\color{blue}{\left({\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]
      5. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left(\color{blue}{{b\_2}^{2}} - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a} \]
      6. metadata-eval15.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    4. Applied egg-rr15.9%

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    5. Step-by-step derivation
      1. clear-num15.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}} \]
      2. inv-pow15.9%

        \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}\right)}^{-1}} \]
      3. pow-pow17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}}}\right)}^{-1} \]
      4. metadata-eval17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}}}\right)}^{-1} \]
      5. pow1/217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}}}\right)}^{-1} \]
      6. sub-neg17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{{b\_2}^{2} + \left(-a \cdot c\right)}}}\right)}^{-1} \]
      7. unpow217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{b\_2 \cdot b\_2} + \left(-a \cdot c\right)}}\right)}^{-1} \]
      8. distribute-rgt-neg-out17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{a \cdot \left(-c\right)}}}\right)}^{-1} \]
      9. add-sqr-sqrt14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{\sqrt{a \cdot \left(-c\right)} \cdot \sqrt{a \cdot \left(-c\right)}}}}\right)}^{-1} \]
      10. hypot-undefine19.3%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}\right)}^{-1} \]
    6. Applied egg-rr19.3%

      \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}} \]
      2. distribute-rgt-neg-out19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{-a \cdot c}}\right)}} \]
      3. distribute-lft-neg-in19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{\left(-a\right) \cdot c}}\right)}} \]
    8. Simplified19.3%

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b\_2} + 2 \cdot \frac{b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}} \]
    10. Step-by-step derivation
      1. fma-define0.0%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2 \cdot b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}\right)} \]
      3. *-commutative0.0%

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{2 \cdot b\_2}{\color{blue}{-1} \cdot c}\right)} \]
      6. times-frac87.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2}{-1} \cdot \frac{b\_2}{c}}\right)} \]
      7. metadata-eval87.1%

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \frac{b\_2}{c}\right)}} \]
    12. Step-by-step derivation
      1. clear-num87.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \color{blue}{\frac{1}{\frac{c}{b\_2}}}\right)} \]
      2. un-div-inv87.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{-2}{\frac{c}{b\_2}}}\right)} \]
    13. Applied egg-rr87.2%

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

    if -6.9999999999999997e-135 < b_2 < 3.5000000000000001e89

    1. Initial program 80.3%

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

    if 3.5000000000000001e89 < b_2

    1. Initial program 59.0%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\ \mathbf{elif}\;b\_2 \leq 3.5 \cdot 10^{+89}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\
\;\;\;\;\frac{c \cdot -0.5}{b\_2}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -6.9999999999999997e-135

    1. Initial program 17.9%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]
    4. Step-by-step derivation
      1. *-commutative86.9%

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

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b\_2}} \]
    5. Simplified86.9%

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

    if -6.9999999999999997e-135 < b_2 < 2.6500000000000001e-20

    1. Initial program 78.4%

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

      \[\leadsto \frac{\left(-b\_2\right) - \sqrt{\color{blue}{-1 \cdot \left(a \cdot c\right)}}}{a} \]
    4. Step-by-step derivation
      1. mul-1-neg69.5%

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

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

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

    if 2.6500000000000001e-20 < b_2

    1. Initial program 64.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{c \cdot -0.5}{b\_2}\\ \mathbf{elif}\;b\_2 \leq 2.65 \cdot 10^{-20}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{a \cdot \left(-c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \frac{b\_2}{c}\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -6.9999999999999997e-135

    1. Initial program 17.9%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt15.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}} \cdot \sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
      2. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left(\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}\right)}^{2}}}{a} \]
      3. pow1/215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left(\sqrt{\color{blue}{{\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]
      4. sqrt-pow115.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\color{blue}{\left({\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]
      5. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left(\color{blue}{{b\_2}^{2}} - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a} \]
      6. metadata-eval15.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    4. Applied egg-rr15.9%

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    5. Step-by-step derivation
      1. clear-num15.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}} \]
      2. inv-pow15.9%

        \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}\right)}^{-1}} \]
      3. pow-pow17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}}}\right)}^{-1} \]
      4. metadata-eval17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}}}\right)}^{-1} \]
      5. pow1/217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}}}\right)}^{-1} \]
      6. sub-neg17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{{b\_2}^{2} + \left(-a \cdot c\right)}}}\right)}^{-1} \]
      7. unpow217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{b\_2 \cdot b\_2} + \left(-a \cdot c\right)}}\right)}^{-1} \]
      8. distribute-rgt-neg-out17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{a \cdot \left(-c\right)}}}\right)}^{-1} \]
      9. add-sqr-sqrt14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{\sqrt{a \cdot \left(-c\right)} \cdot \sqrt{a \cdot \left(-c\right)}}}}\right)}^{-1} \]
      10. hypot-undefine19.3%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}\right)}^{-1} \]
    6. Applied egg-rr19.3%

      \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}} \]
      2. distribute-rgt-neg-out19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{-a \cdot c}}\right)}} \]
      3. distribute-lft-neg-in19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{\left(-a\right) \cdot c}}\right)}} \]
    8. Simplified19.3%

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b\_2} + 2 \cdot \frac{b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}} \]
    10. Step-by-step derivation
      1. fma-define0.0%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2 \cdot b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}\right)} \]
      3. *-commutative0.0%

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{2 \cdot b\_2}{\color{blue}{-1} \cdot c}\right)} \]
      6. times-frac87.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2}{-1} \cdot \frac{b\_2}{c}}\right)} \]
      7. metadata-eval87.1%

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

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

    if -6.9999999999999997e-135 < b_2 < 1.04999999999999996e-17

    1. Initial program 78.4%

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

      \[\leadsto \frac{\left(-b\_2\right) - \sqrt{\color{blue}{-1 \cdot \left(a \cdot c\right)}}}{a} \]
    4. Step-by-step derivation
      1. mul-1-neg69.5%

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

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

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

    if 1.04999999999999996e-17 < b_2

    1. Initial program 64.0%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \frac{b\_2}{c}\right)}\\ \mathbf{elif}\;b\_2 \leq 1.05 \cdot 10^{-17}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{a \cdot \left(-c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -6.9999999999999997e-135

    1. Initial program 17.9%

      \[\frac{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 - a \cdot c}}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt15.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}} \cdot \sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}}}{a} \]
      2. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left(\sqrt{\sqrt{b\_2 \cdot b\_2 - a \cdot c}}\right)}^{2}}}{a} \]
      3. pow1/215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left(\sqrt{\color{blue}{{\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]
      4. sqrt-pow115.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\color{blue}{\left({\left(b\_2 \cdot b\_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]
      5. pow215.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left(\color{blue}{{b\_2}^{2}} - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a} \]
      6. metadata-eval15.9%

        \[\leadsto \frac{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    4. Applied egg-rr15.9%

      \[\leadsto \frac{\left(-b\_2\right) - \color{blue}{{\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    5. Step-by-step derivation
      1. clear-num15.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}}} \]
      2. inv-pow15.9%

        \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - {\left({\left({b\_2}^{2} - a \cdot c\right)}^{0.25}\right)}^{2}}\right)}^{-1}} \]
      3. pow-pow17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{{\left({b\_2}^{2} - a \cdot c\right)}^{\left(0.25 \cdot 2\right)}}}\right)}^{-1} \]
      4. metadata-eval17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - {\left({b\_2}^{2} - a \cdot c\right)}^{\color{blue}{0.5}}}\right)}^{-1} \]
      5. pow1/217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\sqrt{{b\_2}^{2} - a \cdot c}}}\right)}^{-1} \]
      6. sub-neg17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{{b\_2}^{2} + \left(-a \cdot c\right)}}}\right)}^{-1} \]
      7. unpow217.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{\color{blue}{b\_2 \cdot b\_2} + \left(-a \cdot c\right)}}\right)}^{-1} \]
      8. distribute-rgt-neg-out17.8%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{a \cdot \left(-c\right)}}}\right)}^{-1} \]
      9. add-sqr-sqrt14.4%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \sqrt{b\_2 \cdot b\_2 + \color{blue}{\sqrt{a \cdot \left(-c\right)} \cdot \sqrt{a \cdot \left(-c\right)}}}}\right)}^{-1} \]
      10. hypot-undefine19.3%

        \[\leadsto {\left(\frac{a}{\left(-b\_2\right) - \color{blue}{\mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}\right)}^{-1} \]
    6. Applied egg-rr19.3%

      \[\leadsto \color{blue}{{\left(\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{a \cdot \left(-c\right)}\right)}}} \]
      2. distribute-rgt-neg-out19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{-a \cdot c}}\right)}} \]
      3. distribute-lft-neg-in19.3%

        \[\leadsto \frac{1}{\frac{a}{\left(-b\_2\right) - \mathsf{hypot}\left(b\_2, \sqrt{\color{blue}{\left(-a\right) \cdot c}}\right)}} \]
    8. Simplified19.3%

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

      \[\leadsto \frac{1}{\color{blue}{0.5 \cdot \frac{a}{b\_2} + 2 \cdot \frac{b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}} \]
    10. Step-by-step derivation
      1. fma-define0.0%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2 \cdot b\_2}{c \cdot {\left(\sqrt{-1}\right)}^{2}}}\right)} \]
      3. *-commutative0.0%

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{2 \cdot b\_2}{\color{blue}{-1} \cdot c}\right)} \]
      6. times-frac87.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{2}{-1} \cdot \frac{b\_2}{c}}\right)} \]
      7. metadata-eval87.1%

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \frac{b\_2}{c}\right)}} \]
    12. Step-by-step derivation
      1. clear-num87.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, -2 \cdot \color{blue}{\frac{1}{\frac{c}{b\_2}}}\right)} \]
      2. un-div-inv87.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \color{blue}{\frac{-2}{\frac{c}{b\_2}}}\right)} \]
    13. Applied egg-rr87.2%

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

    if -6.9999999999999997e-135 < b_2 < 8.39999999999999998e-18

    1. Initial program 78.4%

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

      \[\leadsto \frac{\left(-b\_2\right) - \sqrt{\color{blue}{-1 \cdot \left(a \cdot c\right)}}}{a} \]
    4. Step-by-step derivation
      1. mul-1-neg69.5%

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

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

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

    if 8.39999999999999998e-18 < b_2

    1. Initial program 64.0%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -7 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b\_2}, \frac{-2}{\frac{c}{b\_2}}\right)}\\ \mathbf{elif}\;b\_2 \leq 8.4 \cdot 10^{-18}:\\ \;\;\;\;\frac{\left(-b\_2\right) - \sqrt{a \cdot \left(-c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.4% accurate, 7.0× 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 30.0%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]
    4. Step-by-step derivation
      1. *-commutative71.2%

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

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b\_2}} \]
    5. Simplified71.2%

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 70.7%

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

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

    \[\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} \]
  5. Add Preprocessing

Alternative 7: 42.8% accurate, 11.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -2.2 \cdot 10^{+17}:\\
\;\;\;\;0.5 \cdot \frac{c}{b\_2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -2.2e17

    1. Initial program 10.0%

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b\_2 + 0.5 \cdot \frac{a \cdot c}{b\_2}}}{a} \]
    4. Taylor expanded in b_2 around 0 22.7%

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

    if -2.2e17 < b_2

    1. Initial program 65.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -2.2 \cdot 10^{+17}:\\ \;\;\;\;0.5 \cdot \frac{c}{b\_2}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 67.3% accurate, 11.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b\_2 \leq -9.4 \cdot 10^{-291}:\\
\;\;\;\;\frac{c \cdot -0.5}{b\_2}\\

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


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

    1. Initial program 28.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b\_2}} \]
    4. Step-by-step derivation
      1. *-commutative72.7%

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

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b\_2}} \]
    5. Simplified72.7%

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

    if -9.3999999999999997e-291 < b_2

    1. Initial program 71.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b\_2 \leq -9.4 \cdot 10^{-291}:\\ \;\;\;\;\frac{c \cdot -0.5}{b\_2}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b\_2}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 34.7% accurate, 22.4× speedup?

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

\\
-2 \cdot \frac{b\_2}{a}
\end{array}
Derivation
  1. Initial program 48.4%

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

    \[\leadsto \color{blue}{-2 \cdot \frac{b\_2}{a}} \]
  4. Final simplification30.2%

    \[\leadsto -2 \cdot \frac{b\_2}{a} \]
  5. Add Preprocessing

Developer target: 99.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\ t_1 := \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\ \;\;\;\;\sqrt{\left|b\_2\right| - t\_0} \cdot \sqrt{\left|b\_2\right| + t\_0}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(b\_2, t\_0\right)\\ \end{array}\\ \mathbf{if}\;b\_2 < 0:\\ \;\;\;\;\frac{c}{t\_1 - b\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b\_2 + t\_1}{-a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (let* ((t_0 (* (sqrt (fabs a)) (sqrt (fabs c))))
        (t_1
         (if (== (copysign a c) a)
           (* (sqrt (- (fabs b_2) t_0)) (sqrt (+ (fabs b_2) t_0)))
           (hypot b_2 t_0))))
   (if (< b_2 0.0) (/ c (- t_1 b_2)) (/ (+ b_2 t_1) (- a)))))
double code(double a, double b_2, double c) {
	double t_0 = sqrt(fabs(a)) * sqrt(fabs(c));
	double tmp;
	if (copysign(a, c) == a) {
		tmp = sqrt((fabs(b_2) - t_0)) * sqrt((fabs(b_2) + t_0));
	} else {
		tmp = hypot(b_2, t_0);
	}
	double t_1 = tmp;
	double tmp_1;
	if (b_2 < 0.0) {
		tmp_1 = c / (t_1 - b_2);
	} else {
		tmp_1 = (b_2 + t_1) / -a;
	}
	return tmp_1;
}
public static double code(double a, double b_2, double c) {
	double t_0 = Math.sqrt(Math.abs(a)) * Math.sqrt(Math.abs(c));
	double tmp;
	if (Math.copySign(a, c) == a) {
		tmp = Math.sqrt((Math.abs(b_2) - t_0)) * Math.sqrt((Math.abs(b_2) + t_0));
	} else {
		tmp = Math.hypot(b_2, t_0);
	}
	double t_1 = tmp;
	double tmp_1;
	if (b_2 < 0.0) {
		tmp_1 = c / (t_1 - b_2);
	} else {
		tmp_1 = (b_2 + t_1) / -a;
	}
	return tmp_1;
}
def code(a, b_2, c):
	t_0 = math.sqrt(math.fabs(a)) * math.sqrt(math.fabs(c))
	tmp = 0
	if math.copysign(a, c) == a:
		tmp = math.sqrt((math.fabs(b_2) - t_0)) * math.sqrt((math.fabs(b_2) + t_0))
	else:
		tmp = math.hypot(b_2, t_0)
	t_1 = tmp
	tmp_1 = 0
	if b_2 < 0.0:
		tmp_1 = c / (t_1 - b_2)
	else:
		tmp_1 = (b_2 + t_1) / -a
	return tmp_1
function code(a, b_2, c)
	t_0 = Float64(sqrt(abs(a)) * sqrt(abs(c)))
	tmp = 0.0
	if (copysign(a, c) == a)
		tmp = Float64(sqrt(Float64(abs(b_2) - t_0)) * sqrt(Float64(abs(b_2) + t_0)));
	else
		tmp = hypot(b_2, t_0);
	end
	t_1 = tmp
	tmp_1 = 0.0
	if (b_2 < 0.0)
		tmp_1 = Float64(c / Float64(t_1 - b_2));
	else
		tmp_1 = Float64(Float64(b_2 + t_1) / Float64(-a));
	end
	return tmp_1
end
function tmp_3 = code(a, b_2, c)
	t_0 = sqrt(abs(a)) * sqrt(abs(c));
	tmp = 0.0;
	if ((sign(c) * abs(a)) == a)
		tmp = sqrt((abs(b_2) - t_0)) * sqrt((abs(b_2) + t_0));
	else
		tmp = hypot(b_2, t_0);
	end
	t_1 = tmp;
	tmp_2 = 0.0;
	if (b_2 < 0.0)
		tmp_2 = c / (t_1 - b_2);
	else
		tmp_2 = (b_2 + t_1) / -a;
	end
	tmp_3 = tmp_2;
end
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[c], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = If[Equal[N[With[{TMP1 = Abs[a], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], a], N[(N[Sqrt[N[(N[Abs[b$95$2], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[Abs[b$95$2], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[b$95$2 ^ 2 + t$95$0 ^ 2], $MachinePrecision]]}, If[Less[b$95$2, 0.0], N[(c / N[(t$95$1 - b$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$2 + t$95$1), $MachinePrecision] / (-a)), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\
t_1 := \begin{array}{l}
\mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\
\;\;\;\;\sqrt{\left|b\_2\right| - t\_0} \cdot \sqrt{\left|b\_2\right| + t\_0}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b\_2, t\_0\right)\\


\end{array}\\
\mathbf{if}\;b\_2 < 0:\\
\;\;\;\;\frac{c}{t\_1 - b\_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{b\_2 + t\_1}{-a}\\


\end{array}
\end{array}

Reproduce

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

  :alt
  (if (< b_2 0.0) (/ c (- (if (== (copysign a c) a) (* (sqrt (- (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot b_2 (* (sqrt (fabs a)) (sqrt (fabs c))))) b_2)) (/ (+ b_2 (if (== (copysign a c) a) (* (sqrt (- (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs b_2) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot b_2 (* (sqrt (fabs a)) (sqrt (fabs c)))))) (- a)))

  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))