quad2p (problem 3.2.1, positive)

Percentage Accurate: 51.5% → 85.6%
Time: 9.4s
Alternatives: 7
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 7 alternatives:

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

Initial Program: 51.5% 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.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -7.2 \cdot 10^{+100}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -7.2e100

    1. Initial program 39.2%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified39.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around -inf 97.0%

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

    if -7.2e100 < b_2 < 3.99999999999999998e-70

    1. Initial program 79.3%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified79.3%

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

    if 3.99999999999999998e-70 < b_2

    1. Initial program 18.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around inf 86.2%

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

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

Alternative 2: 80.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -4.5 \cdot 10^{-38}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + \frac{c}{b_2} \cdot 0.5\\

\mathbf{elif}\;b_2 \leq 2.6 \cdot 10^{-70}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)} - b_2}{a}\\

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


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

    1. Initial program 56.2%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified56.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around -inf 92.8%

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

    if -4.50000000000000009e-38 < b_2 < 2.60000000000000002e-70

    1. Initial program 74.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around 0 68.6%

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

        \[\leadsto \frac{\sqrt{\color{blue}{-c \cdot a}} - b_2}{a} \]
      2. distribute-rgt-neg-out68.6%

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

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

    if 2.60000000000000002e-70 < b_2

    1. Initial program 18.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around inf 86.2%

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

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

Alternative 3: 80.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -3.7 \cdot 10^{-38}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + \frac{c}{b_2} \cdot 0.5\\

\mathbf{elif}\;b_2 \leq 7.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)}}{a}\\

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


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

    1. Initial program 56.2%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified56.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around -inf 92.8%

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

    if -3.7e-38 < b_2 < 7.59999999999999984e-71

    1. Initial program 74.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. prod-diff73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \sqrt{c \cdot a + -2 \cdot \left(c \cdot a\right)}} \]
    7. Step-by-step derivation
      1. associate-*l/66.4%

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{-1} \cdot \left(c \cdot a\right)}}{a} \]
      5. mul-1-neg66.7%

        \[\leadsto \frac{\sqrt{\color{blue}{-c \cdot a}}}{a} \]
      6. *-commutative66.7%

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

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

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

    if 7.59999999999999984e-71 < b_2

    1. Initial program 18.1%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around inf 86.2%

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

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

Alternative 4: 67.6% accurate, 8.6× speedup?

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

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

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


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

    1. Initial program 65.0%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around -inf 67.6%

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 33.8%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around inf 64.1%

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

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

Alternative 5: 67.5% accurate, 15.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\

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


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

    1. Initial program 65.0%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around -inf 67.4%

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 33.8%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified33.8%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around inf 64.1%

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

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

Alternative 6: 34.9% 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 50.9%

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
  3. Simplified50.9%

    \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
  4. Taylor expanded in b_2 around -inf 38.1%

    \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}} \]
  5. Final simplification38.1%

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

Alternative 7: 15.1% accurate, 28.0× speedup?

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

\\
\frac{-b_2}{a}
\end{array}
Derivation
  1. Initial program 50.9%

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
  3. Simplified50.9%

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a} - \frac{b_2}{a}} \]
    2. add-cbrt-cube41.6%

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

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

      \[\leadsto \frac{\color{blue}{\sqrt[3]{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a} - \frac{b_2}{a} \]
    5. *-un-lft-identity48.9%

      \[\leadsto \frac{\sqrt[3]{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c}}}{\color{blue}{1 \cdot a}} - \frac{b_2}{a} \]
    6. times-frac48.9%

      \[\leadsto \color{blue}{\frac{\sqrt[3]{b_2 \cdot b_2 - a \cdot c}}{1} \cdot \frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}} - \frac{b_2}{a} \]
    7. fma-neg48.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)}}{1} \cdot \frac{\sqrt[3]{\mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)}}{a} - \frac{b_2}{a}} \]
    3. /-rgt-identity39.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{b_2}{a}} \]
    2. distribute-neg-frac15.1%

      \[\leadsto \color{blue}{\frac{-b_2}{a}} \]
  10. Simplified15.1%

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

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

Reproduce

?
herbie shell --seed 2023178 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  :precision binary64
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))