Average Error: 33.5 → 9.3
Time: 9.7m
Precision: 64
Internal Precision: 3392
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -527818926895.3873:\\ \;\;\;\;\frac{c}{(\left(\frac{c}{b_2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(b_2 \cdot -2\right))_*}\\ \mathbf{if}\;b_2 \le -3.705461527675385 \cdot 10^{-80}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a}\\ \mathbf{if}\;b_2 \le -6.821177813634889 \cdot 10^{-105}:\\ \;\;\;\;\frac{c}{(\left(\frac{c}{b_2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(b_2 \cdot -2\right))_*}\\ \mathbf{if}\;b_2 \le 6.922413474805441 \cdot 10^{+112}:\\ \;\;\;\;\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -527818926895.3873 or -3.705461527675385e-80 < b_2 < -6.821177813634889e-105

    1. Initial program 53.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--53.9

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}\]
    4. Applied simplify26.3

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify26.3

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Taylor expanded around -inf 17.9

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\frac{1}{2} \cdot \frac{c \cdot a}{b_2} - 2 \cdot b_2}}}{a}\]
    7. Applied simplify6.7

      \[\leadsto \color{blue}{\frac{c}{(\left(\frac{c}{b_2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(b_2 \cdot -2\right))_*}}\]

    if -527818926895.3873 < b_2 < -3.705461527675385e-80

    1. Initial program 41.1

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--41.2

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}\]
    4. Applied simplify16.1

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify16.1

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]

    if -6.821177813634889e-105 < b_2 < 6.922413474805441e+112

    1. Initial program 11.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv11.9

      \[\leadsto \color{blue}{\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}}\]

    if 6.922413474805441e+112 < b_2

    1. Initial program 48.1

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Taylor expanded around inf 3.7

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 9.7m)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' +o rules:numerics
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))