Quadratic roots, full range

Percentage Accurate: 53.2% → 84.4%
Time: 10.8s
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: 53.2% 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: 84.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 59.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. *-commutative59.7%

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

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

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

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

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

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

    if -2.99999999999999984e108 < b < 1.1599999999999999e-92

    1. Initial program 87.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. *-commutative87.1%

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

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

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

    if 1.1599999999999999e-92 < b

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified89.9%

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

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

Alternative 2: 85.6% accurate, 0.5× speedup?

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

\mathbf{elif}\;b \leq 2.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, -4 \cdot c, 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 < -5.00000000000000004e154

    1. Initial program 39.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. *-commutative39.5%

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

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

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

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

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

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

    if -5.00000000000000004e154 < b < 2.4999999999999998e-78

    1. Initial program 88.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. *-commutative88.7%

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

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

    if 2.4999999999999998e-78 < b

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified89.9%

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

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

Alternative 3: 85.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-90}:\\ \;\;\;\;\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 -1e+153)
   (/ b (- a))
   (if (<= b 3.1e-90)
     (/ (- (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 <= -1e+153) {
		tmp = b / -a;
	} else if (b <= 3.1e-90) {
		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 <= (-1d+153)) then
        tmp = b / -a
    else if (b <= 3.1d-90) 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 <= -1e+153) {
		tmp = b / -a;
	} else if (b <= 3.1e-90) {
		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 <= -1e+153:
		tmp = b / -a
	elif b <= 3.1e-90:
		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 <= -1e+153)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 3.1e-90)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e+153)
		tmp = b / -a;
	elseif (b <= 3.1e-90)
		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, -1e+153], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 3.1e-90], 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 -1 \cdot 10^{+153}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{-90}:\\
\;\;\;\;\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 < -1e153

    1. Initial program 39.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. *-commutative39.5%

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

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

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

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

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

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

    if -1e153 < b < 3.1000000000000001e-90

    1. Initial program 88.7%

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

    if 3.1000000000000001e-90 < b

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified89.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-90}:\\ \;\;\;\;\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: 79.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-135}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-77}:\\ \;\;\;\;\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 -2.9e-135)
   (- (/ c b) (/ b a))
   (if (<= b 3.9e-77)
     (/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.9e-135) {
		tmp = (c / b) - (b / a);
	} else if (b <= 3.9e-77) {
		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 <= (-2.9d-135)) then
        tmp = (c / b) - (b / a)
    else if (b <= 3.9d-77) 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 <= -2.9e-135) {
		tmp = (c / b) - (b / a);
	} else if (b <= 3.9e-77) {
		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 <= -2.9e-135:
		tmp = (c / b) - (b / a)
	elif b <= 3.9e-77:
		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 <= -2.9e-135)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 3.9e-77)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2.9e-135)
		tmp = (c / b) - (b / a);
	elseif (b <= 3.9e-77)
		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, -2.9e-135], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-77], 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 -2.9 \cdot 10^{-135}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-77}:\\
\;\;\;\;\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 < -2.9000000000000002e-135

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

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

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

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

        \[\leadsto \color{blue}{-b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)} \]
      2. distribute-rgt-neg-in77.6%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right)\right)} \]
    8. Taylor expanded in a around inf 77.8%

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    10. Simplified77.8%

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

    if -2.9000000000000002e-135 < b < 3.89999999999999979e-77

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

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

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

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

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

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

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

    if 3.89999999999999979e-77 < b

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified89.9%

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

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

Alternative 5: 79.5% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

        \[\leadsto \color{blue}{-b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)} \]
      2. distribute-rgt-neg-in77.6%

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right)\right)} \]
    8. Taylor expanded in a around inf 77.8%

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    10. Simplified77.8%

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

    if -2.9000000000000002e-135 < b < 1.6999999999999999e-87

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{{\left({\left(a \cdot \left(c \cdot -4\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b}{a \cdot 2} \]
    9. Applied egg-rr85.1%

      \[\leadsto \frac{\color{blue}{{\left({\left(a \cdot \left(c \cdot -4\right)\right)}^{0.25}\right)}^{2}} - b}{a \cdot 2} \]
    10. Step-by-step derivation
      1. pow-pow85.5%

        \[\leadsto \frac{\color{blue}{{\left(a \cdot \left(c \cdot -4\right)\right)}^{\left(0.25 \cdot 2\right)}} - b}{a \cdot 2} \]
      2. metadata-eval85.5%

        \[\leadsto \frac{{\left(a \cdot \left(c \cdot -4\right)\right)}^{\color{blue}{0.5}} - b}{a \cdot 2} \]
      3. pow1/285.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e-87 < b

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified89.9%

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

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

Alternative 6: 66.5% accurate, 9.7× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right)\right)} \]
    8. Taylor expanded in a around inf 59.6%

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.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. *-commutative33.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified69.9%

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

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

Alternative 7: 66.2% accurate, 12.9× speedup?

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

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

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


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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified59.4%

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.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. *-commutative33.2%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified69.9%

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

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

Alternative 8: 42.8% accurate, 12.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

    if 3.3999999999999999e-11 < b

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

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

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

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

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

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

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

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

Alternative 9: 11.0% 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 53.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. *-commutative53.7%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  8. Add Preprocessing

Alternative 10: 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 53.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. *-commutative53.7%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  8. Add Preprocessing

Reproduce

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