Average Error: 33.9 → 10.6
Time: 1.5m
Precision: 64
Internal Precision: 3456
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{-1}{2}}{b_2} \le -5.257779710211162 \cdot 10^{-73}:\\ \;\;\;\;\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{if}\;\frac{\frac{-1}{2}}{b_2} \le 4.0038907457539785 \cdot 10^{-306}:\\ \;\;\;\;(c \cdot \left(\frac{\frac{1}{2}}{b_2}\right) + \left(\frac{b_2}{\frac{a}{-2}}\right))_*\\ \mathbf{if}\;\frac{\frac{-1}{2}}{b_2} \le 3.37200368878405 \cdot 10^{+154}:\\ \;\;\;\;\frac{c}{(\left(\frac{c}{b_2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(b_2 \cdot -2\right))_*}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if (/ -1/2 b_2) < -5.257779710211162e-73 or 3.37200368878405e+154 < (/ -1/2 b_2)

    1. Initial program 11.2

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

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

    if -5.257779710211162e-73 < (/ -1/2 b_2) < 4.0038907457539785e-306

    1. Initial program 40.3

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

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

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

    if 4.0038907457539785e-306 < (/ -1/2 b_2) < 3.37200368878405e+154

    1. Initial program 49.9

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

      \[\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 simplify24.9

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

      \[\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 24.0

      \[\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 simplify12.5

      \[\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))_*}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 1.5m)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' +o rules:numerics
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))