Average Error: 33.6 → 8.1
Time: 19.2s
Precision: 64
Internal precision: 1920
\[\frac{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b2 \le -1.48170602986717 \cdot 10^{+22}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b2} - 2 \cdot \frac{b2}{a}\\ \mathbf{if}\;b2 \le 3.5271429953440576 \cdot 10^{-270}:\\ \;\;\;\;\left(\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{if}\;b2 \le 5.573681450579778 \cdot 10^{+158}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b2\right) - \sqrt{b2 \cdot b2 - a \cdot c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b2} \cdot \frac{-1}{2}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b2

Bits error versus c

Derivation

  1. Split input into 4 regimes.
  2. if b2 < -1.48170602986717e+22

    1. Initial program 35.2

      \[\frac{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv 35.4

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

      \[\leadsto \frac{1}{2} \cdot \frac{c}{b2} - 2 \cdot \frac{b2}{a}\]
    5. Taylor expanded around -inf 0.0

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{c}{b2} - 2 \cdot \frac{b2}{a}}\]

    if -1.48170602986717e+22 < b2 < 3.5271429953440576e-270

    1. Initial program 10.9

      \[\frac{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv 11.0

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

    if 3.5271429953440576e-270 < b2 < 5.573681450579778e+158

    1. Initial program 34.8

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b2\right)}^2 - {\left(\sqrt{b2 \cdot b2 - a \cdot c}\right)}^2}{\left(-b2\right) - \sqrt{b2 \cdot b2 - a \cdot c}}}}{a}\]
    4. Applied simplify 15.2

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

    if 5.573681450579778e+158 < b2

    1. Initial program 62.9

      \[\frac{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]
    2. Applied taylor 14.2

      \[\leadsto \frac{\frac{-1}{2} \cdot \frac{c \cdot a}{b2}}{a}\]
    3. Taylor expanded around inf 14.2

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b2}}}{a}\]
    4. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{c}{b2} \cdot \frac{-1}{2}}\]
  3. Recombined 4 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 19.2s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (a b2 c)
  :name "NMSE problem 3.2.1, positive"
  :pre (and (>= (* b2 b2) (* a c)) (!= a 0))
  (/ (+ (- b2) (sqrt (- (* b2 b2) (* a c)))) a))