Average Error: 33.8 → 10.3
Time: 43.0s
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}\;b/2 \le -1.2181492333459528 \cdot 10^{-63}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b/2}{c}} - \left(b/2 + b/2\right)}\\ \mathbf{if}\;b/2 \le 9.622889278670843 \cdot 10^{+25}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{c}{b/2}\right) \cdot \frac{1}{2} + \left(\left(-\frac{b/2}{a}\right) - \frac{b/2}{a}\right))_*\\ \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 b/2 < -1.2181492333459528e-63

    1. Initial program 53.3

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Taylor expanded around -inf 18.8

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - 2 \cdot b/2}}}{a}\]
    6. Applied simplify8.1

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

    if -1.2181492333459528e-63 < b/2 < 9.622889278670843e+25

    1. Initial program 14.5

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num14.6

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

    if 9.622889278670843e+25 < b/2

    1. Initial program 34.0

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

      \[\leadsto \frac{\left(-b/2\right) - \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}{a}\]
    3. Applied simplify6.4

      \[\leadsto \color{blue}{(\left(\frac{c}{b/2}\right) \cdot \frac{1}{2} + \left(\left(-\frac{b/2}{a}\right) - \frac{b/2}{a}\right))_*}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 43.0s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' +o rules:numerics
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))