The quadratic formula (r2)

Percentage Accurate: 52.9% → 90.4%
Time: 22.0s
Alternatives: 11
Speedup: 12.9×

Specification

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

\\
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot 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 11 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 90.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.6 \cdot 10^{+160}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-232}:\\ \;\;\;\;\frac{c \cdot -2}{b - \sqrt{a \cdot \left(c \cdot -4\right) + {b}^{2}}}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+126}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -6.6e+160)
   (/ c (- b))
   (if (<= b 4.6e-232)
     (/ (* c -2.0) (- b (sqrt (+ (* a (* c -4.0)) (pow b 2.0)))))
     (if (<= b 5e+126)
       (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* c a))))) (* a 2.0))
       (/ b (- a))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -6.6e+160) {
		tmp = c / -b;
	} else if (b <= 4.6e-232) {
		tmp = (c * -2.0) / (b - sqrt(((a * (c * -4.0)) + pow(b, 2.0))));
	} else if (b <= 5e+126) {
		tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
	} else {
		tmp = b / -a;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-6.6d+160)) then
        tmp = c / -b
    else if (b <= 4.6d-232) then
        tmp = (c * (-2.0d0)) / (b - sqrt(((a * (c * (-4.0d0))) + (b ** 2.0d0))))
    else if (b <= 5d+126) then
        tmp = (-b - sqrt(((b * b) - (4.0d0 * (c * a))))) / (a * 2.0d0)
    else
        tmp = b / -a
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -6.6e+160) {
		tmp = c / -b;
	} else if (b <= 4.6e-232) {
		tmp = (c * -2.0) / (b - Math.sqrt(((a * (c * -4.0)) + Math.pow(b, 2.0))));
	} else if (b <= 5e+126) {
		tmp = (-b - Math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
	} else {
		tmp = b / -a;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -6.6e+160:
		tmp = c / -b
	elif b <= 4.6e-232:
		tmp = (c * -2.0) / (b - math.sqrt(((a * (c * -4.0)) + math.pow(b, 2.0))))
	elif b <= 5e+126:
		tmp = (-b - math.sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0)
	else:
		tmp = b / -a
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -6.6e+160)
		tmp = Float64(c / Float64(-b));
	elseif (b <= 4.6e-232)
		tmp = Float64(Float64(c * -2.0) / Float64(b - sqrt(Float64(Float64(a * Float64(c * -4.0)) + (b ^ 2.0)))));
	elseif (b <= 5e+126)
		tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(c * a))))) / Float64(a * 2.0));
	else
		tmp = Float64(b / Float64(-a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -6.6e+160)
		tmp = c / -b;
	elseif (b <= 4.6e-232)
		tmp = (c * -2.0) / (b - sqrt(((a * (c * -4.0)) + (b ^ 2.0))));
	elseif (b <= 5e+126)
		tmp = (-b - sqrt(((b * b) - (4.0 * (c * a))))) / (a * 2.0);
	else
		tmp = b / -a;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -6.6e+160], N[(c / (-b)), $MachinePrecision], If[LessEqual[b, 4.6e-232], N[(N[(c * -2.0), $MachinePrecision] / N[(b - N[Sqrt[N[(N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+126], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(b / (-a)), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+160}:\\
\;\;\;\;\frac{c}{-b}\\

\mathbf{elif}\;b \leq 4.6 \cdot 10^{-232}:\\
\;\;\;\;\frac{c \cdot -2}{b - \sqrt{a \cdot \left(c \cdot -4\right) + {b}^{2}}}\\

\mathbf{elif}\;b \leq 5 \cdot 10^{+126}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -6.5999999999999994e160

    1. Initial program 1.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub1.3%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*1.3%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac1.3%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*1.3%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out1.7%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*1.7%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg1.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative1.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified1.8%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 95.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg95.6%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac295.6%

        \[\leadsto \color{blue}{\frac{c}{-b}} \]
    7. Simplified95.6%

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

    if -6.5999999999999994e160 < b < 4.6e-232

    1. Initial program 48.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub46.9%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*46.4%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac46.4%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*46.9%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out48.1%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*48.1%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg48.1%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative48.1%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified48.1%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num48.1%

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

        \[\leadsto \frac{1}{\frac{a}{-0.5}} \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} \]
      3. frac-times41.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt41.8%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity41.8%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow241.8%

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

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

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

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr41.8%

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

        \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{a \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
      2. *-commutative47.9%

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 86.5%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative86.5%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified86.5%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Step-by-step derivation
      1. fma-undefine86.5%

        \[\leadsto \frac{c \cdot -2}{b - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + {b}^{2}}}} \]
    13. Applied egg-rr86.5%

      \[\leadsto \frac{c \cdot -2}{b - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + {b}^{2}}}} \]

    if 4.6e-232 < b < 4.99999999999999977e126

    1. Initial program 91.7%

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

    if 4.99999999999999977e126 < b

    1. Initial program 38.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub38.6%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*38.6%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac38.6%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*38.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out38.5%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*38.5%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg38.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative38.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified38.7%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 100.0%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.6 \cdot 10^{+160}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-232}:\\ \;\;\;\;\frac{c \cdot -2}{b - \sqrt{a \cdot \left(c \cdot -4\right) + {b}^{2}}}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+126}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 80.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\ \mathbf{if}\;b \leq -3.8 \cdot 10^{-119}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 10^{-88}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 1100:\\ \;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\ \mathbf{elif}\;b \leq 13000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ -0.5 a) (+ b (sqrt (* -4.0 (* c a)))))))
   (if (<= b -3.8e-119)
     (/ (* c -2.0) (+ b (- b (* (* a (/ c b)) 2.0))))
     (if (<= b 1e-88)
       t_0
       (if (<= b 1100.0)
         (/ (+ (* b -2.0) (* (/ (* c a) b) 2.0)) (* a 2.0))
         (if (<= b 13000000.0) t_0 (- (/ c b) (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = (-0.5 / a) * (b + sqrt((-4.0 * (c * a))));
	double tmp;
	if (b <= -3.8e-119) {
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	} else if (b <= 1e-88) {
		tmp = t_0;
	} else if (b <= 1100.0) {
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	} else if (b <= 13000000.0) {
		tmp = t_0;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((-0.5d0) / a) * (b + sqrt(((-4.0d0) * (c * a))))
    if (b <= (-3.8d-119)) then
        tmp = (c * (-2.0d0)) / (b + (b - ((a * (c / b)) * 2.0d0)))
    else if (b <= 1d-88) then
        tmp = t_0
    else if (b <= 1100.0d0) then
        tmp = ((b * (-2.0d0)) + (((c * a) / b) * 2.0d0)) / (a * 2.0d0)
    else if (b <= 13000000.0d0) then
        tmp = t_0
    else
        tmp = (c / b) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (-0.5 / a) * (b + Math.sqrt((-4.0 * (c * a))));
	double tmp;
	if (b <= -3.8e-119) {
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	} else if (b <= 1e-88) {
		tmp = t_0;
	} else if (b <= 1100.0) {
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	} else if (b <= 13000000.0) {
		tmp = t_0;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (-0.5 / a) * (b + math.sqrt((-4.0 * (c * a))))
	tmp = 0
	if b <= -3.8e-119:
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)))
	elif b <= 1e-88:
		tmp = t_0
	elif b <= 1100.0:
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0)
	elif b <= 13000000.0:
		tmp = t_0
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-0.5 / a) * Float64(b + sqrt(Float64(-4.0 * Float64(c * a)))))
	tmp = 0.0
	if (b <= -3.8e-119)
		tmp = Float64(Float64(c * -2.0) / Float64(b + Float64(b - Float64(Float64(a * Float64(c / b)) * 2.0))));
	elseif (b <= 1e-88)
		tmp = t_0;
	elseif (b <= 1100.0)
		tmp = Float64(Float64(Float64(b * -2.0) + Float64(Float64(Float64(c * a) / b) * 2.0)) / Float64(a * 2.0));
	elseif (b <= 13000000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (-0.5 / a) * (b + sqrt((-4.0 * (c * a))));
	tmp = 0.0;
	if (b <= -3.8e-119)
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	elseif (b <= 1e-88)
		tmp = t_0;
	elseif (b <= 1100.0)
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	elseif (b <= 13000000.0)
		tmp = t_0;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(-0.5 / a), $MachinePrecision] * N[(b + N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.8e-119], N[(N[(c * -2.0), $MachinePrecision] / N[(b + N[(b - N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-88], t$95$0, If[LessEqual[b, 1100.0], N[(N[(N[(b * -2.0), $MachinePrecision] + N[(N[(N[(c * a), $MachinePrecision] / b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 13000000.0], t$95$0, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{-119}:\\
\;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\

\mathbf{elif}\;b \leq 10^{-88}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 1100:\\
\;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\

\mathbf{elif}\;b \leq 13000000:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -3.79999999999999975e-119

    1. Initial program 18.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*16.5%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac16.5%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*17.0%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out18.4%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*18.4%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg18.4%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative18.4%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified18.4%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num18.4%

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

        \[\leadsto \frac{1}{\frac{a}{-0.5}} \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} \]
      3. frac-times13.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt13.9%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity13.9%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow213.9%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv13.9%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow213.9%

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr13.9%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 70.8%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative70.8%

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

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in b around -inf 83.4%

      \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}} \]
    13. Step-by-step derivation
      1. neg-mul-183.4%

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

        \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)}} \]
      3. unsub-neg83.4%

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

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\frac{a \cdot c}{b} \cdot 2} - b\right)} \]
      5. associate-/l*87.5%

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

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

    if -3.79999999999999975e-119 < b < 9.99999999999999934e-89 or 1100 < b < 1.3e7

    1. Initial program 81.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*81.2%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac81.2%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*81.0%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out81.0%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*81.0%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg81.0%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative81.0%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified81.0%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 78.3%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}\right) \]
    6. Step-by-step derivation
      1. *-commutative78.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}\right) \]
    7. Simplified78.3%

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

    if 9.99999999999999934e-89 < b < 1100

    1. Initial program 90.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative90.6%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      3. sqr-neg90.6%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{\left(-b\right) \cdot \left(-b\right) - 4 \cdot \color{blue}{\left(a \cdot c\right)}}}{a \cdot 2} \]
      5. sqr-neg90.6%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      7. associate-*r*90.6%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 64.5%

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

    if 1.3e7 < b

    1. Initial program 56.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub56.9%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*56.8%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac56.8%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*56.7%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out56.7%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*56.7%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified56.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 95.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative95.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg95.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg95.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{-119}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 10^{-88}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\ \mathbf{elif}\;b \leq 1100:\\ \;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\ \mathbf{elif}\;b \leq 13000000:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.65 \cdot 10^{-94}:\\
\;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{-127}:\\
\;\;\;\;\frac{c \cdot -2}{b - \sqrt{a \cdot \left(c \cdot -4\right)}}\\

\mathbf{elif}\;b \leq 1100:\\
\;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\

\mathbf{elif}\;b \leq 40000000:\\
\;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.6500000000000001e-94

    1. Initial program 17.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub16.5%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*15.9%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac15.9%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*16.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out17.9%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*17.9%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg17.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative17.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified17.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num17.9%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt14.3%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity14.3%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow214.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv14.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow214.3%

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr14.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 70.9%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative70.9%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified70.9%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in b around -inf 84.9%

      \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}} \]
    13. Step-by-step derivation
      1. neg-mul-184.9%

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

        \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)}} \]
      3. unsub-neg84.9%

        \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} - b\right)}} \]
      4. *-commutative84.9%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\frac{a \cdot c}{b} \cdot 2} - b\right)} \]
      5. associate-/l*89.1%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot 2 - b\right)} \]
    14. Simplified89.1%

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

    if -1.6500000000000001e-94 < b < 6.99999999999999979e-127

    1. Initial program 75.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub75.6%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*75.6%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac75.6%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*75.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out75.5%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*75.5%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg75.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative75.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified75.5%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num75.5%

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

        \[\leadsto \frac{1}{\frac{a}{-0.5}} \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} \]
      3. frac-times64.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt64.5%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity64.5%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow264.5%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv64.5%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow264.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 78.4%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative78.4%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified78.4%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in a around inf 76.3%

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

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

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

        \[\leadsto \frac{c \cdot -2}{b - \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}} \]
      4. associate-*r*76.3%

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

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

    if 6.99999999999999979e-127 < b < 1100

    1. Initial program 92.1%

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      3. sqr-neg92.1%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{\left(-b\right) \cdot \left(-b\right) - 4 \cdot \color{blue}{\left(a \cdot c\right)}}}{a \cdot 2} \]
      5. sqr-neg92.1%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      7. associate-*r*92.1%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 62.6%

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

    if 1100 < b < 4e7

    1. Initial program 100.0%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub100.0%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*100.0%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac100.0%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*99.7%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out99.7%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*99.7%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg99.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative99.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 99.7%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}\right) \]
    6. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}\right) \]
    7. Simplified99.7%

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

    if 4e7 < b

    1. Initial program 56.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub56.9%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*56.8%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac56.8%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*56.7%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out56.7%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*56.7%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified56.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 95.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative95.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg95.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg95.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified95.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.65 \cdot 10^{-94}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-127}:\\ \;\;\;\;\frac{c \cdot -2}{b - \sqrt{a \cdot \left(c \cdot -4\right)}}\\ \mathbf{elif}\;b \leq 1100:\\ \;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\ \mathbf{elif}\;b \leq 40000000:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.5 \cdot \frac{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}{a}\\ \mathbf{if}\;b \leq -1.65 \cdot 10^{-94}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 820:\\ \;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\ \mathbf{elif}\;b \leq 11000000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* -0.5 (/ (pow (* a (* c -4.0)) 0.5) a))))
   (if (<= b -1.65e-94)
     (/ (* c -2.0) (+ b (- b (* (* a (/ c b)) 2.0))))
     (if (<= b 8.5e-130)
       t_0
       (if (<= b 820.0)
         (/ (+ (* b -2.0) (* (/ (* c a) b) 2.0)) (* a 2.0))
         (if (<= b 11000000.0) t_0 (- (/ c b) (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = -0.5 * (pow((a * (c * -4.0)), 0.5) / a);
	double tmp;
	if (b <= -1.65e-94) {
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	} else if (b <= 8.5e-130) {
		tmp = t_0;
	} else if (b <= 820.0) {
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	} else if (b <= 11000000.0) {
		tmp = t_0;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-0.5d0) * (((a * (c * (-4.0d0))) ** 0.5d0) / a)
    if (b <= (-1.65d-94)) then
        tmp = (c * (-2.0d0)) / (b + (b - ((a * (c / b)) * 2.0d0)))
    else if (b <= 8.5d-130) then
        tmp = t_0
    else if (b <= 820.0d0) then
        tmp = ((b * (-2.0d0)) + (((c * a) / b) * 2.0d0)) / (a * 2.0d0)
    else if (b <= 11000000.0d0) then
        tmp = t_0
    else
        tmp = (c / b) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = -0.5 * (Math.pow((a * (c * -4.0)), 0.5) / a);
	double tmp;
	if (b <= -1.65e-94) {
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	} else if (b <= 8.5e-130) {
		tmp = t_0;
	} else if (b <= 820.0) {
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	} else if (b <= 11000000.0) {
		tmp = t_0;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = -0.5 * (math.pow((a * (c * -4.0)), 0.5) / a)
	tmp = 0
	if b <= -1.65e-94:
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)))
	elif b <= 8.5e-130:
		tmp = t_0
	elif b <= 820.0:
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0)
	elif b <= 11000000.0:
		tmp = t_0
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	t_0 = Float64(-0.5 * Float64((Float64(a * Float64(c * -4.0)) ^ 0.5) / a))
	tmp = 0.0
	if (b <= -1.65e-94)
		tmp = Float64(Float64(c * -2.0) / Float64(b + Float64(b - Float64(Float64(a * Float64(c / b)) * 2.0))));
	elseif (b <= 8.5e-130)
		tmp = t_0;
	elseif (b <= 820.0)
		tmp = Float64(Float64(Float64(b * -2.0) + Float64(Float64(Float64(c * a) / b) * 2.0)) / Float64(a * 2.0));
	elseif (b <= 11000000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = -0.5 * (((a * (c * -4.0)) ^ 0.5) / a);
	tmp = 0.0;
	if (b <= -1.65e-94)
		tmp = (c * -2.0) / (b + (b - ((a * (c / b)) * 2.0)));
	elseif (b <= 8.5e-130)
		tmp = t_0;
	elseif (b <= 820.0)
		tmp = ((b * -2.0) + (((c * a) / b) * 2.0)) / (a * 2.0);
	elseif (b <= 11000000.0)
		tmp = t_0;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(-0.5 * N[(N[Power[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.65e-94], N[(N[(c * -2.0), $MachinePrecision] / N[(b + N[(b - N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-130], t$95$0, If[LessEqual[b, 820.0], N[(N[(N[(b * -2.0), $MachinePrecision] + N[(N[(N[(c * a), $MachinePrecision] / b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 11000000.0], t$95$0, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -0.5 \cdot \frac{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}{a}\\
\mathbf{if}\;b \leq -1.65 \cdot 10^{-94}:\\
\;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 820:\\
\;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\

\mathbf{elif}\;b \leq 11000000:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.6500000000000001e-94

    1. Initial program 17.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub16.5%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*15.9%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac15.9%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*16.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out17.9%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*17.9%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg17.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative17.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified17.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num17.9%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt14.3%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity14.3%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow214.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv14.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow214.3%

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr14.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 70.9%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative70.9%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified70.9%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in b around -inf 84.9%

      \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}} \]
    13. Step-by-step derivation
      1. neg-mul-184.9%

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

        \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)}} \]
      3. unsub-neg84.9%

        \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} - b\right)}} \]
      4. *-commutative84.9%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\frac{a \cdot c}{b} \cdot 2} - b\right)} \]
      5. associate-/l*89.1%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot 2 - b\right)} \]
    14. Simplified89.1%

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

    if -1.6500000000000001e-94 < b < 8.50000000000000033e-130 or 820 < b < 1.1e7

    1. Initial program 78.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub78.9%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*78.9%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac78.9%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*78.8%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out78.8%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*78.8%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg78.8%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative78.8%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified78.8%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt78.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}\right) \]
      2. pow278.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \color{blue}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}\right)}^{2}}\right) \]
      3. pow1/278.5%

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

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + {\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}\right) \]
      5. pow278.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}\right) \]
      6. metadata-eval78.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2}\right) \]
    6. Applied egg-rr78.7%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}\right) \]
    7. Taylor expanded in c around inf 53.8%

      \[\leadsto \frac{-0.5}{a} \cdot \color{blue}{\left(b + {\left(e^{0.25 \cdot \left(\log \left(-4 \cdot a\right) + -1 \cdot \log \left(\frac{1}{c}\right)\right)}\right)}^{2}\right)} \]
    8. Step-by-step derivation
      1. unpow253.8%

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

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

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

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

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

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

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + {\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log \left(a \cdot -4\right) + \left(-\color{blue}{\left(-\log c\right)}\right)\right)\right)}\right) \]
      8. remove-double-neg51.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + {\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log \left(a \cdot -4\right) + \color{blue}{\log c}\right)\right)}\right) \]
    9. Simplified51.7%

      \[\leadsto \frac{-0.5}{a} \cdot \color{blue}{\left(b + {\left(e^{0.25}\right)}^{\left(2 \cdot \left(\log \left(a \cdot -4\right) + \log c\right)\right)}\right)} \]
    10. Taylor expanded in b around 0 54.0%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{e^{0.5 \cdot \left(\log c + \log \left(-4 \cdot a\right)\right)}}{a}} \]
    11. Step-by-step derivation
      1. *-commutative54.0%

        \[\leadsto -0.5 \cdot \frac{e^{\color{blue}{\left(\log c + \log \left(-4 \cdot a\right)\right) \cdot 0.5}}}{a} \]
      2. *-commutative54.0%

        \[\leadsto -0.5 \cdot \frac{e^{\left(\log c + \log \color{blue}{\left(a \cdot -4\right)}\right) \cdot 0.5}}{a} \]
      3. log-prod73.4%

        \[\leadsto -0.5 \cdot \frac{e^{\color{blue}{\log \left(c \cdot \left(a \cdot -4\right)\right)} \cdot 0.5}}{a} \]
      4. associate-*r*73.4%

        \[\leadsto -0.5 \cdot \frac{e^{\log \color{blue}{\left(\left(c \cdot a\right) \cdot -4\right)} \cdot 0.5}}{a} \]
      5. *-commutative73.4%

        \[\leadsto -0.5 \cdot \frac{e^{\log \left(\color{blue}{\left(a \cdot c\right)} \cdot -4\right) \cdot 0.5}}{a} \]
      6. associate-*r*73.4%

        \[\leadsto -0.5 \cdot \frac{e^{\log \color{blue}{\left(a \cdot \left(c \cdot -4\right)\right)} \cdot 0.5}}{a} \]
      7. exp-to-pow78.4%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}}{a} \]
    12. Simplified78.4%

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

    if 8.50000000000000033e-130 < b < 820

    1. Initial program 88.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative88.7%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      3. sqr-neg88.7%

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{\left(-b\right) \cdot \left(-b\right) - 4 \cdot \color{blue}{\left(a \cdot c\right)}}}{a \cdot 2} \]
      5. sqr-neg88.7%

        \[\leadsto \frac{\left(-b\right) - \sqrt{\color{blue}{b \cdot b} - 4 \cdot \left(a \cdot c\right)}}{a \cdot 2} \]
      6. *-commutative88.7%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \color{blue}{\left(c \cdot a\right)}}}{a \cdot 2} \]
      7. associate-*r*88.7%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 60.3%

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

    if 1.1e7 < b

    1. Initial program 56.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub56.9%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*56.8%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac56.8%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*56.7%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out56.7%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*56.7%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative56.7%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified56.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 95.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative95.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg95.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg95.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified95.8%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.65 \cdot 10^{-94}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-130}:\\ \;\;\;\;-0.5 \cdot \frac{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}{a}\\ \mathbf{elif}\;b \leq 820:\\ \;\;\;\;\frac{b \cdot -2 + \frac{c \cdot a}{b} \cdot 2}{a \cdot 2}\\ \mathbf{elif}\;b \leq 11000000:\\ \;\;\;\;-0.5 \cdot \frac{{\left(a \cdot \left(c \cdot -4\right)\right)}^{0.5}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{-93}:\\
\;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\

\mathbf{elif}\;b \leq 4 \cdot 10^{+129}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.70000000000000001e-93

    1. Initial program 17.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub15.8%

        \[\leadsto \color{blue}{\frac{-b}{2 \cdot a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}} \]
      2. sub-neg15.8%

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*15.3%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac15.3%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*15.8%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out17.2%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*17.2%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg17.2%

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

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

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num17.2%

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

        \[\leadsto \frac{1}{\frac{a}{-0.5}} \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} \]
      3. frac-times14.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt14.3%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity14.3%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow214.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv14.3%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow214.3%

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr14.3%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 70.6%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative70.6%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified70.6%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in b around -inf 85.2%

      \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}} \]
    13. Step-by-step derivation
      1. neg-mul-185.2%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\left(-b\right)} + 2 \cdot \frac{a \cdot c}{b}\right)} \]
      2. +-commutative85.2%

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

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

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\frac{a \cdot c}{b} \cdot 2} - b\right)} \]
      5. associate-/l*89.4%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot 2 - b\right)} \]
    14. Simplified89.4%

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

    if -1.70000000000000001e-93 < b < 4e129

    1. Initial program 85.0%

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

    if 4e129 < b

    1. Initial program 38.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub38.6%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*38.6%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac38.6%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*38.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out38.5%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*38.5%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg38.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative38.5%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified38.7%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 100.0%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{-93}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+129}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.6% accurate, 5.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{-292}:\\
\;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.99999999999999981e-292

    1. Initial program 31.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*30.0%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac30.0%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*30.3%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out31.3%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*31.3%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg31.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative31.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified31.4%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num31.4%

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

        \[\leadsto \frac{1}{\frac{a}{-0.5}} \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} \]
      3. frac-times26.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}} \]
      4. add-sqr-sqrt26.9%

        \[\leadsto \frac{1 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      5. *-un-lft-identity26.9%

        \[\leadsto \frac{\color{blue}{b \cdot b - \mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      6. pow226.9%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}{\frac{a}{-0.5} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      8. div-inv26.9%

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

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot \color{blue}{-2}\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
      10. pow226.9%

        \[\leadsto \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{\left(a \cdot -2\right) \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right)} \]
    6. Applied egg-rr26.9%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{-2 \cdot a}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}} \]
    9. Taylor expanded in b around 0 72.2%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative72.2%

        \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    11. Simplified72.2%

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    12. Taylor expanded in b around -inf 66.2%

      \[\leadsto \frac{c \cdot -2}{b - \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}} \]
    13. Step-by-step derivation
      1. neg-mul-166.2%

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\left(-b\right)} + 2 \cdot \frac{a \cdot c}{b}\right)} \]
      2. +-commutative66.2%

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

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

        \[\leadsto \frac{c \cdot -2}{b - \left(\color{blue}{\frac{a \cdot c}{b} \cdot 2} - b\right)} \]
      5. associate-/l*69.3%

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

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

    if 4.99999999999999981e-292 < b

    1. Initial program 70.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub70.0%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*70.0%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac70.0%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*69.8%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out69.9%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*69.9%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg69.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative69.9%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified69.9%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 70.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative70.7%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg70.7%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg70.7%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified70.7%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 5 \cdot 10^{-292}:\\ \;\;\;\;\frac{c \cdot -2}{b + \left(b - \left(a \cdot \frac{c}{b}\right) \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.6% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{-b}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\


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

    1. Initial program 31.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub30.6%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*30.2%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac30.2%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*30.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out31.6%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*31.6%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg31.6%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative31.6%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified31.6%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 69.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg69.3%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac269.3%

        \[\leadsto \color{blue}{\frac{c}{-b}} \]
    7. Simplified69.3%

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

    if -4.999999999999985e-310 < b

    1. Initial program 69.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub69.5%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*69.4%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac69.4%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*69.3%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out69.3%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*69.3%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg69.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative69.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 70.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative70.2%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg70.2%

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified70.2%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.8%

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

Alternative 8: 66.4% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-308}:\\
\;\;\;\;\frac{c}{-b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.1000000000000001e-308

    1. Initial program 31.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub30.6%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*30.2%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac30.2%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*30.5%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out31.6%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*31.6%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg31.6%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative31.6%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified31.6%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 69.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg69.3%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac269.3%

        \[\leadsto \color{blue}{\frac{c}{-b}} \]
    7. Simplified69.3%

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

    if -1.1000000000000001e-308 < b

    1. Initial program 69.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. div-sub69.5%

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      5. associate-/l*69.4%

        \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
      6. distribute-neg-frac69.4%

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

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

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
      9. associate-/l*69.3%

        \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
      10. distribute-rgt-out69.3%

        \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
      11. associate-/r*69.3%

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

        \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
      13. sub-neg69.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
      14. +-commutative69.3%

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Simplified69.4%

      \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 69.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg69.4%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified69.4%

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

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

Alternative 9: 34.3% accurate, 29.0× speedup?

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

\\
\frac{c}{-b}
\end{array}
Derivation
  1. Initial program 50.6%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. div-sub50.0%

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

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

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

      \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    5. associate-/l*49.8%

      \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    6. distribute-neg-frac49.8%

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

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

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
    9. associate-/l*49.9%

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
    10. distribute-rgt-out50.5%

      \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
    11. associate-/r*50.5%

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

      \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    13. sub-neg50.5%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
    14. +-commutative50.5%

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

    \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in b around -inf 35.8%

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  6. Step-by-step derivation
    1. mul-1-neg35.8%

      \[\leadsto \color{blue}{-\frac{c}{b}} \]
    2. distribute-neg-frac235.8%

      \[\leadsto \color{blue}{\frac{c}{-b}} \]
  7. Simplified35.8%

    \[\leadsto \color{blue}{\frac{c}{-b}} \]
  8. Final simplification35.8%

    \[\leadsto \frac{c}{-b} \]
  9. Add Preprocessing

Alternative 10: 2.6% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 50.6%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. div-sub50.0%

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

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

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

      \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    5. associate-/l*49.8%

      \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    6. distribute-neg-frac49.8%

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

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

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
    9. associate-/l*49.9%

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
    10. distribute-rgt-out50.5%

      \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
    11. associate-/r*50.5%

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

      \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    13. sub-neg50.5%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
    14. +-commutative50.5%

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

    \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
  4. Add Preprocessing
  5. Applied egg-rr30.3%

    \[\leadsto \color{blue}{\frac{1}{\frac{2}{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}{a}}}} \]
  6. Taylor expanded in b around -inf 2.6%

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  7. Final simplification2.6%

    \[\leadsto \frac{b}{a} \]
  8. Add Preprocessing

Alternative 11: 10.6% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 50.6%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. div-sub50.0%

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

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

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

      \[\leadsto \frac{\color{blue}{b \cdot -1}}{2 \cdot a} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    5. associate-/l*49.8%

      \[\leadsto \color{blue}{b \cdot \frac{-1}{2 \cdot a}} + \left(-\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\right) \]
    6. distribute-neg-frac49.8%

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

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

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \frac{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot -1}}{2 \cdot a} \]
    9. associate-/l*49.9%

      \[\leadsto b \cdot \frac{-1}{2 \cdot a} + \color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \frac{-1}{2 \cdot a}} \]
    10. distribute-rgt-out50.5%

      \[\leadsto \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
    11. associate-/r*50.5%

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

      \[\leadsto \frac{\color{blue}{-0.5}}{a} \cdot \left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    13. sub-neg50.5%

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}\right) \]
    14. +-commutative50.5%

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

    \[\leadsto \color{blue}{\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in a around 0 35.3%

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

      \[\leadsto \frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)\right) \]
  7. Simplified36.1%

    \[\leadsto \frac{-0.5}{a} \cdot \left(b + \color{blue}{\left(b + -2 \cdot \left(a \cdot \frac{c}{b}\right)\right)}\right) \]
  8. Taylor expanded in a around inf 12.5%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  9. Final simplification12.5%

    \[\leadsto \frac{c}{b} \]
  10. Add Preprocessing

Developer target: 70.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t\_0}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* 4.0 (* a c))))))
   (if (< b 0.0)
     (/ c (* a (/ (+ (- b) t_0) (* 2.0 a))))
     (/ (- (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (b < 0.0) {
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-b - t_0) / (2.0 * a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - (4.0d0 * (a * c))))
    if (b < 0.0d0) then
        tmp = c / (a * ((-b + t_0) / (2.0d0 * a)))
    else
        tmp = (-b - t_0) / (2.0d0 * a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (b < 0.0) {
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-b - t_0) / (2.0 * a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - (4.0 * (a * c))))
	tmp = 0
	if b < 0.0:
		tmp = c / (a * ((-b + t_0) / (2.0 * a)))
	else:
		tmp = (-b - t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a))));
	else
		tmp = Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - (4.0 * (a * c))));
	tmp = 0.0;
	if (b < 0.0)
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	else
		tmp = (-b - t_0) / (2.0 * a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(c / N[(a * N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t\_0}{2 \cdot a}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - t\_0}{2 \cdot a}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024040 
(FPCore (a b c)
  :name "The quadratic formula (r2)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))

  (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))