Quadratic roots, full range

Percentage Accurate: 51.8% → 85.6%
Time: 13.2s
Alternatives: 9
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 51.8% 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.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;b \leq 6.4 \cdot 10^{-66}:\\
\;\;\;\;\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 < -2.74999999999999998e82

    1. Initial program 65.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. neg-sub065.1%

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}} \]
      8. /-rgt-identity64.9%

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

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

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

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

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

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

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

    if -2.74999999999999998e82 < b < 6.39999999999999963e-66

    1. Initial program 82.7%

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

    if 6.39999999999999963e-66 < b

    1. Initial program 10.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. neg-sub010.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 65.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. neg-sub065.1%

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}} \]
      8. /-rgt-identity64.9%

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

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

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

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

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

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

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

    if -2.74999999999999998e82 < b < 7.5000000000000005e-67

    1. Initial program 82.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. /-rgt-identity82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000005e-67 < b

    1. Initial program 10.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. neg-sub010.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 81.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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. neg-sub078.1%

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}} \]
      8. /-rgt-identity77.9%

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

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

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

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

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

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

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

    if -4.5e-92 < b < 9.9999999999999998e-67

    1. Initial program 76.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. /-rgt-identity76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e-67 < b

    1. Initial program 10.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. neg-sub010.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;b \leq 1.5 \cdot 10^{-67}:\\
\;\;\;\;\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 < -4.60000000000000032e-92

    1. Initial program 78.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. neg-sub078.1%

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}} \]
      8. /-rgt-identity77.9%

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

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

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

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

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

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

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

    if -4.60000000000000032e-92 < b < 1.50000000000000016e-67

    1. Initial program 76.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. add-sqr-sqrt75.8%

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{0.25}\right)}^{2}}}{2 \cdot a} \]
    4. Taylor expanded in b around 0 74.7%

      \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(-4 \cdot \left(c \cdot a\right)\right)}}^{0.25}\right)}^{2}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. associate-*r*74.7%

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

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

      \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(c \cdot -4\right) \cdot a\right)}}^{0.25}\right)}^{2}}{2 \cdot a} \]
    7. Taylor expanded in c around 0 33.0%

      \[\leadsto \color{blue}{0.5 \cdot \frac{{\left(e^{0.25 \cdot \left(\log c + \log \left(-4 \cdot a\right)\right)}\right)}^{2} - b}{a}} \]
    8. Step-by-step derivation
      1. metadata-eval33.0%

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

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

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

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

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

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

        \[\leadsto \frac{{1}^{0.3333333333333333}}{2} \cdot \frac{\color{blue}{{\left(c \cdot \left(-4 \cdot a\right)\right)}^{0.25} \cdot {\left(c \cdot \left(-4 \cdot a\right)\right)}^{0.25}} + \left(-b\right)}{a} \]
      8. pow-sqr75.0%

        \[\leadsto \frac{{1}^{0.3333333333333333}}{2} \cdot \frac{\color{blue}{{\left(c \cdot \left(-4 \cdot a\right)\right)}^{\left(2 \cdot 0.25\right)}} + \left(-b\right)}{a} \]
      9. metadata-eval75.0%

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

        \[\leadsto \frac{{1}^{0.3333333333333333}}{2} \cdot \frac{\color{blue}{\left(-b\right) + {\left(c \cdot \left(-4 \cdot a\right)\right)}^{0.5}}}{a} \]
      11. times-frac75.0%

        \[\leadsto \color{blue}{\frac{{1}^{0.3333333333333333} \cdot \left(\left(-b\right) + {\left(c \cdot \left(-4 \cdot a\right)\right)}^{0.5}\right)}{2 \cdot a}} \]
      12. *-commutative75.0%

        \[\leadsto \frac{{1}^{0.3333333333333333} \cdot \left(\left(-b\right) + {\left(c \cdot \left(-4 \cdot a\right)\right)}^{0.5}\right)}{\color{blue}{a \cdot 2}} \]
    9. Simplified75.0%

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

    if 1.50000000000000016e-67 < b

    1. Initial program 10.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. neg-sub010.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.2% accurate, 12.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\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 < -1.000000000000002e-309

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < b

    1. Initial program 29.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. neg-sub029.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 43.2% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5:\\
\;\;\;\;\frac{-b}{a}\\

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


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

    1. Initial program 71.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. neg-sub071.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.5 < b

    1. Initial program 9.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. neg-sub09.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.5:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]

Alternative 7: 68.0% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.1%

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}} \]
      8. /-rgt-identity78.9%

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

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

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

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

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

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

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

    if 7.4999999999999998e-308 < b

    1. Initial program 30.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 2.5% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 54.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. clear-num54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 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 54.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. neg-sub054.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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