Quadratic roots, full range

Percentage Accurate: 52.1% → 85.9%
Time: 13.3s
Alternatives: 10
Speedup: 12.9×

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

    if -7.49999999999999965e121 < b < 5.09999999999999972e-92

    1. Initial program 85.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. sqr-neg85.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.09999999999999972e-92 < b

    1. Initial program 13.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{+121}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.1 \cdot 10^{-92}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 85.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{+120}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-92}:\\ \;\;\;\;\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 -1.6e+120)
   (- (/ c b) (/ b a))
   (if (<= b 5.2e-92)
     (/ (- (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 <= -1.6e+120) {
		tmp = (c / b) - (b / a);
	} else if (b <= 5.2e-92) {
		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 <= -1.6e+120)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 5.2e-92)
		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, -1.6e+120], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-92], 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 -1.6 \cdot 10^{+120}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-92}:\\
\;\;\;\;\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 < -1.59999999999999991e120

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

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

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

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

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

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

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

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

    if -1.59999999999999991e120 < b < 5.2e-92

    1. Initial program 85.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. Simplified85.2%

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

      if 5.2e-92 < b

      1. Initial program 13.8%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{+120}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-92}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 85.9% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{+120}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-93}:\\ \;\;\;\;\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 -7.8e+120)
       (- (/ c b) (/ b a))
       (if (<= b 5.8e-93)
         (/ (- (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 <= -7.8e+120) {
    		tmp = (c / b) - (b / a);
    	} else if (b <= 5.8e-93) {
    		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 <= (-7.8d+120)) then
            tmp = (c / b) - (b / a)
        else if (b <= 5.8d-93) 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 <= -7.8e+120) {
    		tmp = (c / b) - (b / a);
    	} else if (b <= 5.8e-93) {
    		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 <= -7.8e+120:
    		tmp = (c / b) - (b / a)
    	elif b <= 5.8e-93:
    		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 <= -7.8e+120)
    		tmp = Float64(Float64(c / b) - Float64(b / a));
    	elseif (b <= 5.8e-93)
    		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 <= -7.8e+120)
    		tmp = (c / b) - (b / a);
    	elseif (b <= 5.8e-93)
    		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, -7.8e+120], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.8e-93], 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 -7.8 \cdot 10^{+120}:\\
    \;\;\;\;\frac{c}{b} - \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 5.8 \cdot 10^{-93}:\\
    \;\;\;\;\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 < -7.7999999999999997e120

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

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

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

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

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

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

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

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

      if -7.7999999999999997e120 < b < 5.7999999999999997e-93

      1. Initial program 85.2%

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

      if 5.7999999999999997e-93 < b

      1. Initial program 13.8%

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

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

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

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

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

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

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

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

    Alternative 4: 80.7% accurate, 1.0× speedup?

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

      1. Initial program 68.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. *-commutative68.7%

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

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

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

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

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

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

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

      if -4.5e-61 < b < 1.7000000000000001e-92

      1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \sqrt{a \cdot \left(-4 \cdot c\right)} + \frac{0.5}{a} \cdot b} \]
      14. Step-by-step derivation
        1. distribute-lft-out73.7%

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

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

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

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

      if 1.7000000000000001e-92 < b

      1. Initial program 13.8%

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

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

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

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

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

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

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

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

    Alternative 5: 81.2% accurate, 1.0× speedup?

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

      1. Initial program 68.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. *-commutative68.7%

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

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

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

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

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

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

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

      if -1.54999999999999992e-63 < b < 1.3599999999999999e-93

      1. Initial program 80.1%

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

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

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

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

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

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

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

            \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b}{a \cdot 2} \]
        4. Applied egg-rr79.7%

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

          \[\leadsto \frac{\color{blue}{{\left(e^{0.25 \cdot \left(\log \left(-4 \cdot c\right) + -1 \cdot \log \left(\frac{1}{a}\right)\right)}\right)}^{2} - b}}{a \cdot 2} \]
        6. Simplified75.2%

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

        if 1.3599999999999999e-93 < b

        1. Initial program 13.8%

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

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

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

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

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

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

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

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

      Alternative 6: 67.8% accurate, 9.7× speedup?

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

        1. Initial program 72.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. *-commutative72.7%

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

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

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

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

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

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

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

        if -3.999999999999988e-310 < b

        1. Initial program 30.8%

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

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

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

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

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

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

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

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

      Alternative 7: 42.6% accurate, 12.9× speedup?

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

        1. Initial program 67.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. *-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. Add Preprocessing
        5. Taylor expanded in b around -inf 47.9%

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

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

            \[\leadsto \frac{\color{blue}{-b}}{a} \]
        7. Simplified47.9%

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

        if 6.5000000000000003e62 < b

        1. Initial program 10.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. Simplified10.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 67.7% accurate, 12.9× speedup?

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

          1. Initial program 72.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. *-commutative72.9%

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

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

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

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

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

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

          if 6.7999999999999996e-306 < b

          1. Initial program 30.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. *-commutative30.3%

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

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

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

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

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

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

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

        Alternative 9: 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 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{b}{a} \]
          9. Add Preprocessing

          Alternative 10: 10.7% 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 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{c}{b}} \]
            8. Final simplification12.1%

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

            Reproduce

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