quadm (p42, negative)

Percentage Accurate: 52.0% → 86.1%
Time: 17.3s
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: 52.0% 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: 86.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ t_1 := c \cdot \left(a \cdot 4\right)\\ t_2 := \sqrt{b \cdot b - t_1}\\ t_3 := \sqrt{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{if}\;b \leq -2.2 \cdot 10^{+74}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-27}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{t_1}{b - t_2}}{a}\\ \mathbf{elif}\;b \leq -1.55 \cdot 10^{-106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-182}:\\ \;\;\;\;-0.5 \cdot \left(t_3 \cdot \frac{t_3}{a}\right)\\ \mathbf{elif}\;b \leq 10^{+128}:\\ \;\;\;\;-0.5 \cdot \frac{b + t_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b))
        (t_1 (* c (* a 4.0)))
        (t_2 (sqrt (- (* b b) t_1)))
        (t_3 (sqrt (+ b (hypot b (sqrt (* a (* c -4.0))))))))
   (if (<= b -2.2e+74)
     t_0
     (if (<= b -1.05e-27)
       (* -0.5 (/ (/ t_1 (- b t_2)) a))
       (if (<= b -1.55e-106)
         t_0
         (if (<= b 4.2e-182)
           (* -0.5 (* t_3 (/ t_3 a)))
           (if (<= b 1e+128) (* -0.5 (/ (+ b t_2) a)) (/ (- b) a))))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = c * (a * 4.0);
	double t_2 = sqrt(((b * b) - t_1));
	double t_3 = sqrt((b + hypot(b, sqrt((a * (c * -4.0))))));
	double tmp;
	if (b <= -2.2e+74) {
		tmp = t_0;
	} else if (b <= -1.05e-27) {
		tmp = -0.5 * ((t_1 / (b - t_2)) / a);
	} else if (b <= -1.55e-106) {
		tmp = t_0;
	} else if (b <= 4.2e-182) {
		tmp = -0.5 * (t_3 * (t_3 / a));
	} else if (b <= 1e+128) {
		tmp = -0.5 * ((b + t_2) / a);
	} else {
		tmp = -b / a;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = c * (a * 4.0);
	double t_2 = Math.sqrt(((b * b) - t_1));
	double t_3 = Math.sqrt((b + Math.hypot(b, Math.sqrt((a * (c * -4.0))))));
	double tmp;
	if (b <= -2.2e+74) {
		tmp = t_0;
	} else if (b <= -1.05e-27) {
		tmp = -0.5 * ((t_1 / (b - t_2)) / a);
	} else if (b <= -1.55e-106) {
		tmp = t_0;
	} else if (b <= 4.2e-182) {
		tmp = -0.5 * (t_3 * (t_3 / a));
	} else if (b <= 1e+128) {
		tmp = -0.5 * ((b + t_2) / a);
	} else {
		tmp = -b / a;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = -c / b
	t_1 = c * (a * 4.0)
	t_2 = math.sqrt(((b * b) - t_1))
	t_3 = math.sqrt((b + math.hypot(b, math.sqrt((a * (c * -4.0))))))
	tmp = 0
	if b <= -2.2e+74:
		tmp = t_0
	elif b <= -1.05e-27:
		tmp = -0.5 * ((t_1 / (b - t_2)) / a)
	elif b <= -1.55e-106:
		tmp = t_0
	elif b <= 4.2e-182:
		tmp = -0.5 * (t_3 * (t_3 / a))
	elif b <= 1e+128:
		tmp = -0.5 * ((b + t_2) / a)
	else:
		tmp = -b / a
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	t_1 = Float64(c * Float64(a * 4.0))
	t_2 = sqrt(Float64(Float64(b * b) - t_1))
	t_3 = sqrt(Float64(b + hypot(b, sqrt(Float64(a * Float64(c * -4.0))))))
	tmp = 0.0
	if (b <= -2.2e+74)
		tmp = t_0;
	elseif (b <= -1.05e-27)
		tmp = Float64(-0.5 * Float64(Float64(t_1 / Float64(b - t_2)) / a));
	elseif (b <= -1.55e-106)
		tmp = t_0;
	elseif (b <= 4.2e-182)
		tmp = Float64(-0.5 * Float64(t_3 * Float64(t_3 / a)));
	elseif (b <= 1e+128)
		tmp = Float64(-0.5 * Float64(Float64(b + t_2) / a));
	else
		tmp = Float64(Float64(-b) / a);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = -c / b;
	t_1 = c * (a * 4.0);
	t_2 = sqrt(((b * b) - t_1));
	t_3 = sqrt((b + hypot(b, sqrt((a * (c * -4.0))))));
	tmp = 0.0;
	if (b <= -2.2e+74)
		tmp = t_0;
	elseif (b <= -1.05e-27)
		tmp = -0.5 * ((t_1 / (b - t_2)) / a);
	elseif (b <= -1.55e-106)
		tmp = t_0;
	elseif (b <= 4.2e-182)
		tmp = -0.5 * (t_3 * (t_3 / a));
	elseif (b <= 1e+128)
		tmp = -0.5 * ((b + t_2) / a);
	else
		tmp = -b / a;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(b + N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -2.2e+74], t$95$0, If[LessEqual[b, -1.05e-27], N[(-0.5 * N[(N[(t$95$1 / N[(b - t$95$2), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.55e-106], t$95$0, If[LessEqual[b, 4.2e-182], N[(-0.5 * N[(t$95$3 * N[(t$95$3 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+128], N[(-0.5 * N[(N[(b + t$95$2), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-c}{b}\\
t_1 := c \cdot \left(a \cdot 4\right)\\
t_2 := \sqrt{b \cdot b - t_1}\\
t_3 := \sqrt{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\
\mathbf{if}\;b \leq -2.2 \cdot 10^{+74}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -1.05 \cdot 10^{-27}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{t_1}{b - t_2}}{a}\\

\mathbf{elif}\;b \leq -1.55 \cdot 10^{-106}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 4.2 \cdot 10^{-182}:\\
\;\;\;\;-0.5 \cdot \left(t_3 \cdot \frac{t_3}{a}\right)\\

\mathbf{elif}\;b \leq 10^{+128}:\\
\;\;\;\;-0.5 \cdot \frac{b + t_2}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -2.2000000000000001e74 or -1.05000000000000008e-27 < b < -1.54999999999999993e-106

    1. Initial program 8.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. *-commutative8.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e74 < b < -1.05000000000000008e-27

    1. Initial program 43.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. sub-neg43.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{b \cdot b - \left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}{a} \]
    10. Step-by-step derivation
      1. associate-+l-83.9%

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

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\left(b \cdot b - b \cdot b\right) + c \cdot \left(a \cdot 4\right)}{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}{a} \]
    12. Taylor expanded in b around 0 83.9%

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

    if -1.54999999999999993e-106 < b < 4.2000000000000001e-182

    1. Initial program 73.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. sub-neg73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e-182 < b < 1.0000000000000001e128

    1. Initial program 95.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. sub-neg95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e128 < b

    1. Initial program 60.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. *-commutative60.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{+74}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-27}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{c \cdot \left(a \cdot 4\right)}{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}{a}\\ \mathbf{elif}\;b \leq -1.55 \cdot 10^{-106}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-182}:\\ \;\;\;\;-0.5 \cdot \left(\sqrt{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)} \cdot \frac{\sqrt{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}}{a}\right)\\ \mathbf{elif}\;b \leq 10^{+128}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 2: 87.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;b \leq -1.1 \cdot 10^{-128}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{t_0}{b - t_1}}{a}\\

\mathbf{elif}\;b \leq 2.8 \cdot 10^{+128}:\\
\;\;\;\;-0.5 \cdot \frac{b + t_1}{a}\\

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


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

    1. Initial program 6.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. *-commutative6.1%

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

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000001e74 < b < -1.10000000000000005e-128

    1. Initial program 37.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. sub-neg37.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{b \cdot b - \left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}{a} \]
    10. Step-by-step derivation
      1. associate-+l-78.2%

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

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\left(b \cdot b - b \cdot b\right) + c \cdot \left(a \cdot 4\right)}{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}{a} \]
    12. Taylor expanded in b around 0 78.2%

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

    if -1.10000000000000005e-128 < b < 2.79999999999999983e128

    1. Initial program 86.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. sub-neg86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999983e128 < b

    1. Initial program 60.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. *-commutative60.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 19.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. *-commutative19.0%

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999953e-107 < b < 1.0000000000000001e128

    1. Initial program 86.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. sub-neg86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e128 < b

    1. Initial program 60.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. *-commutative60.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 19.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. *-commutative19.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999993e-106 < b < 1.6e-51

    1. Initial program 80.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. sub-neg80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6e-51 < b

    1. Initial program 75.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. *-commutative75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 43.2% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 13.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. *-commutative13.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000013e61 < b

    1. Initial program 67.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. *-commutative67.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 68.0% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 2.5% 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 55.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. *-commutative55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 55.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. *-commutative55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  11. Final simplification10.5%

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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