Quadratic roots, full range

Percentage Accurate: 51.4% → 74.9%
Time: 17.3s
Alternatives: 19
Speedup: 1.0×

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 19 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.4% 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: 74.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.4 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;{\left(-\sqrt[3]{\frac{c}{b}}\right)}^{3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.4e-7)
   (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
   (pow (- (cbrt (/ c b))) 3.0)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.4e-7) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = pow(-cbrt((c / b)), 3.0);
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.4e-7) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = Math.pow(-Math.cbrt((c / b)), 3.0);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.4e-7)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(-cbrt(Float64(c / b))) ^ 3.0;
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 1.4e-7], 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[Power[(-N[Power[N[(c / b), $MachinePrecision], 1/3], $MachinePrecision]), 3.0], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;{\left(-\sqrt[3]{\frac{c}{b}}\right)}^{3}\\


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

    1. Initial program 67.9%

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

    if 1.4000000000000001e-7 < b

    1. Initial program 12.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. *-commutative12.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right)\right)} \]
    8. Step-by-step derivation
      1. add-cube-cbrt2.5%

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

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

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

      \[\leadsto {\color{blue}{\left(-1 \cdot \sqrt[3]{\frac{c}{b}}\right)}}^{3} \]
    11. Step-by-step derivation
      1. mul-1-neg90.6%

        \[\leadsto {\color{blue}{\left(-\sqrt[3]{\frac{c}{b}}\right)}}^{3} \]
    12. Simplified90.6%

      \[\leadsto {\color{blue}{\left(-\sqrt[3]{\frac{c}{b}}\right)}}^{3} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.3%

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

Alternative 2: 52.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-c\right) - \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))))
   (if (<= t_0 5e+303) t_0 (/ (- (- c) (/ (* a (pow c 2.0)) (pow b 2.0))) b))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = (-c - ((a * pow(c, 2.0)) / pow(b, 2.0))) / 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) :: t_0
    real(8) :: tmp
    t_0 = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    if (t_0 <= 5d+303) then
        tmp = t_0
    else
        tmp = (-c - ((a * (c ** 2.0d0)) / (b ** 2.0d0))) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = (-c - ((a * Math.pow(c, 2.0)) / Math.pow(b, 2.0))) / b;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	tmp = 0
	if t_0 <= 5e+303:
		tmp = t_0
	else:
		tmp = (-c - ((a * math.pow(c, 2.0)) / math.pow(b, 2.0))) / b
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0))
	tmp = 0.0
	if (t_0 <= 5e+303)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(-c) - Float64(Float64(a * (c ^ 2.0)) / (b ^ 2.0))) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	tmp = 0.0;
	if (t_0 <= 5e+303)
		tmp = t_0;
	else
		tmp = (-c - ((a * (c ^ 2.0)) / (b ^ 2.0))) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+303], t$95$0, N[(N[((-c) - N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999997e303

    1. Initial program 58.9%

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

    if 4.9999999999999997e303 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 22.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. *-commutative22.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-c\right) - \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.7%

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

Alternative 3: 51.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left({\left(\frac{a}{b} - \frac{b}{c}\right)}^{3}\right)}^{0.3333333333333333}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))))
   (if (<= t_0 5e+303)
     t_0
     (/ 1.0 (pow (pow (- (/ a b) (/ b c)) 3.0) 0.3333333333333333)))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = 1.0 / pow(pow(((a / b) - (b / c)), 3.0), 0.3333333333333333);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    if (t_0 <= 5d+303) then
        tmp = t_0
    else
        tmp = 1.0d0 / ((((a / b) - (b / c)) ** 3.0d0) ** 0.3333333333333333d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = 1.0 / Math.pow(Math.pow(((a / b) - (b / c)), 3.0), 0.3333333333333333);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	tmp = 0
	if t_0 <= 5e+303:
		tmp = t_0
	else:
		tmp = 1.0 / math.pow(math.pow(((a / b) - (b / c)), 3.0), 0.3333333333333333)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0))
	tmp = 0.0
	if (t_0 <= 5e+303)
		tmp = t_0;
	else
		tmp = Float64(1.0 / ((Float64(Float64(a / b) - Float64(b / c)) ^ 3.0) ^ 0.3333333333333333));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	tmp = 0.0;
	if (t_0 <= 5e+303)
		tmp = t_0;
	else
		tmp = 1.0 / ((((a / b) - (b / c)) ^ 3.0) ^ 0.3333333333333333);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+303], t$95$0, N[(1.0 / N[Power[N[Power[N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left({\left(\frac{a}{b} - \frac{b}{c}\right)}^{3}\right)}^{0.3333333333333333}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999997e303

    1. Initial program 58.9%

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

    if 4.9999999999999997e303 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 22.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. *-commutative22.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    13. Step-by-step derivation
      1. add-cbrt-cube33.8%

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

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

        \[\leadsto \frac{1}{{\color{blue}{\left({\left(\frac{a}{b} - \frac{b}{c}\right)}^{3}\right)}}^{0.3333333333333333}} \]
    14. Applied egg-rr31.3%

      \[\leadsto \frac{1}{\color{blue}{{\left({\left(\frac{a}{b} - \frac{b}{c}\right)}^{3}\right)}^{0.3333333333333333}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.1%

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

Alternative 4: 55.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{\frac{a}{b} - \frac{b}{c}}\right)}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))))
   (if (<= t_0 5e+303) t_0 (/ 1.0 (pow (cbrt (- (/ a b) (/ b c))) 3.0)))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = 1.0 / pow(cbrt(((a / b) - (b / c))), 3.0);
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= 5e+303) {
		tmp = t_0;
	} else {
		tmp = 1.0 / Math.pow(Math.cbrt(((a / b) - (b / c))), 3.0);
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0))
	tmp = 0.0
	if (t_0 <= 5e+303)
		tmp = t_0;
	else
		tmp = Float64(1.0 / (cbrt(Float64(Float64(a / b) - Float64(b / c))) ^ 3.0));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+303], t$95$0, N[(1.0 / N[Power[N[Power[N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\sqrt[3]{\frac{a}{b} - \frac{b}{c}}\right)}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999997e303

    1. Initial program 58.9%

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

    if 4.9999999999999997e303 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 22.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. *-commutative22.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    13. Step-by-step derivation
      1. add-cube-cbrt46.9%

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

        \[\leadsto \frac{1}{\color{blue}{{\left(\sqrt[3]{\frac{a}{b} - \frac{b}{c}}\right)}^{3}}} \]
    14. Applied egg-rr46.9%

      \[\leadsto \frac{1}{\color{blue}{{\left(\sqrt[3]{\frac{a}{b} - \frac{b}{c}}\right)}^{3}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.9%

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

Alternative 5: 60.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{+112}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-2}\\


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

    1. Initial program 64.2%

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

    if 1.15e112 < b

    1. Initial program 5.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    12. Simplified92.2%

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    13. Step-by-step derivation
      1. inv-pow92.2%

        \[\leadsto \color{blue}{{\left(\frac{a}{b} - \frac{b}{c}\right)}^{-1}} \]
      2. add-sqr-sqrt51.3%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{a}{b} - \frac{b}{c}} \cdot \sqrt{\frac{a}{b} - \frac{b}{c}}\right)}}^{-1} \]
      3. unpow-prod-down51.3%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-1} \cdot {\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-1}} \]
    14. Applied egg-rr51.3%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-1} \cdot {\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-1}} \]
    15. Step-by-step derivation
      1. pow-sqr51.4%

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

        \[\leadsto {\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{\color{blue}{-2}} \]
    16. Simplified51.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{a}{b} - \frac{b}{c}}\right)}^{-2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.1%

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

Alternative 6: 59.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.22 \cdot 10^{+112}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;e^{-\log \left(\frac{a}{b} - \frac{b}{c}\right)}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.22e+112)
   (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
   (exp (- (log (- (/ a b) (/ b c)))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.22e+112) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = exp(-log(((a / b) - (b / c))));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 1.22d+112) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = exp(-log(((a / b) - (b / c))))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.22e+112) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = Math.exp(-Math.log(((a / b) - (b / c))));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.22e+112:
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = math.exp(-math.log(((a / b) - (b / c))))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.22e+112)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = exp(Float64(-log(Float64(Float64(a / b) - Float64(b / c)))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 1.22e+112)
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = exp(-log(((a / b) - (b / c))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.22e+112], 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[Exp[(-N[Log[N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.22 \cdot 10^{+112}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;e^{-\log \left(\frac{a}{b} - \frac{b}{c}\right)}\\


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

    1. Initial program 64.2%

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

    if 1.22e112 < b

    1. Initial program 5.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    12. Simplified92.2%

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    13. Step-by-step derivation
      1. add-exp-log65.2%

        \[\leadsto \color{blue}{e^{\log \left(\frac{1}{\frac{a}{b} - \frac{b}{c}}\right)}} \]
      2. log-rec48.9%

        \[\leadsto e^{\color{blue}{-\log \left(\frac{a}{b} - \frac{b}{c}\right)}} \]
    14. Applied egg-rr48.9%

      \[\leadsto \color{blue}{e^{-\log \left(\frac{a}{b} - \frac{b}{c}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.5%

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

Alternative 7: 51.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0)))
double code(double a, double b, double c) {
	return (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
}
function code(a, b, c)
	return Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0))
end
code[a_, b_, c_] := N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}
\end{array}
Derivation
  1. Initial program 49.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. *-commutative49.9%

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

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

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

Alternative 8: 52.8% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{a \cdot \left(c \cdot -4\right)} \cdot \frac{0.5}{a} - b \cdot \frac{0.5}{a}\\


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

    1. Initial program 69.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. *-commutative69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e-105 < b

    1. Initial program 37.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. *-commutative37.9%

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}} \cdot \frac{0.5}{a} - b \cdot \frac{0.5}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.0%

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

Alternative 9: 55.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 70.6%

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 72.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-neg72.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999948e-312 < b

    1. Initial program 28.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. *-commutative28.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    13. Step-by-step derivation
      1. frac-sub44.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{a \cdot c - b \cdot b}{b \cdot c}}} \]
      2. div-inv44.3%

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

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

      \[\leadsto \frac{1}{\color{blue}{\left(a \cdot c - {b}^{2}\right) \cdot \frac{1}{b \cdot c}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-311}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(a \cdot c - {b}^{2}\right) \cdot \frac{1}{c \cdot b}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 64.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-95}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\frac{-1}{b} - \frac{a \cdot c}{{b}^{3}}\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 8e-95)
   (- (/ c b) (/ b a))
   (* c (- (/ -1.0 b) (/ (* a c) (pow b 3.0))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 8e-95) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = c * ((-1.0 / b) - ((a * c) / pow(b, 3.0)));
	}
	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 <= 8d-95) then
        tmp = (c / b) - (b / a)
    else
        tmp = c * (((-1.0d0) / b) - ((a * c) / (b ** 3.0d0)))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 8e-95) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = c * ((-1.0 / b) - ((a * c) / Math.pow(b, 3.0)));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 8e-95:
		tmp = (c / b) - (b / a)
	else:
		tmp = c * ((-1.0 / b) - ((a * c) / math.pow(b, 3.0)))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 8e-95)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	else
		tmp = Float64(c * Float64(Float64(-1.0 / b) - Float64(Float64(a * c) / (b ^ 3.0))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 8e-95)
		tmp = (c / b) - (b / a);
	else
		tmp = c * ((-1.0 / b) - ((a * c) / (b ^ 3.0)));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 8e-95], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(-1.0 / b), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;c \cdot \left(\frac{-1}{b} - \frac{a \cdot c}{{b}^{3}}\right)\\


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

    1. Initial program 69.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. *-commutative69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999992e-95 < b

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

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

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

      \[\leadsto \color{blue}{c \cdot \left(-1 \cdot \frac{a \cdot c}{{b}^{3}} - \frac{1}{b}\right)} \]
    6. Step-by-step derivation
      1. associate-*r/78.7%

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

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

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

      \[\leadsto \color{blue}{c \cdot \left(\frac{a \cdot \left(-c\right)}{{b}^{3}} - \frac{1}{b}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-95}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\frac{-1}{b} - \frac{a \cdot c}{{b}^{3}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.4% accurate, 1.0× speedup?

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

\\
\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}
\end{array}
Derivation
  1. Initial program 49.9%

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

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

Alternative 12: 44.3% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

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

    if -9.99999999999948e-312 < b

    1. Initial program 28.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. *-commutative28.7%

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{b} - b\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-311}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(b - b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 35.6% accurate, 11.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.99999999999999973e-22

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified39.5%

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

    if -8.99999999999999973e-22 < a

    1. Initial program 56.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. *-commutative56.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto b \cdot \left(-\color{blue}{\frac{1}{a}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.8%

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

Alternative 14: 35.6% accurate, 11.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.4000000000000001e-22

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified39.5%

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

    if -4.4000000000000001e-22 < a

    1. Initial program 56.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. *-commutative56.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\color{blue}{-a}}{b}} \]
    12. Simplified41.2%

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

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

Alternative 15: 35.9% accurate, 12.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.25000000000000009e-243

    1. Initial program 49.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. *-commutative49.4%

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

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

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

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

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

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

    if 2.25000000000000009e-243 < a

    1. Initial program 50.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. *-commutative50.5%

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

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

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

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

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

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

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

Alternative 16: 35.8% accurate, 16.6× speedup?

\[\begin{array}{l} \\ \frac{c}{b} - \frac{b}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (- (/ c b) (/ b a)))
double code(double a, double b, double c) {
	return (c / b) - (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 = (c / b) - (b / a)
end function
public static double code(double a, double b, double c) {
	return (c / b) - (b / a);
}
def code(a, b, c):
	return (c / b) - (b / a)
function code(a, b, c)
	return Float64(Float64(c / b) - Float64(b / a))
end
function tmp = code(a, b, c)
	tmp = (c / b) - (b / a);
end
code[a_, b_, c_] := N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c}{b} - \frac{b}{a}
\end{array}
Derivation
  1. Initial program 49.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. *-commutative49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  11. Final simplification38.8%

    \[\leadsto \frac{c}{b} - \frac{b}{a} \]
  12. Add Preprocessing

Alternative 17: 35.8% accurate, 29.0× 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(Float64(-b) / a)
end
function tmp = code(a, b, c)
	tmp = -b / a;
end
code[a_, b_, c_] := N[((-b) / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{-b}{a}
\end{array}
Derivation
  1. Initial program 49.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. *-commutative49.9%

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

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

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

      \[\leadsto \color{blue}{-\frac{b}{a}} \]
    2. distribute-neg-frac238.8%

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

    \[\leadsto \color{blue}{\frac{b}{-a}} \]
  8. Final simplification38.8%

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

Alternative 18: 2.5% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 49.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. *-commutative49.9%

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

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

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

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

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

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

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

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

Alternative 19: 10.9% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 49.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. *-commutative49.9%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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