Average Error: 33.9 → 9.5
Time: 1.4m
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 -3.229110736231479 \cdot 10^{+103}:\\ \;\;\;\;\frac{\frac{c \cdot a}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le -1.9297075957165734 \cdot 10^{-20}:\\ \;\;\;\;\frac{c}{\frac{a \cdot \frac{1}{2}}{\frac{b_2}{c}} - 2 \cdot b_2}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le -1.0633375602846806 \cdot 10^{-60}:\\ \;\;\;\;\frac{\frac{c \cdot a}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le 9.836753507028132 \cdot 10^{-308}:\\ \;\;\;\;\frac{c}{\frac{a \cdot \frac{1}{2}}{\frac{b_2}{c}} - 2 \cdot b_2}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b_2} \le 4.107536829373578 \cdot 10^{-152}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \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

Derivation

  1. Split input into 4 regimes
  2. if (/ 1/2 b_2) < -3.229110736231479e+103 or -1.9297075957165734e-20 < (/ 1/2 b_2) < -1.0633375602846806e-60

    1. Initial program 26.1

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

      \[\leadsto \color{blue}{\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}}\]
    4. Using strategy rm
    5. Applied flip--26.3

      \[\leadsto \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}}} \cdot \frac{1}{a}\]
    6. Applied associate-*l/26.3

      \[\leadsto \color{blue}{\frac{\left(\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}\right) \cdot \frac{1}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    7. Applied simplify17.5

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

    if -3.229110736231479e+103 < (/ 1/2 b_2) < -1.9297075957165734e-20 or -1.0633375602846806e-60 < (/ 1/2 b_2) < 9.836753507028132e-308

    1. Initial program 52.5

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

      \[\leadsto \color{blue}{\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}}\]
    4. Using strategy rm
    5. Applied flip--52.6

      \[\leadsto \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}}} \cdot \frac{1}{a}\]
    6. Applied associate-*l/52.6

      \[\leadsto \color{blue}{\frac{\left(\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}\right) \cdot \frac{1}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    7. Applied simplify25.3

      \[\leadsto \frac{\color{blue}{\frac{c \cdot a}{a}}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    8. Taylor expanded around -inf 17.3

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

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

    if 9.836753507028132e-308 < (/ 1/2 b_2) < 4.107536829373578e-152

    1. Initial program 60.1

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

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

    if 4.107536829373578e-152 < (/ 1/2 b_2)

    1. Initial program 7.7

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' 
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))