quadm (p42, negative)

Percentage Accurate: 51.6% → 87.6%
Time: 13.0s
Alternatives: 8
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 8 alternatives:

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

Initial Program: 51.6% 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: 87.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+26}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-181}:\\ \;\;\;\;\frac{c \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+109}:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{-a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2e+26)
   (/ (- c) b)
   (if (<= b -4.2e-181)
     (/ (* c -2.0) (- b (hypot b (sqrt (* a (* c -4.0))))))
     (if (<= b 4.2e+109)
       (/ (+ b (sqrt (- (* b b) (* 4.0 (* c a))))) (- (* a 2.0)))
       (- (/ c b) (/ b a))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e+26) {
		tmp = -c / b;
	} else if (b <= -4.2e-181) {
		tmp = (c * -2.0) / (b - hypot(b, sqrt((a * (c * -4.0)))));
	} else if (b <= 4.2e+109) {
		tmp = (b + sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0);
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e+26) {
		tmp = -c / b;
	} else if (b <= -4.2e-181) {
		tmp = (c * -2.0) / (b - Math.hypot(b, Math.sqrt((a * (c * -4.0)))));
	} else if (b <= 4.2e+109) {
		tmp = (b + Math.sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0);
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2e+26:
		tmp = -c / b
	elif b <= -4.2e-181:
		tmp = (c * -2.0) / (b - math.hypot(b, math.sqrt((a * (c * -4.0)))))
	elif b <= 4.2e+109:
		tmp = (b + math.sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0)
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2e+26)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= -4.2e-181)
		tmp = Float64(Float64(c * -2.0) / Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -4.0))))));
	elseif (b <= 4.2e+109)
		tmp = Float64(Float64(b + sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(c * a))))) / Float64(-Float64(a * 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 <= -2e+26)
		tmp = -c / b;
	elseif (b <= -4.2e-181)
		tmp = (c * -2.0) / (b - hypot(b, sqrt((a * (c * -4.0)))));
	elseif (b <= 4.2e+109)
		tmp = (b + sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0);
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2e+26], N[((-c) / b), $MachinePrecision], If[LessEqual[b, -4.2e-181], N[(N[(c * -2.0), $MachinePrecision] / N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+109], 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[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -4.2 \cdot 10^{-181}:\\
\;\;\;\;\frac{c \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\

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

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


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

    1. Initial program 7.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-sub5.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-neg5.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-15.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. *-commutative5.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*3.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-frac3.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-13.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. *-commutative3.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*5.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-out7.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*7.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-eval7.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-190.1%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified90.1%

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

    if -2.0000000000000001e26 < b < -4.20000000000000006e-181

    1. Initial program 59.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-sub59.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-neg59.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-159.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. *-commutative59.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*58.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-frac58.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-158.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. *-commutative58.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*59.1%

        \[\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-out59.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*59.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-eval59.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{-2} \cdot \frac{{b}^{2} - \left({b}^{2} + c \cdot \left(a \cdot -4\right)\right)}{a}}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
      5. metadata-eval58.6%

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

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

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

        \[\leadsto \frac{\frac{0.5 \cdot \left({b}^{2} - \left({b}^{2} + c \cdot \left(a \cdot -4\right)\right)\right)}{\color{blue}{-a}}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
      9. associate-/r*49.4%

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left({b}^{2} - \left({b}^{2} + c \cdot \left(a \cdot -4\right)\right)\right)}{\left(-a\right) \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)}} \]
      10. times-frac58.6%

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

        \[\leadsto \color{blue}{\left(-\frac{0.5}{a}\right)} \cdot \frac{{b}^{2} - \left({b}^{2} + c \cdot \left(a \cdot -4\right)\right)}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
      12. distribute-neg-frac58.6%

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

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

      \[\leadsto \color{blue}{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{\frac{-0.5}{a}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}} \]
    9. Step-by-step derivation
      1. associate-*r*58.0%

        \[\leadsto \color{blue}{\left(\left(c \cdot a\right) \cdot 4\right)} \cdot \frac{\frac{-0.5}{a}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
      2. associate-*l*58.0%

        \[\leadsto \color{blue}{\left(c \cdot a\right) \cdot \left(4 \cdot \frac{\frac{-0.5}{a}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}\right)} \]
      3. associate-/l/57.9%

        \[\leadsto \left(c \cdot a\right) \cdot \left(4 \cdot \color{blue}{\frac{-0.5}{\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right) \cdot a}}\right) \]
    10. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\left(c \cdot a\right) \cdot \left(4 \cdot \frac{-0.5}{\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right) \cdot a}\right)} \]
    11. Step-by-step derivation
      1. *-commutative57.9%

        \[\leadsto \color{blue}{\left(a \cdot c\right)} \cdot \left(4 \cdot \frac{-0.5}{\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right) \cdot a}\right) \]
      2. associate-*r/57.9%

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

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

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

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

        \[\leadsto \left(a \cdot c\right) \cdot \frac{-2}{a \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}\right)\right)} \]
      7. rem-square-sqrt0.0%

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

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

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

        \[\leadsto \left(a \cdot c\right) \cdot \frac{-2}{a \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot \color{blue}{\left(\sqrt{-4} \cdot \sqrt{-4}\right)}\right)}\right)\right)} \]
      11. rem-square-sqrt57.9%

        \[\leadsto \left(a \cdot c\right) \cdot \frac{-2}{a \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot \color{blue}{-4}\right)}\right)\right)} \]
    12. Simplified57.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{c \cdot a}{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}\right)} \cdot \frac{-2}{a} \]
    14. Applied egg-rr67.1%

      \[\leadsto \color{blue}{\frac{c \cdot a}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \cdot \frac{-2}{a}} \]
    15. Step-by-step derivation
      1. associate-*l/67.2%

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

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

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

        \[\leadsto \frac{\left(a \cdot c\right) \cdot \frac{-2}{a}}{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}\right)} \]
      5. rem-square-sqrt0.0%

        \[\leadsto \frac{\left(a \cdot c\right) \cdot \frac{-2}{a}}{b - \mathsf{hypot}\left(b, \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(\sqrt{-4} \cdot \sqrt{-4}\right)}}\right)} \]
      6. unpow20.0%

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

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

        \[\leadsto \frac{\left(a \cdot c\right) \cdot \frac{-2}{a}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot \color{blue}{\left(\sqrt{-4} \cdot \sqrt{-4}\right)}\right)}\right)} \]
      9. rem-square-sqrt67.2%

        \[\leadsto \frac{\left(a \cdot c\right) \cdot \frac{-2}{a}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot \color{blue}{-4}\right)}\right)} \]
    16. Simplified67.2%

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

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

    if -4.20000000000000006e-181 < b < 4.2000000000000003e109

    1. Initial program 89.3%

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

    if 4.2000000000000003e109 < b

    1. Initial program 56.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-sub56.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-neg56.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-156.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. *-commutative56.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*56.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-frac56.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-156.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. *-commutative56.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*56.4%

        \[\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.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*56.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-eval56.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+26}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-181}:\\ \;\;\;\;\frac{c \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+109}:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{-a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{if}\;b \leq -2.9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{-127}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-58}:\\ \;\;\;\;\frac{a \cdot \frac{c}{b} - b}{a}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{-13}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\frac{1}{b} + a \cdot \frac{c}{{b}^{3}}\right) - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ -0.5 a) (+ b (sqrt (* c (* a -4.0)))))))
   (if (<= b -2.9e-5)
     (/ (- c) b)
     (if (<= b 4e-127)
       t_0
       (if (<= b 1.02e-58)
         (/ (- (* a (/ c b)) b) a)
         (if (<= b 1.6e-13)
           t_0
           (- (* c (+ (/ 1.0 b) (* a (/ c (pow b 3.0))))) (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = (-0.5 / a) * (b + sqrt((c * (a * -4.0))));
	double tmp;
	if (b <= -2.9e-5) {
		tmp = -c / b;
	} else if (b <= 4e-127) {
		tmp = t_0;
	} else if (b <= 1.02e-58) {
		tmp = ((a * (c / b)) - b) / a;
	} else if (b <= 1.6e-13) {
		tmp = t_0;
	} else {
		tmp = (c * ((1.0 / b) + (a * (c / pow(b, 3.0))))) - (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((c * (a * (-4.0d0)))))
    if (b <= (-2.9d-5)) then
        tmp = -c / b
    else if (b <= 4d-127) then
        tmp = t_0
    else if (b <= 1.02d-58) then
        tmp = ((a * (c / b)) - b) / a
    else if (b <= 1.6d-13) then
        tmp = t_0
    else
        tmp = (c * ((1.0d0 / b) + (a * (c / (b ** 3.0d0))))) - (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((c * (a * -4.0))));
	double tmp;
	if (b <= -2.9e-5) {
		tmp = -c / b;
	} else if (b <= 4e-127) {
		tmp = t_0;
	} else if (b <= 1.02e-58) {
		tmp = ((a * (c / b)) - b) / a;
	} else if (b <= 1.6e-13) {
		tmp = t_0;
	} else {
		tmp = (c * ((1.0 / b) + (a * (c / Math.pow(b, 3.0))))) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (-0.5 / a) * (b + math.sqrt((c * (a * -4.0))))
	tmp = 0
	if b <= -2.9e-5:
		tmp = -c / b
	elif b <= 4e-127:
		tmp = t_0
	elif b <= 1.02e-58:
		tmp = ((a * (c / b)) - b) / a
	elif b <= 1.6e-13:
		tmp = t_0
	else:
		tmp = (c * ((1.0 / b) + (a * (c / math.pow(b, 3.0))))) - (b / a)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-0.5 / a) * Float64(b + sqrt(Float64(c * Float64(a * -4.0)))))
	tmp = 0.0
	if (b <= -2.9e-5)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 4e-127)
		tmp = t_0;
	elseif (b <= 1.02e-58)
		tmp = Float64(Float64(Float64(a * Float64(c / b)) - b) / a);
	elseif (b <= 1.6e-13)
		tmp = t_0;
	else
		tmp = Float64(Float64(c * Float64(Float64(1.0 / b) + Float64(a * Float64(c / (b ^ 3.0))))) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (-0.5 / a) * (b + sqrt((c * (a * -4.0))));
	tmp = 0.0;
	if (b <= -2.9e-5)
		tmp = -c / b;
	elseif (b <= 4e-127)
		tmp = t_0;
	elseif (b <= 1.02e-58)
		tmp = ((a * (c / b)) - b) / a;
	elseif (b <= 1.6e-13)
		tmp = t_0;
	else
		tmp = (c * ((1.0 / b) + (a * (c / (b ^ 3.0))))) - (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[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.9e-5], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 4e-127], t$95$0, If[LessEqual[b, 1.02e-58], N[(N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.6e-13], t$95$0, N[(N[(c * N[(N[(1.0 / b), $MachinePrecision] + N[(a * N[(c / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 4 \cdot 10^{-127}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-58}:\\
\;\;\;\;\frac{a \cdot \frac{c}{b} - b}{a}\\

\mathbf{elif}\;b \leq 1.6 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(\frac{1}{b} + a \cdot \frac{c}{{b}^{3}}\right) - \frac{b}{a}\\


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

    1. Initial program 9.3%

      \[\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-sub7.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-neg7.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-17.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. *-commutative7.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*5.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-frac5.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-15.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. *-commutative5.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*7.6%

        \[\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-out9.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*9.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-eval9.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-187.8%

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

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

    if -2.9e-5 < b < 4.0000000000000001e-127 or 1.0199999999999999e-58 < b < 1.6e-13

    1. Initial program 80.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-sub80.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-neg80.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-180.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. *-commutative80.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*80.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-frac80.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-180.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. *-commutative80.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*80.2%

        \[\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-out80.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*80.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-eval80.2%

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

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

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

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

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

      \[\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. associate-*r*75.4%

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

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

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

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

    if 4.0000000000000001e-127 < b < 1.0199999999999999e-58

    1. Initial program 94.3%

      \[\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-sub94.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-neg94.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-194.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. *-commutative94.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*94.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-frac94.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-194.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. *-commutative94.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*94.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-out94.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*94.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-eval94.0%

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

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

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, -4 \cdot \color{blue}{\left(c \cdot a\right)}\right)}\right) \]
      15. *-commutative94.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{a \cdot c}{b} - b}}{a} \]
      4. associate-/l*66.7%

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

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

    if 1.6e-13 < b

    1. Initial program 70.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-sub70.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-neg70.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-170.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. *-commutative70.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*70.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-frac70.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-170.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. *-commutative70.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*70.2%

        \[\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-out70.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*70.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-eval70.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{c \cdot \left(\frac{1}{b} + \frac{a \cdot c}{{b}^{3}}\right) - \frac{b}{a}} \]
      4. associate-/l*90.0%

        \[\leadsto c \cdot \left(\frac{1}{b} + \color{blue}{a \cdot \frac{c}{{b}^{3}}}\right) - \frac{b}{a} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{c \cdot \left(\frac{1}{b} + a \cdot \frac{c}{{b}^{3}}\right) - \frac{b}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 3: 84.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{-5}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{+109}:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{-a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.4e-5)
   (/ (- c) b)
   (if (<= b 8.5e+109)
     (/ (+ b (sqrt (- (* b b) (* 4.0 (* c a))))) (- (* a 2.0)))
     (- (/ c b) (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.4e-5) {
		tmp = -c / b;
	} else if (b <= 8.5e+109) {
		tmp = (b + sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 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 <= (-4.4d-5)) then
        tmp = -c / b
    else if (b <= 8.5d+109) then
        tmp = (b + sqrt(((b * b) - (4.0d0 * (c * a))))) / -(a * 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 <= -4.4e-5) {
		tmp = -c / b;
	} else if (b <= 8.5e+109) {
		tmp = (b + Math.sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0);
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4.4e-5:
		tmp = -c / b
	elif b <= 8.5e+109:
		tmp = (b + math.sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0)
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.4e-5)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 8.5e+109)
		tmp = Float64(Float64(b + sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(c * a))))) / Float64(-Float64(a * 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 <= -4.4e-5)
		tmp = -c / b;
	elseif (b <= 8.5e+109)
		tmp = (b + sqrt(((b * b) - (4.0 * (c * a))))) / -(a * 2.0);
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4.4e-5], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 8.5e+109], 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[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 9.3%

      \[\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-sub7.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-neg7.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-17.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. *-commutative7.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*5.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-frac5.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-15.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. *-commutative5.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*7.6%

        \[\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-out9.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*9.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-eval9.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-187.8%

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

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

    if -4.3999999999999999e-5 < b < 8.5000000000000004e109

    1. Initial program 85.2%

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

    if 8.5000000000000004e109 < b

    1. Initial program 56.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-sub56.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-neg56.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-156.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. *-commutative56.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*56.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-frac56.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-156.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. *-commutative56.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*56.4%

        \[\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.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*56.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-eval56.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{-127}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.9e-5)
   (/ (- c) b)
   (if (<= b 4e-127)
     (* (/ -0.5 a) (+ b (sqrt (* c (* a -4.0)))))
     (- (/ c b) (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.9e-5) {
		tmp = -c / b;
	} else if (b <= 4e-127) {
		tmp = (-0.5 / a) * (b + sqrt((c * (a * -4.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 <= (-2.9d-5)) then
        tmp = -c / b
    else if (b <= 4d-127) then
        tmp = ((-0.5d0) / a) * (b + sqrt((c * (a * (-4.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 <= -2.9e-5) {
		tmp = -c / b;
	} else if (b <= 4e-127) {
		tmp = (-0.5 / a) * (b + Math.sqrt((c * (a * -4.0))));
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.9e-5:
		tmp = -c / b
	elif b <= 4e-127:
		tmp = (-0.5 / a) * (b + math.sqrt((c * (a * -4.0))))
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.9e-5)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 4e-127)
		tmp = Float64(Float64(-0.5 / a) * Float64(b + sqrt(Float64(c * Float64(a * -4.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 <= -2.9e-5)
		tmp = -c / b;
	elseif (b <= 4e-127)
		tmp = (-0.5 / a) * (b + sqrt((c * (a * -4.0))));
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-5], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 4e-127], N[(N[(-0.5 / a), $MachinePrecision] * N[(b + N[Sqrt[N[(c * N[(a * -4.0), $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 -2.9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-c}{b}\\

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

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


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

    1. Initial program 9.3%

      \[\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-sub7.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-neg7.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-17.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. *-commutative7.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*5.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-frac5.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-15.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. *-commutative5.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*7.6%

        \[\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-out9.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*9.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-eval9.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-187.8%

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

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

    if -2.9e-5 < b < 4.0000000000000001e-127

    1. Initial program 77.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-sub77.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-neg77.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-177.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. *-commutative77.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*77.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-frac77.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-177.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. *-commutative77.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.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-out78.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*78.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-eval78.0%

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

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

        \[\leadsto \frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, -4 \cdot \color{blue}{\left(c \cdot a\right)}\right)}\right) \]
      15. *-commutative78.0%

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

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

      \[\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. associate-*r*75.2%

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

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

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

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

    if 4.0000000000000001e-127 < b

    1. Initial program 76.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-sub76.7%

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

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

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

        \[\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*76.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-frac76.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-176.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. *-commutative76.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*76.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-out76.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*76.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-eval76.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 68.3% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-311) (/ (- c) b) (- (/ c b) (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-311) {
		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-311)) 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-311) {
		tmp = -c / b;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-311:
		tmp = -c / b
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-311)
		tmp = Float64(Float64(-c) / 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-311)
		tmp = -c / b;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-311], 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^{-311}:\\
\;\;\;\;\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 < -5.00000000000023e-311

    1. Initial program 29.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-sub28.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-neg28.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-128.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. *-commutative28.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*26.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-frac26.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-126.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. *-commutative26.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*28.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-out29.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*29.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-eval29.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-167.1%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified67.1%

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

    if -5.00000000000023e-311 < b

    1. Initial program 78.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-sub78.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-neg78.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-178.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. *-commutative78.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*77.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-frac77.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-177.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. *-commutative77.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*77.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-out77.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*77.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-eval77.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 68.1% accurate, 12.9× speedup?

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

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

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


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

    1. Initial program 28.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-sub27.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-neg27.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-127.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. *-commutative27.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*25.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-frac25.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-125.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. *-commutative25.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*27.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-out28.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*28.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-eval28.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-168.7%

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

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

    if -3.70000000000000038e-279 < b

    1. Initial program 77.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-sub77.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-neg77.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-177.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. *-commutative77.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*77.7%

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

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

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

        \[\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*77.6%

        \[\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-out77.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*77.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-eval77.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac263.2%

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

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

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

Alternative 7: 42.8% accurate, 12.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.90000000000000014e91

    1. Initial program 6.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-sub4.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-neg4.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-14.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. *-commutative4.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*1.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-frac1.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-11.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. *-commutative1.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*4.4%

        \[\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-out6.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*6.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-eval6.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{a \cdot c}{b} - b}}{a} \]
      4. associate-/l*2.1%

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

      \[\leadsto \color{blue}{\frac{a \cdot \frac{c}{b} - b}{a}} \]
    8. Taylor expanded in a around inf 37.9%

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

    if -2.90000000000000014e91 < b

    1. Initial program 71.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-sub71.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-neg71.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-171.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. *-commutative71.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.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-frac70.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-170.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. *-commutative70.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*70.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-out70.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*70.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-eval70.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac246.0%

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

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

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

Alternative 8: 11.1% 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 54.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-sub54.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-neg54.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-154.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. *-commutative54.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*53.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-frac53.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-153.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. *-commutative53.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*54.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-out54.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*54.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-eval54.6%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{a \cdot c}{b} - b}}{a} \]
    4. associate-/l*35.1%

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

    \[\leadsto \color{blue}{\frac{a \cdot \frac{c}{b} - b}{a}} \]
  8. Taylor expanded in a around inf 12.2%

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

Developer target: 99.7% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t\_1\right)\\


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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024095 
(FPCore (a b c)
  :name "quadm (p42, negative)"
  :precision binary64
  :herbie-expected 10

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

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