Quadratic roots, narrow range

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

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

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

Alternative 1: 99.3% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-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}}{\sqrt{b} \cdot \left(-\sqrt{b}\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. add-sqr-sqrt57.5%

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

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

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

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

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

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

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

      \[\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. neg-mul-199.2%

      \[\leadsto \frac{\frac{\left(\color{blue}{-1 \cdot b} + 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} \]
    6. distribute-lft1-in99.2%

      \[\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} \]
    7. metadata-eval99.2%

      \[\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} \]
    8. mul0-lft99.2%

      \[\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} \]
    9. unpow299.2%

      \[\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} \]
    10. 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} \]
    11. *-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} \]
    12. 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} \]
    13. 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} \]
  10. 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} \]
  11. 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} \]
  12. Step-by-step derivation
    1. *-commutative99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.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 -0.2:\\ \;\;\;\;\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(c \cdot a\right)}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}{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)) -0.2)
   (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
   (/ (/ (* 4.0 (* c a)) (* 2.0 (- (* a (/ c 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)) <= -0.2) {
		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
	} else {
		tmp = ((4.0 * (c * a)) / (2.0 * ((a * (c / 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)) <= -0.2)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(4.0 * Float64(c * a)) / Float64(2.0 * Float64(Float64(a * Float64(c / 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], -0.2], 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[(4.0 * N[(c * a), $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}

\\
\begin{array}{l}
\mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{a \cdot 2} \leq -0.2:\\
\;\;\;\;\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(c \cdot a\right)}{2 \cdot \left(a \cdot \frac{c}{b} - 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.20000000000000001

    1. Initial program 84.4%

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

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

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

    if -0.20000000000000001 < (/.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 47.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. *-commutative47.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified47.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. add-sqr-sqrt46.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{{\left(-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}}{\sqrt{b} \cdot \left(-\sqrt{b}\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      7. add-sqr-sqrt48.8%

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

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

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

      \[\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} \]
    9. 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. neg-mul-199.3%

        \[\leadsto \frac{\frac{\left(\color{blue}{-1 \cdot b} + 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} \]
      6. distribute-lft1-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} \]
      7. 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} \]
      8. 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} \]
      9. 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} \]
      10. 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} \]
      11. *-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} \]
      12. 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} \]
      13. 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} \]
    10. 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} \]
    11. 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} \]
    12. Step-by-step derivation
      1. *-commutative99.3%

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

      \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(c \cdot a\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 88.4%

      \[\leadsto \frac{\frac{4 \cdot \left(c \cdot a\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--88.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{a \cdot 2} \leq -0.2:\\ \;\;\;\;\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(c \cdot a\right)}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.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 -0.2:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{4 \cdot \left(c \cdot a\right)}{2 \cdot \left(a \cdot \frac{c}{b} - 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.2)
     t_0
     (/ (/ (* 4.0 (* c a)) (* 2.0 (- (* a (/ c 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 <= -0.2) {
		tmp = t_0;
	} else {
		tmp = ((4.0 * (c * a)) / (2.0 * ((a * (c / 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 <= (-0.2d0)) then
        tmp = t_0
    else
        tmp = ((4.0d0 * (c * a)) / (2.0d0 * ((a * (c / 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 <= -0.2) {
		tmp = t_0;
	} else {
		tmp = ((4.0 * (c * a)) / (2.0 * ((a * (c / 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 <= -0.2:
		tmp = t_0
	else:
		tmp = ((4.0 * (c * a)) / (2.0 * ((a * (c / 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 <= -0.2)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(4.0 * Float64(c * a)) / Float64(2.0 * Float64(Float64(a * Float64(c / 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 <= -0.2)
		tmp = t_0;
	else
		tmp = ((4.0 * (c * a)) / (2.0 * ((a * (c / 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, -0.2], t$95$0, N[(N[(N[(4.0 * N[(c * a), $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}

\\
\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.2:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(c \cdot a\right)}{2 \cdot \left(a \cdot \frac{c}{b} - 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.20000000000000001

    1. Initial program 84.4%

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

    if -0.20000000000000001 < (/.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 47.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. *-commutative47.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified47.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. add-sqr-sqrt46.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{{\left(-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}}{\sqrt{b} \cdot \left(-\sqrt{b}\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
      7. add-sqr-sqrt48.8%

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

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

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

      \[\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} \]
    9. 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. neg-mul-199.3%

        \[\leadsto \frac{\frac{\left(\color{blue}{-1 \cdot b} + 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} \]
      6. distribute-lft1-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} \]
      7. 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} \]
      8. 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} \]
      9. 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} \]
      10. 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} \]
      11. *-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} \]
      12. 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} \]
      13. 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} \]
    10. 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} \]
    11. 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} \]
    12. Step-by-step derivation
      1. *-commutative99.3%

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

      \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(c \cdot a\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 88.4%

      \[\leadsto \frac{\frac{4 \cdot \left(c \cdot a\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--88.4%

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

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

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

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

Alternative 4: 99.3% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-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}}{\sqrt{b} \cdot \left(-\sqrt{b}\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. add-sqr-sqrt57.5%

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

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

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

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

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

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

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

      \[\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. neg-mul-199.2%

      \[\leadsto \frac{\frac{\left(\color{blue}{-1 \cdot b} + 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} \]
    6. distribute-lft1-in99.2%

      \[\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} \]
    7. metadata-eval99.2%

      \[\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} \]
    8. mul0-lft99.2%

      \[\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} \]
    9. unpow299.2%

      \[\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} \]
    10. 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} \]
    11. *-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} \]
    12. 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} \]
    13. 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} \]
  10. 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} \]
  11. 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} \]
  12. Step-by-step derivation
    1. *-commutative99.3%

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

    \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(c \cdot a\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(c \cdot a\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}}}{a \cdot 2} \]
  15. Add Preprocessing

Alternative 5: 82.0% accurate, 6.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{{\left(-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}}{\sqrt{b} \cdot \left(-\sqrt{b}\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a \cdot 2} \]
    7. add-sqr-sqrt57.5%

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

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

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

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

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

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

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

      \[\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. neg-mul-199.2%

      \[\leadsto \frac{\frac{\left(\color{blue}{-1 \cdot b} + 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} \]
    6. distribute-lft1-in99.2%

      \[\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} \]
    7. metadata-eval99.2%

      \[\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} \]
    8. mul0-lft99.2%

      \[\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} \]
    9. unpow299.2%

      \[\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} \]
    10. 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} \]
    11. *-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} \]
    12. 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} \]
    13. 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} \]
  10. 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} \]
  11. 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} \]
  12. Step-by-step derivation
    1. *-commutative99.3%

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

    \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(c \cdot a\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 80.2%

    \[\leadsto \frac{\frac{4 \cdot \left(c \cdot a\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--80.2%

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

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

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

Alternative 6: 64.4% 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 56.1%

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified56.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 63.7%

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

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

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

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

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

Alternative 7: 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 56.1%

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

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

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

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

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

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

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

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

Reproduce

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