Quadratic roots, narrow range

Percentage Accurate: 56.3% → 99.6%
Time: 13.5s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 56.3% 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: 99.6% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  6. Applied egg-rr54.0%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. unpow1/356.6%

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-b\right)}^{2}} - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    3. add-sqr-sqrt56.7%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    5. pow-pow58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. associate-*l*58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    9. pow-pow58.3%

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. metadata-eval58.3%

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
  11. Step-by-step derivation
    1. *-un-lft-identity58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.8% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{a} \cdot t\_0}{2 \cdot \left(a \cdot \frac{c}{b} - 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 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0210000000000000013

    1. Initial program 81.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. *-commutative81.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    6. Applied egg-rr76.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/380.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 46.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/345.8%

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      5. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      6. metadata-eval47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      7. associate-*l*47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      9. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      10. metadata-eval47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - \color{blue}{4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    10. Applied egg-rr47.5%

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. *-un-lft-identity47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}} \]
    16. Step-by-step derivation
      1. distribute-lft-out--88.5%

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

        \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)} \]
    17. Simplified88.5%

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

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

Alternative 3: 85.7% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{a} \cdot t\_0}{2 \cdot \left(a \cdot \frac{c}{b} - 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 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0210000000000000013

    1. Initial program 81.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. *-commutative81.1%

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

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

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

    1. Initial program 46.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/345.8%

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      5. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      6. metadata-eval47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      7. associate-*l*47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      9. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      10. metadata-eval47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - \color{blue}{4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    10. Applied egg-rr47.5%

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. *-un-lft-identity47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}} \]
    16. Step-by-step derivation
      1. distribute-lft-out--88.5%

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

        \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)} \]
    17. Simplified88.5%

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

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

Alternative 4: 85.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := c \cdot \left(a \cdot 4\right)\\ t_1 := \frac{\sqrt{b \cdot b - t\_0} - b}{2 \cdot a}\\ \mathbf{if}\;t\_1 \leq -0.021:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot t\_0}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (* a 4.0))) (t_1 (/ (- (sqrt (- (* b b) t_0)) b) (* 2.0 a))))
   (if (<= t_1 -0.021) t_1 (/ (* (/ 0.5 a) t_0) (* 2.0 (- (* a (/ c b)) b))))))
double code(double a, double b, double c) {
	double t_0 = c * (a * 4.0);
	double t_1 = (sqrt(((b * b) - t_0)) - b) / (2.0 * a);
	double tmp;
	if (t_1 <= -0.021) {
		tmp = t_1;
	} else {
		tmp = ((0.5 / a) * t_0) / (2.0 * ((a * (c / b)) - b));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = c * (a * 4.0d0)
    t_1 = (sqrt(((b * b) - t_0)) - b) / (2.0d0 * a)
    if (t_1 <= (-0.021d0)) then
        tmp = t_1
    else
        tmp = ((0.5d0 / a) * t_0) / (2.0d0 * ((a * (c / b)) - b))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = c * (a * 4.0);
	double t_1 = (Math.sqrt(((b * b) - t_0)) - b) / (2.0 * a);
	double tmp;
	if (t_1 <= -0.021) {
		tmp = t_1;
	} else {
		tmp = ((0.5 / a) * t_0) / (2.0 * ((a * (c / b)) - b));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = c * (a * 4.0)
	t_1 = (math.sqrt(((b * b) - t_0)) - b) / (2.0 * a)
	tmp = 0
	if t_1 <= -0.021:
		tmp = t_1
	else:
		tmp = ((0.5 / a) * t_0) / (2.0 * ((a * (c / b)) - b))
	return tmp
function code(a, b, c)
	t_0 = Float64(c * Float64(a * 4.0))
	t_1 = Float64(Float64(sqrt(Float64(Float64(b * b) - t_0)) - b) / Float64(2.0 * a))
	tmp = 0.0
	if (t_1 <= -0.021)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(0.5 / a) * t_0) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = c * (a * 4.0);
	t_1 = (sqrt(((b * b) - t_0)) - b) / (2.0 * a);
	tmp = 0.0;
	if (t_1 <= -0.021)
		tmp = t_1;
	else
		tmp = ((0.5 / a) * t_0) / (2.0 * ((a * (c / b)) - b));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.021], t$95$1, N[(N[(N[(0.5 / a), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := c \cdot \left(a \cdot 4\right)\\
t_1 := \frac{\sqrt{b \cdot b - t\_0} - b}{2 \cdot a}\\
\mathbf{if}\;t\_1 \leq -0.021:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.5}{a} \cdot t\_0}{2 \cdot \left(a \cdot \frac{c}{b} - 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 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0210000000000000013

    1. Initial program 81.1%

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

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

    1. Initial program 46.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/345.8%

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      5. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      6. metadata-eval47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      7. associate-*l*47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      9. pow-pow47.5%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      10. metadata-eval47.5%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - \color{blue}{4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    10. Applied egg-rr47.5%

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. *-un-lft-identity47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}} \]
    16. Step-by-step derivation
      1. distribute-lft-out--88.5%

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

        \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)} \]
    17. Simplified88.5%

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

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

Alternative 5: 99.3% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  6. Applied egg-rr54.0%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. unpow1/356.6%

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-b\right)}^{2}} - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    3. add-sqr-sqrt56.7%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    5. pow-pow58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. associate-*l*58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    9. pow-pow58.3%

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. metadata-eval58.3%

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
  11. Step-by-step derivation
    1. *-un-lft-identity58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.3% accurate, 0.5× speedup?

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

\\
\frac{\frac{0.5}{a} \cdot \left(c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}}
\end{array}
Derivation
  1. Initial program 57.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  6. Applied egg-rr54.0%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. unpow1/356.6%

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-b\right)}^{2}} - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    3. add-sqr-sqrt56.7%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    5. pow-pow58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. associate-*l*58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    9. pow-pow58.3%

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. metadata-eval58.3%

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
  11. Step-by-step derivation
    1. *-un-lft-identity58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.4% accurate, 6.1× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  6. Applied egg-rr54.0%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. unpow1/356.6%

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-b\right)}^{2}} - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    3. add-sqr-sqrt56.7%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left(\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    5. pow-pow58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{\color{blue}{2}} - \left(4 \cdot a\right) \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{{b}^{6}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. associate-*l*58.3%

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    9. pow-pow58.3%

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{\color{blue}{{b}^{\left(6 \cdot 0.3333333333333333\right)}} - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. metadata-eval58.3%

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2} \]
  11. Step-by-step derivation
    1. *-un-lft-identity58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}} \]
  16. Step-by-step derivation
    1. distribute-lft-out--80.3%

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

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

    \[\leadsto \frac{\left(c \cdot \left(a \cdot 4\right)\right) \cdot \frac{0.5}{a}}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}} \]
  18. Final simplification80.3%

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

Alternative 8: 80.9% accurate, 8.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{a \cdot \left(-\frac{c \cdot c}{\color{blue}{b \cdot b}}\right) - c}{b} \]
    9. times-frac79.7%

      \[\leadsto \frac{a \cdot \left(-\color{blue}{\frac{c}{b} \cdot \frac{c}{b}}\right) - c}{b} \]
    10. unpow279.7%

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

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

      \[\leadsto \frac{a \cdot \left(-\color{blue}{\frac{c}{b} \cdot \frac{c}{b}}\right) - c}{b} \]
  12. Applied egg-rr79.7%

    \[\leadsto \frac{a \cdot \left(-\color{blue}{\frac{c}{b} \cdot \frac{c}{b}}\right) - c}{b} \]
  13. Final simplification79.7%

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

Alternative 9: 63.7% 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(c / Float64(-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 57.0%

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

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

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

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

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

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

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

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

Alternative 10: 3.2% accurate, 38.7× speedup?

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

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 57.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{{\left({b}^{\color{blue}{6}}\right)}^{0.3333333333333333} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  6. Applied egg-rr54.0%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{\left({b}^{6}\right)}^{0.3333333333333333}} - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. unpow1/356.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
    2. distribute-rgt1-in3.2%

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

      \[\leadsto \frac{0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
    4. mul0-lft3.2%

      \[\leadsto \frac{0.5 \cdot \color{blue}{0}}{a} \]
    5. metadata-eval3.2%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  13. Simplified3.2%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  14. Add Preprocessing

Reproduce

?
herbie shell --seed 2024157 
(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)))