quad2m (problem 3.2.1, negative)

Percentage Accurate: 57.9% → 90.9%
Time: 33.6s
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: 57.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: 90.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{b_2 \cdot b_2 - c \cdot a}\\
\mathbf{if}\;b_2 \leq -7.5 \cdot 10^{-23}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\

\mathbf{elif}\;b_2 \leq -1.8 \cdot 10^{-160}:\\
\;\;\;\;\frac{\frac{c \cdot \left(-a\right)}{b_2 - t_0}}{a}\\

\mathbf{elif}\;b_2 \leq -9 \cdot 10^{-192}:\\
\;\;\;\;c \cdot \frac{-0.5}{b_2}\\

\mathbf{elif}\;b_2 \leq 120000000:\\
\;\;\;\;\frac{\left(-b_2\right) - t_0}{a}\\

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


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

    1. Initial program 12.4%

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

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

    if -7.4999999999999998e-23 < b_2 < -1.7999999999999999e-160

    1. Initial program 51.4%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\left|\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right|} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      3. rem-square-sqrt50.2%

        \[\leadsto \frac{\left(-b_2\right) - \left|\color{blue}{\sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      4. unpow1/250.2%

        \[\leadsto \frac{\left(-b_2\right) - \left|\color{blue}{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      5. unpow1/250.2%

        \[\leadsto \frac{\left(-b_2\right) - \left|{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5} \cdot \color{blue}{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      6. fabs-sqr50.2%

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\left({\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5} \cdot {\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}\right)} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      7. pow-sqr50.4%

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{\left(2 \cdot 0.5\right)}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      8. metadata-eval50.4%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-\left(b_2 \cdot b_2 - \left(b_2 \cdot b_2 - c \cdot a\right)\right)}{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}}}{a} \]
    8. Step-by-step derivation
      1. neg-sub051.5%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\left(0 - 0\right) - c \cdot a}}{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}}{a} \]
      5. metadata-eval75.3%

        \[\leadsto \frac{\frac{\color{blue}{0} - c \cdot a}{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}}{a} \]
      6. neg-sub075.3%

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

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

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

    if -1.7999999999999999e-160 < b_2 < -9.00000000000000048e-192

    1. Initial program 32.8%

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

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

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

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

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\sqrt{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{2}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}}{a} \]
    4. Step-by-step derivation
      1. unpow233.0%

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

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\left|\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right|} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      3. rem-square-sqrt32.7%

        \[\leadsto \frac{\left(-b_2\right) - \left|\color{blue}{\sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      4. unpow1/232.7%

        \[\leadsto \frac{\left(-b_2\right) - \left|\color{blue}{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      5. unpow1/232.7%

        \[\leadsto \frac{\left(-b_2\right) - \left|{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5} \cdot \color{blue}{{\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}}\right| \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      6. fabs-sqr32.7%

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\left({\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5} \cdot {\left(\sqrt[3]{b_2 \cdot b_2 - a \cdot c}\right)}^{0.5}\right)} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      7. pow-sqr33.0%

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

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

        \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      10. *-commutative33.0%

        \[\leadsto \frac{\left(-b_2\right) - \sqrt[3]{b_2 \cdot b_2 - \color{blue}{c \cdot a}} \cdot \sqrt{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      11. *-commutative33.0%

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
    7. Step-by-step derivation
      1. metadata-eval63.1%

        \[\leadsto \color{blue}{\frac{-0.5}{1}} \cdot \frac{c}{b_2} \]
      2. times-frac63.1%

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

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{1 \cdot b_2} \]
      4. times-frac63.1%

        \[\leadsto \color{blue}{\frac{c}{1} \cdot \frac{-0.5}{b_2}} \]
      5. /-rgt-identity63.1%

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

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

    if -9.00000000000000048e-192 < b_2 < 1.2e8

    1. Initial program 90.9%

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

    if 1.2e8 < b_2

    1. Initial program 85.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -7.5 \cdot 10^{-23}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq -1.8 \cdot 10^{-160}:\\ \;\;\;\;\frac{\frac{c \cdot \left(-a\right)}{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}}{a}\\ \mathbf{elif}\;b_2 \leq -9 \cdot 10^{-192}:\\ \;\;\;\;c \cdot \frac{-0.5}{b_2}\\ \mathbf{elif}\;b_2 \leq 120000000:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

Alternative 2: 90.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b_2 \leq 120000000:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\

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


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

    1. Initial program 22.3%

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

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

    if -9.00000000000000048e-192 < b_2 < 1.2e8

    1. Initial program 90.9%

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

    if 1.2e8 < b_2

    1. Initial program 85.6%

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

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

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

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

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

Alternative 3: 85.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b_2 \leq 6.3 \cdot 10^{-108}:\\
\;\;\;\;\frac{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\

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


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

    1. Initial program 22.3%

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

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

    if -9.00000000000000048e-192 < b_2 < 6.2999999999999997e-108

    1. Initial program 83.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \left(-\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}\right) + \color{blue}{\sqrt{\left(-b_2\right) \cdot \left(-b_2\right)}}}{a} \]
      7. sqr-neg75.9%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}, -{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}, b_2\right)}}{a} \]
    4. Step-by-step derivation
      1. fma-udef76.0%

        \[\leadsto \frac{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25} \cdot \left(-{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right) + b_2}}{a} \]
      2. +-commutative76.0%

        \[\leadsto \frac{\color{blue}{b_2 + {\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25} \cdot \left(-{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}}{a} \]
      3. distribute-rgt-neg-out76.0%

        \[\leadsto \frac{b_2 + \color{blue}{\left(-{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25} \cdot {\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}}{a} \]
      4. pow-sqr76.1%

        \[\leadsto \frac{b_2 + \left(-\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(2 \cdot 0.25\right)}}\right)}{a} \]
      5. metadata-eval76.1%

        \[\leadsto \frac{b_2 + \left(-{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.5}}\right)}{a} \]
      6. exp-to-pow71.9%

        \[\leadsto \frac{b_2 + \left(-\color{blue}{e^{\log \left(b_2 \cdot b_2 - a \cdot c\right) \cdot 0.5}}\right)}{a} \]
      7. unsub-neg71.9%

        \[\leadsto \frac{\color{blue}{b_2 - e^{\log \left(b_2 \cdot b_2 - a \cdot c\right) \cdot 0.5}}}{a} \]
      8. exp-to-pow76.1%

        \[\leadsto \frac{b_2 - \color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}{a} \]
      9. unpow1/276.1%

        \[\leadsto \frac{b_2 - \color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c}}}{a} \]
      10. *-commutative76.1%

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

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

    if 6.2999999999999997e-108 < b_2

    1. Initial program 90.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -9 \cdot 10^{-192}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 6.3 \cdot 10^{-108}:\\ \;\;\;\;\frac{b_2 - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + \frac{c}{b_2} \cdot 0.5\\ \end{array} \]

Alternative 4: 77.4% accurate, 7.4× speedup?

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

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

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


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

    1. Initial program 28.2%

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 89.9%

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

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

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

Alternative 5: 77.4% accurate, 8.6× speedup?

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

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

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


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

    1. Initial program 28.2%

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 89.9%

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

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

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

Alternative 6: 58.0% accurate, 15.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -4 \cdot 10^{-310}:\\
\;\;\;\;-0.5 \cdot \frac{c}{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 28.2%

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 89.9%

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

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

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

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

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

        \[\leadsto \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    3. Applied egg-rr89.7%

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    4. Taylor expanded in b_2 around inf 33.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2}}{a} \]
    5. Step-by-step derivation
      1. mul-1-neg33.8%

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    6. Simplified33.8%

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

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

Alternative 7: 77.2% accurate, 15.9× speedup?

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

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

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


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

    1. Initial program 28.2%

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

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

    if -3.999999999999988e-310 < b_2

    1. Initial program 89.9%

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

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

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

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

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

Alternative 8: 28.9% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.1 \cdot 10^{-160}:\\
\;\;\;\;\frac{0}{a}\\

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


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

    1. Initial program 21.6%

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

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

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

        \[\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-pow117.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. metadata-eval17.5%

        \[\leadsto \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    3. Applied egg-rr17.5%

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    4. Taylor expanded in b_2 around -inf 20.4%

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2 + b_2}}{a} \]
    5. Step-by-step derivation
      1. distribute-lft1-in20.4%

        \[\leadsto \frac{\color{blue}{\left(-1 + 1\right) \cdot b_2}}{a} \]
      2. metadata-eval20.4%

        \[\leadsto \frac{\color{blue}{0} \cdot b_2}{a} \]
      3. mul0-lft20.4%

        \[\leadsto \frac{\color{blue}{0}}{a} \]
    6. Simplified20.4%

      \[\leadsto \frac{\color{blue}{0}}{a} \]

    if -2.1e-160 < b_2

    1. Initial program 86.0%

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

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

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

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

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

        \[\leadsto \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    3. Applied egg-rr85.7%

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    4. Taylor expanded in b_2 around inf 29.5%

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

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    6. Simplified29.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.1 \cdot 10^{-160}:\\ \;\;\;\;\frac{0}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b_2}{a}\\ \end{array} \]

Alternative 9: 10.2% accurate, 37.3× speedup?

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

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 59.3%

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

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

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

      \[\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-pow157.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. metadata-eval57.5%

      \[\leadsto \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
  3. Applied egg-rr57.5%

    \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
  4. Taylor expanded in b_2 around -inf 9.8%

    \[\leadsto \frac{\color{blue}{-1 \cdot b_2 + b_2}}{a} \]
  5. Step-by-step derivation
    1. distribute-lft1-in9.8%

      \[\leadsto \frac{\color{blue}{\left(-1 + 1\right) \cdot b_2}}{a} \]
    2. metadata-eval9.8%

      \[\leadsto \frac{\color{blue}{0} \cdot b_2}{a} \]
    3. mul0-lft9.8%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  6. Simplified9.8%

    \[\leadsto \frac{\color{blue}{0}}{a} \]
  7. Final simplification9.8%

    \[\leadsto \frac{0}{a} \]

Reproduce

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