quad2p (problem 3.2.1, positive)

Percentage Accurate: 52.1% → 84.0%
Time: 11.5s
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: 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: 84.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b_2 \leq 2.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\

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


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

    1. Initial program 50.0%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified50.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 95.2%

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

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

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

    if -2.29999999999999999e137 < b_2 < 2.8e15

    1. Initial program 78.5%

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

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

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

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

    if 2.8e15 < b_2

    1. Initial program 12.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/12.1%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{-\color{blue}{c \cdot a}}\right) - b_2\right) \]
      7. distribute-rgt-neg-in25.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt92.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.3 \cdot 10^{+137}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq 2.8 \cdot 10^{+15}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \end{array} \]

Alternative 2: 77.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b_2 \leq -5.8 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\

\mathbf{elif}\;b_2 \leq -4 \cdot 10^{-136}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\

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

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


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

    1. Initial program 75.0%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified75.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 86.3%

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

    if -2.79999999999999997e-49 < b_2 < -5.80000000000000004e-95

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt99.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}\right)}^{2} - b_2}}{a} \]
    7. Step-by-step derivation
      1. unpow227.0%

        \[\leadsto \frac{\color{blue}{e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)} \cdot e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}} - b_2}{a} \]
      2. exp-prod25.3%

        \[\leadsto \frac{\color{blue}{{\left(e^{0.25}\right)}^{\left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}} \cdot e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)} - b_2}{a} \]
      3. exp-prod24.9%

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

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

        \[\leadsto \frac{{\left(e^{0.25}\right)}^{\left(2 \cdot \color{blue}{\left(\log a + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)} - b_2}{a} \]
      6. mul-1-neg24.9%

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

        \[\leadsto \frac{{\left(e^{0.25}\right)}^{\left(2 \cdot \color{blue}{\left(\log a - \log \left(\frac{-1}{c}\right)\right)}\right)} - b_2}{a} \]
    8. Simplified24.9%

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log a - \log \left(\frac{-1}{c}\right)\right)\right)} - b_2}}{a} \]
    9. Taylor expanded in b_2 around 0 27.0%

      \[\leadsto \color{blue}{\frac{e^{0.5 \cdot \left(\log a - \log \left(\frac{-1}{c}\right)\right)}}{a}} \]
    10. Step-by-step derivation
      1. log-div94.6%

        \[\leadsto \frac{e^{0.5 \cdot \color{blue}{\log \left(\frac{a}{\frac{-1}{c}}\right)}}}{a} \]
      2. *-commutative94.6%

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

        \[\leadsto \frac{\color{blue}{{\left(\frac{a}{\frac{-1}{c}}\right)}^{0.5}}}{a} \]
      4. unpow1/299.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{a}{\frac{-1}{c}}}}}{a} \]
      5. associate-/r/99.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{a}{-1} \cdot c}}}{a} \]
    11. Simplified99.8%

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

    if -5.80000000000000004e-95 < b_2 < -4.00000000000000001e-136

    1. Initial program 78.4%

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

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

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

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

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

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

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

    if -4.00000000000000001e-136 < b_2 < 2.4e15

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

    if 2.4e15 < b_2

    1. Initial program 12.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/12.1%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{-\color{blue}{c \cdot a}}\right) - b_2\right) \]
      7. distribute-rgt-neg-in25.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt92.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.8 \cdot 10^{-49}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq -5.8 \cdot 10^{-95}:\\ \;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\ \mathbf{elif}\;b_2 \leq -4 \cdot 10^{-136}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq 2.4 \cdot 10^{+15}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \end{array} \]

Alternative 3: 77.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\ \mathbf{if}\;b_2 \leq -2.7 \cdot 10^{-49}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq -2.6 \cdot 10^{-90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b_2 \leq -4 \cdot 10^{-136}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq 2.4 \cdot 10^{+15}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (let* ((t_0 (/ (sqrt (* c (/ a -1.0))) a)))
   (if (<= b_2 -2.7e-49)
     (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
     (if (<= b_2 -2.6e-90)
       t_0
       (if (<= b_2 -4e-136)
         (/ (* b_2 -2.0) a)
         (if (<= b_2 2.4e+15) t_0 (/ (* c -0.5) b_2)))))))
double code(double a, double b_2, double c) {
	double t_0 = sqrt((c * (a / -1.0))) / a;
	double tmp;
	if (b_2 <= -2.7e-49) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= -2.6e-90) {
		tmp = t_0;
	} else if (b_2 <= -4e-136) {
		tmp = (b_2 * -2.0) / a;
	} else if (b_2 <= 2.4e+15) {
		tmp = t_0;
	} else {
		tmp = (c * -0.5) / 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) :: t_0
    real(8) :: tmp
    t_0 = sqrt((c * (a / (-1.0d0)))) / a
    if (b_2 <= (-2.7d-49)) then
        tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
    else if (b_2 <= (-2.6d-90)) then
        tmp = t_0
    else if (b_2 <= (-4d-136)) then
        tmp = (b_2 * (-2.0d0)) / a
    else if (b_2 <= 2.4d+15) then
        tmp = t_0
    else
        tmp = (c * (-0.5d0)) / b_2
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double t_0 = Math.sqrt((c * (a / -1.0))) / a;
	double tmp;
	if (b_2 <= -2.7e-49) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= -2.6e-90) {
		tmp = t_0;
	} else if (b_2 <= -4e-136) {
		tmp = (b_2 * -2.0) / a;
	} else if (b_2 <= 2.4e+15) {
		tmp = t_0;
	} else {
		tmp = (c * -0.5) / b_2;
	}
	return tmp;
}
def code(a, b_2, c):
	t_0 = math.sqrt((c * (a / -1.0))) / a
	tmp = 0
	if b_2 <= -2.7e-49:
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
	elif b_2 <= -2.6e-90:
		tmp = t_0
	elif b_2 <= -4e-136:
		tmp = (b_2 * -2.0) / a
	elif b_2 <= 2.4e+15:
		tmp = t_0
	else:
		tmp = (c * -0.5) / b_2
	return tmp
function code(a, b_2, c)
	t_0 = Float64(sqrt(Float64(c * Float64(a / -1.0))) / a)
	tmp = 0.0
	if (b_2 <= -2.7e-49)
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	elseif (b_2 <= -2.6e-90)
		tmp = t_0;
	elseif (b_2 <= -4e-136)
		tmp = Float64(Float64(b_2 * -2.0) / a);
	elseif (b_2 <= 2.4e+15)
		tmp = t_0;
	else
		tmp = Float64(Float64(c * -0.5) / b_2);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	t_0 = sqrt((c * (a / -1.0))) / a;
	tmp = 0.0;
	if (b_2 <= -2.7e-49)
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	elseif (b_2 <= -2.6e-90)
		tmp = t_0;
	elseif (b_2 <= -4e-136)
		tmp = (b_2 * -2.0) / a;
	elseif (b_2 <= 2.4e+15)
		tmp = t_0;
	else
		tmp = (c * -0.5) / b_2;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[Sqrt[N[(c * N[(a / -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[b$95$2, -2.7e-49], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, -2.6e-90], t$95$0, If[LessEqual[b$95$2, -4e-136], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 2.4e+15], t$95$0, N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\
\mathbf{if}\;b_2 \leq -2.7 \cdot 10^{-49}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\

\mathbf{elif}\;b_2 \leq -2.6 \cdot 10^{-90}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b_2 \leq -4 \cdot 10^{-136}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\

\mathbf{elif}\;b_2 \leq 2.4 \cdot 10^{+15}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b_2 < -2.7e-49

    1. Initial program 75.0%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified75.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 86.3%

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

    if -2.7e-49 < b_2 < -2.6e-90 or -4.00000000000000001e-136 < b_2 < 2.4e15

    1. Initial program 70.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt70.0%

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

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

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

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
      5. fma-neg70.2%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      7. distribute-rgt-neg-in70.2%

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

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

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

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}\right)}^{2} - b_2}}{a} \]
    7. Step-by-step derivation
      1. unpow234.7%

        \[\leadsto \frac{\color{blue}{e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)} \cdot e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}} - b_2}{a} \]
      2. exp-prod33.9%

        \[\leadsto \frac{\color{blue}{{\left(e^{0.25}\right)}^{\left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)}} \cdot e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{-1}{c}\right) + \log a\right)} - b_2}{a} \]
      3. exp-prod33.4%

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

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

        \[\leadsto \frac{{\left(e^{0.25}\right)}^{\left(2 \cdot \color{blue}{\left(\log a + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)} - b_2}{a} \]
      6. mul-1-neg33.4%

        \[\leadsto \frac{{\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log a + \color{blue}{\left(-\log \left(\frac{-1}{c}\right)\right)}\right)\right)} - b_2}{a} \]
      7. unsub-neg33.4%

        \[\leadsto \frac{{\left(e^{0.25}\right)}^{\left(2 \cdot \color{blue}{\left(\log a - \log \left(\frac{-1}{c}\right)\right)}\right)} - b_2}{a} \]
    8. Simplified33.4%

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log a - \log \left(\frac{-1}{c}\right)\right)\right)} - b_2}}{a} \]
    9. Taylor expanded in b_2 around 0 34.5%

      \[\leadsto \color{blue}{\frac{e^{0.5 \cdot \left(\log a - \log \left(\frac{-1}{c}\right)\right)}}{a}} \]
    10. Step-by-step derivation
      1. log-div64.7%

        \[\leadsto \frac{e^{0.5 \cdot \color{blue}{\log \left(\frac{a}{\frac{-1}{c}}\right)}}}{a} \]
      2. *-commutative64.7%

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

        \[\leadsto \frac{\color{blue}{{\left(\frac{a}{\frac{-1}{c}}\right)}^{0.5}}}{a} \]
      4. unpow1/269.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{a}{\frac{-1}{c}}}}}{a} \]
      5. associate-/r/69.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{a}{-1} \cdot c}}}{a} \]
    11. Simplified69.0%

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

    if -2.6e-90 < b_2 < -4.00000000000000001e-136

    1. Initial program 78.4%

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

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

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

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

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

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

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

    if 2.4e15 < b_2

    1. Initial program 12.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/12.1%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \left(\mathsf{hypot}\left(b_2, \sqrt{-\color{blue}{c \cdot a}}\right) - b_2\right) \]
      7. distribute-rgt-neg-in25.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt92.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -2.7 \cdot 10^{-49}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq -2.6 \cdot 10^{-90}:\\ \;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\ \mathbf{elif}\;b_2 \leq -4 \cdot 10^{-136}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq 2.4 \cdot 10^{+15}:\\ \;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-1}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \end{array} \]

Alternative 4: 68.1% accurate, 8.6× speedup?

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

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

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


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

    1. Initial program 74.8%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified74.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 66.3%

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

    if -1.9999999999999e-311 < b_2

    1. Initial program 40.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. clear-num40.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/40.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt57.6%

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

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

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

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

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

Alternative 5: 48.0% accurate, 15.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\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 < -1.9999999999999e-311

    1. Initial program 74.8%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt74.5%

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

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

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

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
      5. fma-neg74.6%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      7. distribute-rgt-neg-in74.6%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      8. metadata-eval74.6%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    8. Simplified27.2%

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

    if -1.9999999999999e-311 < b_2

    1. Initial program 40.3%

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

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

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

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

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

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

Alternative 6: 48.0% accurate, 15.9× speedup?

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

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

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


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

    1. Initial program 74.8%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt74.5%

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

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

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

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
      5. fma-neg74.6%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      7. distribute-rgt-neg-in74.6%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      8. metadata-eval74.6%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    8. Simplified27.2%

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

    if -1.9999999999999e-311 < b_2

    1. Initial program 40.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. clear-num40.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/40.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt57.6%

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

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

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

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

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

Alternative 7: 67.9% accurate, 15.9× speedup?

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

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

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


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

    1. Initial program 74.8%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified74.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 66.1%

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

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

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

    if 1.9999999999999988e-309 < b_2

    1. Initial program 40.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. clear-num40.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}} \]
      2. associate-/r/40.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{c \cdot {\left(\sqrt{-1}\right)}^{2}}{b_2}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot c\right)}{b_2} \]
      4. rem-square-sqrt57.6%

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

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

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

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

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

Alternative 8: 23.4% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.2 \cdot 10^{-299}:\\
\;\;\;\;\frac{-b_2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\


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

    1. Initial program 74.4%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt74.1%

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

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

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

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
      5. fma-neg74.2%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      7. distribute-rgt-neg-in74.2%

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

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

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

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

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

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

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

    if -2.2e-299 < b_2

    1. Initial program 41.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
      5. fma-neg38.8%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
      7. distribute-rgt-neg-in38.8%

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

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b_2}{a} \]
    5. Applied egg-rr38.8%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2 + b_2}}{a} \]
    7. Step-by-step derivation
      1. distribute-lft1-in16.3%

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

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

        \[\leadsto \frac{\color{blue}{0}}{a} \]
    8. Simplified16.3%

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

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

Alternative 9: 10.9% 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 57.7%

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
  4. Step-by-step derivation
    1. add-sqr-sqrt56.3%

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

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

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

      \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b_2}{a} \]
    5. fma-neg56.4%

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

      \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b_2}{a} \]
    7. distribute-rgt-neg-in56.4%

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

      \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b_2}{a} \]
  5. Applied egg-rr56.4%

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{0}}{a} \]
  9. Final simplification9.5%

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

Reproduce

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