Quadratic roots, narrow range

Percentage Accurate: 55.2% → 99.3%
Time: 13.3s
Alternatives: 8
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 8 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: 55.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.3% accurate, 0.5× speedup?

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

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

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

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

    \[\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. neg-sub058.2%

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

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

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

      \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    5. add-sqr-sqrt56.9%

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

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    10. sub-neg1.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    11. neg-sub01.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    12. add-sqr-sqrt0.0%

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    16. add-sqr-sqrt58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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. associate--r-99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 89.2%

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

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

      \[\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 -46 < (/.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 54.9%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      5. add-sqr-sqrt53.5%

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

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

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

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      10. sub-neg1.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      11. neg-sub01.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      14. sqr-neg54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}{\frac{-{b}^{2}}{b} - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. Applied egg-rr56.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. associate--r-99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 89.2%

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

    if -46 < (/.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 54.9%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      5. add-sqr-sqrt53.5%

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

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

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

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      10. sub-neg1.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      11. neg-sub01.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      14. sqr-neg54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}{\frac{-{b}^{2}}{b} - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    10. Applied egg-rr56.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. associate--r-99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 81.5%

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

    if -0.094 < (/.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 50.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      10. sub-neg1.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      11. neg-sub01.6%

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      12. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
      16. add-sqr-sqrt50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. associate--r-99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.1% accurate, 5.3× speedup?

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

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

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

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

    \[\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. neg-sub058.2%

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

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

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

      \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    5. add-sqr-sqrt56.9%

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

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    10. sub-neg1.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    11. neg-sub01.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    12. add-sqr-sqrt0.0%

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    16. add-sqr-sqrt58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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. associate--r-99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.1% accurate, 6.1× speedup?

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

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

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

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

    \[\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. neg-sub058.2%

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

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

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

      \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    5. add-sqr-sqrt56.9%

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

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    10. sub-neg1.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    11. neg-sub01.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    12. add-sqr-sqrt0.0%

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    16. add-sqr-sqrt58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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. associate--r-99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 64.5% 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 58.2%

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

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

    \[\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 62.6%

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

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

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

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

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

Alternative 8: 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 58.2%

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

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

    \[\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. neg-sub058.2%

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

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

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

      \[\leadsto \frac{\frac{0 - \color{blue}{{b}^{2}}}{0 + b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    5. add-sqr-sqrt56.9%

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

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{0 + \color{blue}{\left(-b\right)}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    10. sub-neg1.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{0 - b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    11. neg-sub01.6%

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{-b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    12. add-sqr-sqrt0.0%

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

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

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

      \[\leadsto \frac{\frac{0 - {b}^{2}}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} \]
    16. add-sqr-sqrt58.0%

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

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

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

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

    \[\leadsto \color{blue}{0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
  10. 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} \]
  11. Simplified3.2%

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

Reproduce

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