Quadratic roots, narrow range

Percentage Accurate: 56.0% → 91.5%
Time: 16.0s
Alternatives: 11
Speedup: 29.0×

Specification

?
\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\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 11 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: 56.0% accurate, 1.0× speedup?

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

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

Alternative 1: 91.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\frac{\frac{{b}^{2} - t_0}{\frac{a}{-0.5}}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 4 \cdot {\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}} - \frac{\frac{c}{b}}{\frac{b}{c}} \cdot \frac{a}{b}\right) - \frac{c}{b}\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma c (* a -4.0) (pow b 2.0))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.3242)
     (/ (/ (- (pow b 2.0) t_0) (/ a -0.5)) (+ b (sqrt t_0)))
     (+
      (* -2.0 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
      (-
       (-
        (*
         -0.25
         (/
          (+ (* 16.0 (* (pow a 4.0) (pow c 4.0))) (* 4.0 (pow (* a c) 4.0)))
          (* a (pow b 7.0))))
        (* (/ (/ c b) (/ b c)) (/ a b)))
       (/ c b))))))
double code(double a, double b, double c) {
	double t_0 = fma(c, (a * -4.0), pow(b, 2.0));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.3242) {
		tmp = ((pow(b, 2.0) - t_0) / (a / -0.5)) / (b + sqrt(t_0));
	} else {
		tmp = (-2.0 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + (((-0.25 * (((16.0 * (pow(a, 4.0) * pow(c, 4.0))) + (4.0 * pow((a * c), 4.0))) / (a * pow(b, 7.0)))) - (((c / b) / (b / c)) * (a / b))) - (c / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(c, Float64(a * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.3242)
		tmp = Float64(Float64(Float64((b ^ 2.0) - t_0) / Float64(a / -0.5)) / Float64(b + sqrt(t_0)));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(Float64(-0.25 * Float64(Float64(Float64(16.0 * Float64((a ^ 4.0) * (c ^ 4.0))) + Float64(4.0 * (Float64(a * c) ^ 4.0))) / Float64(a * (b ^ 7.0)))) - Float64(Float64(Float64(c / b) / Float64(b / c)) * Float64(a / b))) - Float64(c / b)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(a * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.3242], N[(N[(N[(N[Power[b, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] / N[(a / -0.5), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[(16.0 * N[(N[Power[a, 4.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c / b), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision] * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\
\;\;\;\;\frac{\frac{{b}^{2} - t_0}{\frac{a}{-0.5}}}{b + \sqrt{t_0}}\\

\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 4 \cdot {\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}} - \frac{\frac{c}{b}}{\frac{b}{c}} \cdot \frac{a}{b}\right) - \frac{c}{b}\right)\\


\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 4 a) c)))) (*.f64 2 a)) < -0.324199999999999988

    1. Initial program 85.2%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp80.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg81.1%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in81.1%

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

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*81.1%

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

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

        \[\leadsto \color{blue}{\frac{-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)}{-a \cdot 2}} \]
      2. div-inv81.0%

        \[\leadsto \color{blue}{\left(-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
    7. Applied egg-rr85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.324199999999999988 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 48.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. *-commutative48.5%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-2 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
    5. Step-by-step derivation
      1. unpow296.3%

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{\left(\left({a}^{2} \cdot {c}^{2}\right) \cdot -2\right)} \cdot \left(\left({a}^{2} \cdot {c}^{2}\right) \cdot -2\right)}{a \cdot {b}^{7}}\right)\right) \]
      4. swap-sqr96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{\left(\left({a}^{2} \cdot {c}^{2}\right) \cdot \left({a}^{2} \cdot {c}^{2}\right)\right) \cdot \left(-2 \cdot -2\right)}}{a \cdot {b}^{7}}\right)\right) \]
      5. pow-prod-down96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \left(\color{blue}{{\left(a \cdot c\right)}^{2}} \cdot \left({a}^{2} \cdot {c}^{2}\right)\right) \cdot \left(-2 \cdot -2\right)}{a \cdot {b}^{7}}\right)\right) \]
      6. pow-prod-down96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \left({\left(a \cdot c\right)}^{2} \cdot \color{blue}{{\left(a \cdot c\right)}^{2}}\right) \cdot \left(-2 \cdot -2\right)}{a \cdot {b}^{7}}\right)\right) \]
      7. pow-sqr96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{{\left(a \cdot c\right)}^{\left(2 \cdot 2\right)}} \cdot \left(-2 \cdot -2\right)}{a \cdot {b}^{7}}\right)\right) \]
      8. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{\color{blue}{4}} \cdot \left(-2 \cdot -2\right)}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot \color{blue}{4}}{a \cdot {b}^{7}}\right)\right) \]
    6. Applied egg-rr96.3%

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. times-frac96.3%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      7. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. pow196.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      10. pow-sqr96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      11. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      12. metadata-eval96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    8. Applied egg-rr96.3%

      \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \color{blue}{\left({\left(\frac{c}{b}\right)}^{2} \cdot \frac{a}{b}\right)} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    9. Step-by-step derivation
      1. unpow296.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      2. clear-num96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\frac{c}{b} \cdot \color{blue}{\frac{1}{\frac{b}{c}}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. un-div-inv96.3%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{\frac{\frac{c}{b}}{\frac{b}{c}}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    10. Applied egg-rr96.3%

      \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{\frac{\frac{c}{b}}{\frac{b}{c}}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\frac{\frac{{b}^{2} - \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)}{\frac{a}{-0.5}}}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 4 \cdot {\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}} - \frac{\frac{c}{b}}{\frac{b}{c}} \cdot \frac{a}{b}\right) - \frac{c}{b}\right)\\ \end{array} \]

Alternative 2: 89.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\frac{\frac{{b}^{2} - t_0}{\frac{a}{-0.5}}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-2 \cdot \left({a}^{2} \cdot {c}^{3}\right)}{{b}^{5}} - \frac{c}{b}\right) - \frac{a}{{b}^{3}} \cdot {c}^{2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma c (* a -4.0) (pow b 2.0))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.3242)
     (/ (/ (- (pow b 2.0) t_0) (/ a -0.5)) (+ b (sqrt t_0)))
     (-
      (- (/ (* -2.0 (* (pow a 2.0) (pow c 3.0))) (pow b 5.0)) (/ c b))
      (* (/ a (pow b 3.0)) (pow c 2.0))))))
double code(double a, double b, double c) {
	double t_0 = fma(c, (a * -4.0), pow(b, 2.0));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.3242) {
		tmp = ((pow(b, 2.0) - t_0) / (a / -0.5)) / (b + sqrt(t_0));
	} else {
		tmp = (((-2.0 * (pow(a, 2.0) * pow(c, 3.0))) / pow(b, 5.0)) - (c / b)) - ((a / pow(b, 3.0)) * pow(c, 2.0));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(c, Float64(a * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.3242)
		tmp = Float64(Float64(Float64((b ^ 2.0) - t_0) / Float64(a / -0.5)) / Float64(b + sqrt(t_0)));
	else
		tmp = Float64(Float64(Float64(Float64(-2.0 * Float64((a ^ 2.0) * (c ^ 3.0))) / (b ^ 5.0)) - Float64(c / b)) - Float64(Float64(a / (b ^ 3.0)) * (c ^ 2.0)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(a * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.3242], N[(N[(N[(N[Power[b, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] / N[(a / -0.5), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\
\;\;\;\;\frac{\frac{{b}^{2} - t_0}{\frac{a}{-0.5}}}{b + \sqrt{t_0}}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.324199999999999988

    1. Initial program 85.2%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp80.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg81.1%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in81.1%

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

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*81.1%

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

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

        \[\leadsto \color{blue}{\frac{-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)}{-a \cdot 2}} \]
      2. div-inv81.0%

        \[\leadsto \color{blue}{\left(-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
    7. Applied egg-rr85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.324199999999999988 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 48.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. *-commutative48.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg45.6%

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)\right) \cdot 0.5}}{a \cdot 2} \]
      5. *-commutative45.6%

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*45.6%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -4\right) \cdot a}\right)\right) \cdot 0.5}}{a \cdot 2} \]
    5. Applied egg-rr45.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{-2 \cdot \color{blue}{\left({c}^{3} \cdot {a}^{2}\right)}}{{b}^{5}} - \frac{c}{b}\right) - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      8. associate-/l*94.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\frac{\frac{{b}^{2} - \mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)}{\frac{a}{-0.5}}}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, {b}^{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-2 \cdot \left({a}^{2} \cdot {c}^{3}\right)}{{b}^{5}} - \frac{c}{b}\right) - \frac{a}{{b}^{3}} \cdot {c}^{2}\\ \end{array} \]

Alternative 3: 89.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right) \cdot \frac{1}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-2 \cdot \left({a}^{2} \cdot {c}^{3}\right)}{{b}^{5}} - \frac{c}{b}\right) - \frac{a}{{b}^{3}} \cdot {c}^{2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.3242)
   (* (- b (sqrt (fma b b (* a (* c -4.0))))) (/ 1.0 (* a -2.0)))
   (-
    (- (/ (* -2.0 (* (pow a 2.0) (pow c 3.0))) (pow b 5.0)) (/ c b))
    (* (/ a (pow b 3.0)) (pow c 2.0)))))
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.3242) {
		tmp = (b - sqrt(fma(b, b, (a * (c * -4.0))))) * (1.0 / (a * -2.0));
	} else {
		tmp = (((-2.0 * (pow(a, 2.0) * pow(c, 3.0))) / pow(b, 5.0)) - (c / b)) - ((a / pow(b, 3.0)) * pow(c, 2.0));
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.3242)
		tmp = Float64(Float64(b - sqrt(fma(b, b, Float64(a * Float64(c * -4.0))))) * Float64(1.0 / Float64(a * -2.0)));
	else
		tmp = Float64(Float64(Float64(Float64(-2.0 * Float64((a ^ 2.0) * (c ^ 3.0))) / (b ^ 5.0)) - Float64(c / b)) - Float64(Float64(a / (b ^ 3.0)) * (c ^ 2.0)));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.3242], N[(N[(b - N[Sqrt[N[(b * b + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\
\;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right) \cdot \frac{1}{a \cdot -2}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.324199999999999988

    1. Initial program 85.2%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp80.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg81.1%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in81.1%

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

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*81.1%

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

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

        \[\leadsto \color{blue}{\frac{-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)}{-a \cdot 2}} \]
      2. div-inv81.0%

        \[\leadsto \color{blue}{\left(-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
    7. Applied egg-rr85.3%

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

    if -0.324199999999999988 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 48.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. *-commutative48.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg45.6%

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)\right) \cdot 0.5}}{a \cdot 2} \]
      5. *-commutative45.6%

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*45.6%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -4\right) \cdot a}\right)\right) \cdot 0.5}}{a \cdot 2} \]
    5. Applied egg-rr45.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{-2 \cdot \color{blue}{\left({c}^{3} \cdot {a}^{2}\right)}}{{b}^{5}} - \frac{c}{b}\right) - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      8. associate-/l*94.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.3242:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right) \cdot \frac{1}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-2 \cdot \left({a}^{2} \cdot {c}^{3}\right)}{{b}^{5}} - \frac{c}{b}\right) - \frac{a}{{b}^{3}} \cdot {c}^{2}\\ \end{array} \]

Alternative 4: 85.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \frac{{b}^{2} - t_0}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma b b (* c (* a -4.0)))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.01)
     (* (/ 1.0 (* a -2.0)) (/ (- (pow b 2.0) t_0) (+ b (sqrt t_0))))
     (- (/ (- c) b) (* (/ a b) (pow (/ c b) 2.0))))))
double code(double a, double b, double c) {
	double t_0 = fma(b, b, (c * (a * -4.0)));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.01) {
		tmp = (1.0 / (a * -2.0)) * ((pow(b, 2.0) - t_0) / (b + sqrt(t_0)));
	} else {
		tmp = (-c / b) - ((a / b) * pow((c / b), 2.0));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(b, b, Float64(c * Float64(a * -4.0)))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.01)
		tmp = Float64(Float64(1.0 / Float64(a * -2.0)) * Float64(Float64((b ^ 2.0) - t_0) / Float64(b + sqrt(t_0))));
	else
		tmp = Float64(Float64(Float64(-c) / b) - Float64(Float64(a / b) * (Float64(c / b) ^ 2.0)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[b, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-c) / b), $MachinePrecision] - N[(N[(a / b), $MachinePrecision] * N[Power[N[(c / b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\
\;\;\;\;\frac{1}{a \cdot -2} \cdot \frac{{b}^{2} - t_0}{b + \sqrt{t_0}}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.0100000000000000002

    1. Initial program 82.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. *-commutative82.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp77.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)\right) \cdot 0.5}}{a \cdot 2} \]
      5. *-commutative78.0%

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -4\right) \cdot a}\right)\right) \cdot 0.5}}{a \cdot 2} \]
    5. Applied egg-rr78.0%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)}{-a \cdot 2}} \]
      2. div-inv77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0100000000000000002 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 45.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. *-commutative45.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out90.7%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. times-frac97.1%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      7. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. pow197.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      10. pow-sqr97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      11. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      12. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    8. Applied egg-rr90.7%

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

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

Alternative 5: 85.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\ \;\;\;\;\frac{\frac{1}{a} \cdot \left({b}^{2} - t_0\right)}{-2 \cdot \left(b + \sqrt{t_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma b b (* c (* a -4.0)))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.01)
     (/ (* (/ 1.0 a) (- (pow b 2.0) t_0)) (* -2.0 (+ b (sqrt t_0))))
     (- (/ (- c) b) (* (/ a b) (pow (/ c b) 2.0))))))
double code(double a, double b, double c) {
	double t_0 = fma(b, b, (c * (a * -4.0)));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.01) {
		tmp = ((1.0 / a) * (pow(b, 2.0) - t_0)) / (-2.0 * (b + sqrt(t_0)));
	} else {
		tmp = (-c / b) - ((a / b) * pow((c / b), 2.0));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(b, b, Float64(c * Float64(a * -4.0)))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.01)
		tmp = Float64(Float64(Float64(1.0 / a) * Float64((b ^ 2.0) - t_0)) / Float64(-2.0 * Float64(b + sqrt(t_0))));
	else
		tmp = Float64(Float64(Float64(-c) / b) - Float64(Float64(a / b) * (Float64(c / b) ^ 2.0)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(1.0 / a), $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(-2.0 * N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-c) / b), $MachinePrecision] - N[(N[(a / b), $MachinePrecision] * N[Power[N[(c / b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\
\;\;\;\;\frac{\frac{1}{a} \cdot \left({b}^{2} - t_0\right)}{-2 \cdot \left(b + \sqrt{t_0}\right)}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.0100000000000000002

    1. Initial program 82.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. *-commutative82.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp77.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)\right) \cdot 0.5}}{a \cdot 2} \]
      5. *-commutative78.0%

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -4\right) \cdot a}\right)\right) \cdot 0.5}}{a \cdot 2} \]
    5. Applied egg-rr78.0%

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

        \[\leadsto \color{blue}{\frac{-\left(\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5}\right)}{-a \cdot 2}} \]
      2. div-inv77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0100000000000000002 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 45.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. *-commutative45.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out90.7%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. times-frac97.1%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      7. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. pow197.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      10. pow-sqr97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      11. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      12. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    8. Applied egg-rr90.7%

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

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

Alternative 6: 85.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\ \;\;\;\;\frac{\frac{t_0 - {b}^{2}}{b + \sqrt{t_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma b b (* a (* c -4.0)))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.01)
     (/ (/ (- t_0 (pow b 2.0)) (+ b (sqrt t_0))) (* a 2.0))
     (- (/ (- c) b) (* (/ a b) (pow (/ c b) 2.0))))))
double code(double a, double b, double c) {
	double t_0 = fma(b, b, (a * (c * -4.0)));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.01) {
		tmp = ((t_0 - pow(b, 2.0)) / (b + sqrt(t_0))) / (a * 2.0);
	} else {
		tmp = (-c / b) - ((a / b) * pow((c / b), 2.0));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(b, b, Float64(a * Float64(c * -4.0)))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.01)
		tmp = Float64(Float64(Float64(t_0 - (b ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(-c) / b) - Float64(Float64(a / b) * (Float64(c / b) ^ 2.0)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * b + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(t$95$0 - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[((-c) / b), $MachinePrecision] - N[(N[(a / b), $MachinePrecision] * N[Power[N[(c / b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\
\;\;\;\;\frac{\frac{t_0 - {b}^{2}}{b + \sqrt{t_0}}}{a \cdot 2}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.0100000000000000002

    1. Initial program 82.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. *-commutative82.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{a \cdot 2} \]
      2. pow-to-exp77.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
      3. fma-neg78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{a \cdot 2} \]
      4. distribute-lft-neg-in78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)\right) \cdot 0.5}}{a \cdot 2} \]
      5. *-commutative78.0%

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

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

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{-4} \cdot a\right)\right)\right) \cdot 0.5}}{a \cdot 2} \]
      8. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -4\right) \cdot a}\right)\right) \cdot 0.5}}{a \cdot 2} \]
    5. Applied egg-rr78.0%

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

        \[\leadsto \frac{\color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, \left(c \cdot -4\right) \cdot a\right)\right) \cdot 0.5} + \left(-b\right)}}{a \cdot 2} \]
      2. flip-+77.9%

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

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

    if -0.0100000000000000002 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 45.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. *-commutative45.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out90.7%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. times-frac97.1%

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

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

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

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      7. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. pow197.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      10. pow-sqr97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      11. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      12. metadata-eval97.1%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    8. Applied egg-rr90.7%

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

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

Alternative 7: 85.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.01:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\

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


\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 4 a) c)))) (*.f64 2 a)) < -0.0100000000000000002

    1. Initial program 82.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. Simplified82.2%

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

      if -0.0100000000000000002 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

      1. Initial program 45.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. *-commutative45.7%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      5. Step-by-step derivation
        1. distribute-lft-out90.7%

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

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

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

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        3. times-frac97.1%

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

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

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

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        7. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        8. pow197.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        9. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        10. pow-sqr97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        11. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        12. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. Applied egg-rr90.7%

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

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

    Alternative 8: 85.5% accurate, 0.5× speedup?

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

      1. Initial program 82.1%

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

      if -0.0100000000000000002 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

      1. Initial program 45.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. *-commutative45.7%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      5. Step-by-step derivation
        1. distribute-lft-out90.7%

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

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

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

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        3. times-frac97.1%

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

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

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

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        7. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        8. pow197.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        9. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        10. pow-sqr97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        11. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
        12. metadata-eval97.1%

          \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. Applied egg-rr90.7%

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

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

    Alternative 9: 81.2% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (- (/ (- c) b) (* (/ a b) (pow (/ c b) 2.0))))
    double code(double a, double b, double c) {
    	return (-c / b) - ((a / b) * pow((c / b), 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 = (-c / b) - ((a / b) * ((c / b) ** 2.0d0))
    end function
    
    public static double code(double a, double b, double c) {
    	return (-c / b) - ((a / b) * Math.pow((c / b), 2.0));
    }
    
    def code(a, b, c):
    	return (-c / b) - ((a / b) * math.pow((c / b), 2.0))
    
    function code(a, b, c)
    	return Float64(Float64(Float64(-c) / b) - Float64(Float64(a / b) * (Float64(c / b) ^ 2.0)))
    end
    
    function tmp = code(a, b, c)
    	tmp = (-c / b) - ((a / b) * ((c / b) ^ 2.0));
    end
    
    code[a_, b_, c_] := N[(N[((-c) / b), $MachinePrecision] - N[(N[(a / b), $MachinePrecision] * N[Power[N[(c / b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2}
    \end{array}
    
    Derivation
    1. Initial program 53.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. *-commutative53.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. distribute-lft-out84.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
    7. Step-by-step derivation
      1. *-commutative92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{\color{blue}{{c}^{2} \cdot a}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      2. unpow392.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{{c}^{2} \cdot a}{\color{blue}{\left(b \cdot b\right) \cdot b}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      3. times-frac92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \color{blue}{\left(\frac{{c}^{2}}{b \cdot b} \cdot \frac{a}{b}\right)} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      4. unpow292.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\frac{\color{blue}{c \cdot c}}{b \cdot b} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      5. frac-times92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      6. pow192.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left(\color{blue}{{\left(\frac{c}{b}\right)}^{1}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      7. metadata-eval92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{c}{b}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      8. pow192.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{c}{b}\right)}^{1}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      9. metadata-eval92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\left({\left(\frac{c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      10. pow-sqr92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left(\color{blue}{{\left(\frac{c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      11. metadata-eval92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
      12. metadata-eval92.9%

        \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \left({\left(\frac{c}{b}\right)}^{\color{blue}{2}} \cdot \frac{a}{b}\right) + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 4}{a \cdot {b}^{7}}\right)\right) \]
    8. Applied egg-rr84.0%

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

      \[\leadsto \frac{-c}{b} - \frac{a}{b} \cdot {\left(\frac{c}{b}\right)}^{2} \]

    Alternative 10: 63.9% accurate, 29.0× 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(Float64(-c) / b)
    end
    
    function tmp = code(a, b, c)
    	tmp = -c / b;
    end
    
    code[a_, b_, c_] := N[((-c) / b), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{-c}{b}
    \end{array}
    
    Derivation
    1. Initial program 53.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. *-commutative53.4%

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

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

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

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

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

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

    Alternative 11: 1.6% accurate, 38.7× speedup?

    \[\begin{array}{l} \\ \frac{c}{b} \end{array} \]
    (FPCore (a b c) :precision binary64 (/ c b))
    double code(double a, double b, double c) {
    	return c / b;
    }
    
    real(8) function code(a, b, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        code = c / b
    end function
    
    public static double code(double a, double b, double c) {
    	return c / b;
    }
    
    def code(a, b, c):
    	return c / b
    
    function code(a, b, c)
    	return Float64(c / b)
    end
    
    function tmp = code(a, b, c)
    	tmp = c / b;
    end
    
    code[a_, b_, c_] := N[(c / b), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{c}{b}
    \end{array}
    
    Derivation
    1. Initial program 53.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. *-commutative53.4%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. div-inv66.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{a} \cdot \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b}\right)} \]
      9. associate-/l*66.2%

        \[\leadsto \frac{0.5}{a} \cdot \left(-2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}\right) \]
    8. Applied egg-rr66.2%

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

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

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{a}{-2 \cdot \frac{1}{\frac{\frac{b}{c}}{a}}}}} \]
      4. clear-num66.2%

        \[\leadsto \frac{0.5}{\frac{a}{-2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}} \]
      5. *-commutative66.2%

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

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

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

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

        \[\leadsto \frac{0.5}{\frac{a}{\color{blue}{\frac{c}{b} \cdot \left(a \cdot -2\right)}}} \]
      10. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \color{blue}{\sqrt{\left(a \cdot -2\right) \cdot \left(a \cdot -2\right)}}}} \]
      12. swap-sqr1.6%

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

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \sqrt{\color{blue}{{a}^{2}} \cdot \left(-2 \cdot -2\right)}}} \]
      14. metadata-eval1.6%

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \sqrt{{a}^{2} \cdot \color{blue}{4}}}} \]
      15. metadata-eval1.6%

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \sqrt{{a}^{2} \cdot \color{blue}{{2}^{2}}}}} \]
      16. unpow-prod-down1.6%

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \sqrt{\color{blue}{{\left(a \cdot 2\right)}^{2}}}}} \]
      17. unpow21.6%

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

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

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

        \[\leadsto \frac{0.5}{\frac{a}{\frac{c}{b} \cdot \color{blue}{\left(2 \cdot a\right)}}} \]
    10. Applied egg-rr1.6%

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

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\frac{a}{\frac{c}{b}}}{2 \cdot a}}} \]
      2. associate-/l*1.6%

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

        \[\leadsto \frac{0.5}{\frac{\color{blue}{a \cdot \frac{b}{c}}}{2 \cdot a}} \]
      4. *-commutative1.6%

        \[\leadsto \frac{0.5}{\frac{\color{blue}{\frac{b}{c} \cdot a}}{2 \cdot a}} \]
      5. associate-/l*1.6%

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

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

        \[\leadsto \frac{\color{blue}{1} \cdot a}{\frac{b}{c} \cdot a} \]
      8. *-lft-identity1.6%

        \[\leadsto \frac{\color{blue}{a}}{\frac{b}{c} \cdot a} \]
      9. associate-/l/1.6%

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

        \[\leadsto \frac{\color{blue}{1}}{\frac{b}{c}} \]
      11. associate-/r/1.6%

        \[\leadsto \color{blue}{\frac{1}{b} \cdot c} \]
      12. associate-*l/1.6%

        \[\leadsto \color{blue}{\frac{1 \cdot c}{b}} \]
      13. associate-*r/1.6%

        \[\leadsto \color{blue}{1 \cdot \frac{c}{b}} \]
      14. *-lft-identity1.6%

        \[\leadsto \color{blue}{\frac{c}{b}} \]
    12. Simplified1.6%

      \[\leadsto \color{blue}{\frac{c}{b}} \]
    13. Final simplification1.6%

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

    Reproduce

    ?
    herbie shell --seed 2023336 
    (FPCore (a b c)
      :name "Quadratic roots, narrow range"
      :precision binary64
      :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
      (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))