Quadratic roots, full range

Percentage Accurate: 53.0% → 86.0%
Time: 12.3s
Alternatives: 8
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{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(Float64(4.0 * 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[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 53.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{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(Float64(4.0 * 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[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+105}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.5e+105)
   (- (/ b a))
   (if (<= b 7.5e-97)
     (/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0))
     (/ (- c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.5e+105) {
		tmp = -(b / a);
	} else if (b <= 7.5e-97) {
		tmp = (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.5e+105)
		tmp = Float64(-Float64(b / a));
	elseif (b <= 7.5e-97)
		tmp = Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+105], (-N[(b / a), $MachinePrecision]), If[LessEqual[b, 7.5e-97], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 52.3%

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

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

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

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

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

    if -4.5000000000000001e105 < b < 7.5e-97

    1. Initial program 79.9%

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

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

      if 7.5e-97 < b

      1. Initial program 18.7%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+105}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

    Alternative 2: 86.0% accurate, 1.0× speedup?

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

      1. Initial program 52.3%

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

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

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

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

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

      if -3.8e105 < b < 9.5000000000000002e-104

      1. Initial program 80.7%

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

      if 9.5000000000000002e-104 < b

      1. Initial program 18.6%

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

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

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

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

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

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

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

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

    Alternative 3: 81.0% accurate, 1.0× speedup?

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

      1. Initial program 72.3%

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

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

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

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

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

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

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

      if -1.40000000000000011e-103 < b < 9.1999999999999998e-104

      1. Initial program 66.2%

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

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

        \[\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. prod-diff65.6%

          \[\leadsto \frac{\left(-b\right) + \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 \cdot 2} \]
        2. *-commutative65.6%

          \[\leadsto \frac{\left(-b\right) + \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 \cdot 2} \]
        3. fma-def65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)} + -1 \cdot b}}{a \cdot 2} \]
      9. Step-by-step derivation
        1. distribute-rgt-out66.2%

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

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

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

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

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

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

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

      if 9.1999999999999998e-104 < b

      1. Initial program 18.6%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.4 \cdot 10^{-103}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 9.2 \cdot 10^{-104}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

    Alternative 4: 80.7% accurate, 1.0× speedup?

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

      1. Initial program 72.3%

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

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

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

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

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

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

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

      if -1.5e-103 < b < 4.40000000000000023e-104

      1. Initial program 66.2%

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

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

        \[\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. prod-diff65.6%

          \[\leadsto \frac{\left(-b\right) + \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 \cdot 2} \]
        2. *-commutative65.6%

          \[\leadsto \frac{\left(-b\right) + \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 \cdot 2} \]
        3. fma-def65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.5 \cdot \left(\frac{1}{a} \cdot \sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}\right)} \]
      9. Step-by-step derivation
        1. associate-*l/64.9%

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

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

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

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

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

          \[\leadsto 0.5 \cdot \frac{\sqrt{a \cdot \color{blue}{\left(-4 \cdot c\right)}}}{a} \]
      10. Simplified65.5%

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

      if 4.40000000000000023e-104 < b

      1. Initial program 18.6%

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

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

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

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

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

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

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

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

    Alternative 5: 43.9% accurate, 19.1× speedup?

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

      1. Initial program 63.4%

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

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

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

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

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

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

      if 1.4500000000000001e44 < b

      1. Initial program 13.0%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
      2. Step-by-step derivation
        1. *-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. Taylor expanded in b around inf 73.6%

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

          \[\leadsto \frac{-2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{a \cdot 2} \]
        2. associate-/r/70.1%

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

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

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

          \[\leadsto \frac{-2 \cdot \color{blue}{\frac{-a \cdot c}{-b}}}{a \cdot 2} \]
        3. add-sqr-sqrt0.0%

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}}{a \cdot 2} \]
        4. sqrt-unprod29.4%

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

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\sqrt{\color{blue}{b \cdot b}}}}{a \cdot 2} \]
        6. sqrt-prod29.1%

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}}{a \cdot 2} \]
        7. add-sqr-sqrt29.1%

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{b}}}{a \cdot 2} \]
      8. Applied egg-rr29.1%

        \[\leadsto \frac{-2 \cdot \color{blue}{\frac{-a \cdot c}{b}}}{a \cdot 2} \]
      9. Step-by-step derivation
        1. distribute-frac-neg29.1%

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

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

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

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

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

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

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

    Alternative 6: 68.1% accurate, 19.1× speedup?

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

      1. Initial program 70.6%

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

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

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

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

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

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

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

      if 7.49999999999999987e-298 < b

      1. Initial program 28.5%

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

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

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

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

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

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

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

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

    Alternative 7: 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 49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 10.9% 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 49.2%

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

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

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

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

          \[\leadsto \frac{-2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{a \cdot 2} \]
        2. associate-/r/28.2%

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

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

          \[\leadsto \frac{-2 \cdot \color{blue}{\frac{a \cdot c}{b}}}{a \cdot 2} \]
        2. frac-2neg27.9%

          \[\leadsto \frac{-2 \cdot \color{blue}{\frac{-a \cdot c}{-b}}}{a \cdot 2} \]
        3. add-sqr-sqrt1.0%

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}}{a \cdot 2} \]
        4. sqrt-unprod9.6%

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

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

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}}{a \cdot 2} \]
        7. add-sqr-sqrt10.3%

          \[\leadsto \frac{-2 \cdot \frac{-a \cdot c}{\color{blue}{b}}}{a \cdot 2} \]
      8. Applied egg-rr10.3%

        \[\leadsto \frac{-2 \cdot \color{blue}{\frac{-a \cdot c}{b}}}{a \cdot 2} \]
      9. Step-by-step derivation
        1. distribute-frac-neg10.3%

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

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

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

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

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

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

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

      Reproduce

      ?
      herbie shell --seed 2023335 
      (FPCore (a b c)
        :name "Quadratic roots, full range"
        :precision binary64
        (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))