quadp (p42, positive)

Percentage Accurate: 51.9% → 87.3%
Time: 11.9s
Alternatives: 9
Speedup: 19.1×

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 9 alternatives:

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

Initial Program: 51.9% accurate, 1.0× speedup?

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

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

Alternative 1: 87.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{\left(b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}\right) \cdot -0.5}{a}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-72}:\\ \;\;\;\;\frac{0.5}{\frac{1}{\frac{a}{-a} \cdot \frac{c \cdot 4}{b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.8e+72)
   (- (/ c b) (/ b a))
   (if (<= b 2.3e-254)
     (/ (* (- b (sqrt (- (* b b) (* a (* c 4.0))))) -0.5) a)
     (if (<= b 1.75e-72)
       (/
        0.5
        (/
         1.0
         (*
          (/ a (- a))
          (/ (* c 4.0) (+ b (hypot (sqrt (* a (* c -4.0))) b))))))
       (/ (- c) b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.8e+72) {
		tmp = (c / b) - (b / a);
	} else if (b <= 2.3e-254) {
		tmp = ((b - sqrt(((b * b) - (a * (c * 4.0))))) * -0.5) / a;
	} else if (b <= 1.75e-72) {
		tmp = 0.5 / (1.0 / ((a / -a) * ((c * 4.0) / (b + hypot(sqrt((a * (c * -4.0))), b)))));
	} else {
		tmp = -c / b;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.8e+72) {
		tmp = (c / b) - (b / a);
	} else if (b <= 2.3e-254) {
		tmp = ((b - Math.sqrt(((b * b) - (a * (c * 4.0))))) * -0.5) / a;
	} else if (b <= 1.75e-72) {
		tmp = 0.5 / (1.0 / ((a / -a) * ((c * 4.0) / (b + Math.hypot(Math.sqrt((a * (c * -4.0))), b)))));
	} else {
		tmp = -c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4.8e+72:
		tmp = (c / b) - (b / a)
	elif b <= 2.3e-254:
		tmp = ((b - math.sqrt(((b * b) - (a * (c * 4.0))))) * -0.5) / a
	elif b <= 1.75e-72:
		tmp = 0.5 / (1.0 / ((a / -a) * ((c * 4.0) / (b + math.hypot(math.sqrt((a * (c * -4.0))), b)))))
	else:
		tmp = -c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.8e+72)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 2.3e-254)
		tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0))))) * -0.5) / a);
	elseif (b <= 1.75e-72)
		tmp = Float64(0.5 / Float64(1.0 / Float64(Float64(a / Float64(-a)) * Float64(Float64(c * 4.0) / Float64(b + hypot(sqrt(Float64(a * Float64(c * -4.0))), b))))));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -4.8e+72)
		tmp = (c / b) - (b / a);
	elseif (b <= 2.3e-254)
		tmp = ((b - sqrt(((b * b) - (a * (c * 4.0))))) * -0.5) / a;
	elseif (b <= 1.75e-72)
		tmp = 0.5 / (1.0 / ((a / -a) * ((c * 4.0) / (b + hypot(sqrt((a * (c * -4.0))), b)))));
	else
		tmp = -c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4.8e+72], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-254], N[(N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.75e-72], N[(0.5 / N[(1.0 / N[(N[(a / (-a)), $MachinePrecision] * N[(N[(c * 4.0), $MachinePrecision] / N[(b + N[Sqrt[N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

\mathbf{elif}\;b \leq 1.75 \cdot 10^{-72}:\\
\;\;\;\;\frac{0.5}{\frac{1}{\frac{a}{-a} \cdot \frac{c \cdot 4}{b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}}}\\

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


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

    1. Initial program 55.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. neg-sub055.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified96.9%

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

    if -4.8000000000000002e72 < b < 2.2999999999999999e-254

    1. Initial program 83.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. neg-sub083.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}\right) \cdot \frac{-0.5}{a} \]
      9. associate-*l*83.3%

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

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

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

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

    if 2.2999999999999999e-254 < b < 1.75e-72

    1. Initial program 61.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. neg-sub061.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot -0.5}{-a}} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-in61.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.5}{\frac{-a}{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}}}} \]
    8. Step-by-step derivation
      1. flip--60.6%

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

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

      \[\leadsto \frac{0.5}{\frac{-a}{\color{blue}{\frac{b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}{b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}}}}} \]
    10. Step-by-step derivation
      1. metadata-eval60.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{-a}{\frac{0 - \left(-\color{blue}{\left(c \cdot a\right)} \cdot 4\right)}{b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}}}} \]
      9. distribute-rgt-neg-in66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{{\left(\frac{\frac{-a \cdot \left(c \cdot -4\right)}{b + \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4 + b \cdot b}}}{-a}\right)}^{-1}} \]
      9. associate-*r*67.3%

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

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

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

      \[\leadsto \frac{0.5}{\color{blue}{{\left(\frac{\frac{-a \cdot \left(c \cdot -4\right)}{b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}}{-a}\right)}^{-1}}} \]
    14. Step-by-step derivation
      1. unpow-167.3%

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

        \[\leadsto \frac{0.5}{\frac{1}{\color{blue}{\frac{-a \cdot \left(c \cdot -4\right)}{\left(-a\right) \cdot \left(b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)\right)}}}} \]
      3. distribute-rgt-neg-in66.5%

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

        \[\leadsto \frac{0.5}{\frac{1}{\color{blue}{\frac{a}{-a} \cdot \frac{-c \cdot -4}{b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}}}} \]
      5. distribute-rgt-neg-in80.3%

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

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

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

    if 1.75e-72 < b

    1. Initial program 10.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. neg-sub010.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{\left(b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}\right) \cdot -0.5}{a}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-72}:\\ \;\;\;\;\frac{0.5}{\frac{1}{\frac{a}{-a} \cdot \frac{c \cdot 4}{b + \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 2: 85.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+72}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.19999999999999963e72

    1. Initial program 55.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. neg-sub055.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified96.9%

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

    if -5.19999999999999963e72 < b < 2.3999999999999999e-74

    1. Initial program 78.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. neg-sub078.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \frac{-0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef78.0%

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

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}\right) \cdot \frac{-0.5}{a} \]
      9. associate-*l*78.0%

        \[\leadsto \left(b - \sqrt{b \cdot b - \color{blue}{a \cdot \left(c \cdot 4\right)}}\right) \cdot \frac{-0.5}{a} \]
    5. Applied egg-rr78.0%

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

    if 2.3999999999999999e-74 < b

    1. Initial program 10.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. neg-sub010.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{+72}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{-74}:\\ \;\;\;\;\left(b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 3: 85.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.50000000000000031e70

    1. Initial program 55.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. neg-sub055.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified96.9%

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

    if -7.50000000000000031e70 < b < 7.99999999999999998e-73

    1. Initial program 78.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. neg-sub078.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \frac{-0.5}{a}} \]
    4. Step-by-step derivation
      1. fma-udef78.0%

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

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}\right) \cdot \frac{-0.5}{a} \]
      9. associate-*l*78.0%

        \[\leadsto \left(b - \sqrt{b \cdot b - \color{blue}{a \cdot \left(c \cdot 4\right)}}\right) \cdot \frac{-0.5}{a} \]
    5. Applied egg-rr78.0%

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

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

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

    if 7.99999999999999998e-73 < b

    1. Initial program 10.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. neg-sub010.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{+70}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-73}:\\ \;\;\;\;\frac{\left(b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}\right) \cdot -0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 4: 80.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{-54}:\\
\;\;\;\;\frac{-b}{a}\\

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

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


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

    1. Initial program 65.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. neg-sub065.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified92.0%

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

    if -1.79999999999999988e-54 < b < 9.4999999999999991e-75

    1. Initial program 73.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. neg-sub073.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999991e-75 < b

    1. Initial program 10.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. neg-sub010.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-54}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-75}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{a \cdot \left(c \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 5: 80.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-55}:\\
\;\;\;\;\frac{-b}{a}\\

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

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


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

    1. Initial program 65.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. neg-sub065.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified92.0%

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

    if -1.54999999999999998e-55 < b < 1.25e-74

    1. Initial program 73.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. neg-sub073.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e-74 < b

    1. Initial program 10.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. neg-sub010.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{-55}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-74}:\\ \;\;\;\;\frac{-0.5 \cdot \left(b - \sqrt{a \cdot \left(c \cdot -4\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 6: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified69.6%

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

    if -4.999999999999985e-310 < b

    1. Initial program 23.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. neg-sub023.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 43.6% accurate, 19.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.00000000000000009e42

    1. Initial program 62.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. neg-sub062.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified49.0%

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

    if 2.00000000000000009e42 < b

    1. Initial program 7.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot -0.5}{-a}} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-in7.1%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{\frac{-a}{b - \color{blue}{\left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}}} \]
    9. Step-by-step derivation
      1. fma-def2.5%

        \[\leadsto \frac{0.5}{\frac{-a}{b - \color{blue}{\mathsf{fma}\left(2, \frac{c \cdot a}{b}, -1 \cdot b\right)}}} \]
      2. associate-*l/2.5%

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

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

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

        \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\left(\frac{c}{b} \cdot a\right) \cdot 2} - b\right)}} \]
      6. associate-/r/2.5%

        \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\frac{c}{\frac{b}{a}}} \cdot 2 - b\right)}} \]
      7. associate-/r/2.5%

        \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\frac{c}{\frac{\frac{b}{a}}{2}}} - b\right)}} \]
      8. associate-/l/2.5%

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

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

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

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

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

Alternative 8: 68.0% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{-b}{a}\\

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


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

    1. Initial program 70.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. neg-sub070.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified65.8%

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

    if 2.2999999999999999e-254 < b

    1. Initial program 19.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. neg-sub019.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified75.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 9: 10.8% 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 46.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. neg-sub046.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot -0.5}{-a}} \]
  6. Step-by-step derivation
    1. distribute-rgt-neg-in46.4%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{0.5}{\frac{-a}{b - \color{blue}{\left(2 \cdot \frac{c \cdot a}{b} + -1 \cdot b\right)}}} \]
  9. Step-by-step derivation
    1. fma-def34.0%

      \[\leadsto \frac{0.5}{\frac{-a}{b - \color{blue}{\mathsf{fma}\left(2, \frac{c \cdot a}{b}, -1 \cdot b\right)}}} \]
    2. associate-*l/35.6%

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

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

      \[\leadsto \frac{0.5}{\frac{-a}{b - \color{blue}{\left(2 \cdot \left(\frac{c}{b} \cdot a\right) - b\right)}}} \]
    5. *-commutative35.6%

      \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\left(\frac{c}{b} \cdot a\right) \cdot 2} - b\right)}} \]
    6. associate-/r/35.6%

      \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\frac{c}{\frac{b}{a}}} \cdot 2 - b\right)}} \]
    7. associate-/r/35.6%

      \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\color{blue}{\frac{c}{\frac{\frac{b}{a}}{2}}} - b\right)}} \]
    8. associate-/l/35.6%

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

      \[\leadsto \frac{0.5}{\frac{-a}{b - \left(\frac{c}{\frac{b}{\color{blue}{a \cdot 2}}} - b\right)}} \]
  10. Simplified35.6%

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  12. Final simplification10.8%

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

Developer target: 70.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023215 
(FPCore (a b c)
  :name "quadp (p42, positive)"
  :precision binary64

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

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