quadp (p42, positive)

Percentage Accurate: 52.5% → 88.0%
Time: 12.0s
Alternatives: 10
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 10 alternatives:

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

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

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

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

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

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

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


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

    1. Initial program 49.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. neg-sub049.4%

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

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

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

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

        \[\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/49.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. Simplified49.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. Taylor expanded in b around -inf 95.9%

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

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

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

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

    if -1.09999999999999997e130 < b < -1.51999999999999994e-233

    1. Initial program 90.4%

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

    if -1.51999999999999994e-233 < b < 2.1e21

    1. Initial program 64.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-sub064.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-64.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-neg64.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-164.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. *-commutative64.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/64.7%

        \[\leadsto \color{blue}{\left(b - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \cdot \frac{-1}{2 \cdot a}} \]
    3. Simplified64.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. Step-by-step derivation
      1. *-commutative64.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e21 < b

    1. Initial program 11.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-sub011.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-11.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-neg11.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-111.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. *-commutative11.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/11.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. Simplified11.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 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+130}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq -1.52 \cdot 10^{-233}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+21}:\\ \;\;\;\;\frac{c \cdot -2}{b + \mathsf{hypot}\left(\sqrt{\left(c \cdot a\right) \cdot -4}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 2: 88.0% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 49.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. neg-sub049.4%

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

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

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

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

        \[\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/49.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. Simplified49.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. Taylor expanded in b around -inf 95.9%

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

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

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

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

    if -8e129 < b < 4.2999999999999996e-276

    1. Initial program 89.4%

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

    if 4.2999999999999996e-276 < b < 6e20

    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.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. Simplified61.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. *-commutative61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{c \cdot -2}}{b + \mathsf{hypot}\left(\sqrt{-4 \cdot \left(c \cdot a\right)}, b\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u66.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c \cdot -2}{b + \mathsf{hypot}\left(\sqrt{-4 \cdot \left(c \cdot a\right)}, b\right)}\right)\right)} \]
      2. expm1-udef30.3%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-2} \cdot \frac{c}{b + \mathsf{hypot}\left(\sqrt{-4 \cdot \left(c \cdot a\right)}, b\right)}\right)} - 1 \]
    12. Applied egg-rr30.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-2 \cdot \frac{c}{b + \mathsf{hypot}\left(\sqrt{-4 \cdot \left(c \cdot a\right)}, b\right)}\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def66.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-2 \cdot \frac{c}{b + \mathsf{hypot}\left(\sqrt{-4 \cdot \left(c \cdot a\right)}, b\right)}\right)\right)} \]
      2. expm1-log1p87.3%

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

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

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

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

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

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

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

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

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

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

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

    if 6e20 < b

    1. Initial program 11.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-sub011.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-11.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-neg11.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-111.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. *-commutative11.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/11.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. Simplified11.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 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8 \cdot 10^{+129}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-276}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{+20}:\\ \;\;\;\;c \cdot \frac{-2}{b + \mathsf{hypot}\left(\sqrt{c \cdot \left(a \cdot -4\right)}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 3: 83.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 5.2 \cdot 10^{+20}:\\
\;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\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.5999999999999995e129

    1. Initial program 49.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. neg-sub049.4%

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

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

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

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

        \[\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/49.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. Simplified49.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. Taylor expanded in b around -inf 95.9%

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

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

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

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

    if -5.5999999999999995e129 < b < 5.2e20

    1. Initial program 78.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. /-rgt-identity78.7%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 4}\right)} - b\right) \cdot \frac{--1}{2 \cdot a} \]
      9. distribute-rgt-neg-in78.5%

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

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

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

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

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

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

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

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

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

    if 5.2e20 < b

    1. Initial program 11.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-sub011.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-11.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-neg11.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-111.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. *-commutative11.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/11.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. Simplified11.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 93.2%

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

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

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

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

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

Alternative 4: 84.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 49.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. neg-sub049.4%

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

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

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

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

        \[\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/49.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. Simplified49.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. Taylor expanded in b around -inf 95.9%

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

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

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

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

    if -1.0000000000000001e130 < b < 2.05e20

    1. Initial program 78.7%

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

    if 2.05e20 < b

    1. Initial program 11.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-sub011.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-11.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-neg11.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-111.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. *-commutative11.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/11.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. Simplified11.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 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+130}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 5: 80.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-80}:\\
\;\;\;\;\left(b - \sqrt{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 < -1.1499999999999999e-93

    1. Initial program 73.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-sub073.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-73.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-neg73.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-173.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. *-commutative73.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/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.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 85.3%

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

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

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

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

    if -1.1499999999999999e-93 < b < 2.6000000000000001e-80

    1. Initial program 75.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-sub075.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-75.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-neg75.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-175.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. *-commutative75.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/75.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. Simplified75.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 a around inf 72.3%

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

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

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

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

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

    if 2.6000000000000001e-80 < b

    1. Initial program 21.5%

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

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

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

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

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

        \[\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/21.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. Simplified21.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 82.6%

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

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

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

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

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

Alternative 6: 67.4% 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 75.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. neg-sub075.4%

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

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

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

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

        \[\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/75.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. Simplified75.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.1%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 35.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-sub035.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-35.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-neg35.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-135.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. *-commutative35.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/35.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. Simplified35.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 66.4%

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

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

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

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

    \[\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: 41.9% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 67.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. neg-sub067.4%

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

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

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

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

        \[\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/67.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. Simplified67.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 45.6%

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

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

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

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

    if 7.00000000000000046e101 < b

    1. Initial program 6.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-sub06.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-6.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-neg6.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-16.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. *-commutative6.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/6.7%

        \[\leadsto \color{blue}{\left(b - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \cdot \frac{-1}{2 \cdot a}} \]
    3. Simplified6.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 2.6%

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

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

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

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

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

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

Alternative 8: 67.3% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 75.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. neg-sub075.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-75.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-neg75.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-175.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. *-commutative75.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/75.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. Simplified75.4%

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

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

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

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

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

    if 2.75000000000000003e-301 < b

    1. Initial program 35.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-sub035.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-35.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-neg35.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-135.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. *-commutative35.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/35.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. Simplified35.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 66.9%

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

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

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

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

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

Alternative 9: 2.6% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 56.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. /-rgt-identity56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 10.4% 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 56.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-sub056.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-56.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-neg56.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-156.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. *-commutative56.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/55.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. Simplified55.8%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  8. Final simplification8.4%

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

Developer target: 71.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 2023222 
(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)))