Average Error: 33.9 → 10.8
Time: 1.2m
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}\;\frac{\frac{1}{2}}{b_2} \le -2.3176627957037425 \cdot 10^{+84}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le 2.616126632983543 \cdot 10^{-304}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}} - 2 \cdot b_2}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le 1.566027839658825 \cdot 10^{-161}:\\ \;\;\;\;\frac{c \cdot \frac{1}{2}}{b_2} - \frac{2}{\frac{a}{b_2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if (/ 1/2 b_2) < -2.3176627957037425e+84

    1. Initial program 22.2

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

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

    if -2.3176627957037425e+84 < (/ 1/2 b_2) < 2.616126632983543e-304

    1. Initial program 51.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--51.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 simplify25.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 simplify25.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 21.5

      \[\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 simplify10.1

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

    if 2.616126632983543e-304 < (/ 1/2 b_2) < 1.566027839658825e-161

    1. Initial program 60.9

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

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

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

    if 1.566027839658825e-161 < (/ 1/2 b_2)

    1. Initial program 9.6

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

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

Runtime

Time bar (total: 1.2m)Debug logProfile

herbie shell --seed 2018206 
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))