Average Error: 34.4 → 5.6
Time: 32.3s
Precision: 64
Internal Precision: 2944
\[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -1.813301145786028 \cdot 10^{+155}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le 8.534380665980131 \cdot 10^{-265}:\\ \;\;\;\;\frac{c}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}\\ \mathbf{if}\;b/2 \le 1.7256352831247111 \cdot 10^{+65}:\\ \;\;\;\;\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b/2}{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 b/2 < -1.813301145786028e+155

    1. Initial program 62.9

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}}{a}\]
    3. Applied simplify0.0

      \[\leadsto \color{blue}{\frac{c}{b/2} \cdot \frac{-1}{2}}\]

    if -1.813301145786028e+155 < b/2 < 8.534380665980131e-265

    1. Initial program 33.0

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

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

      \[\leadsto \frac{1}{\frac{a}{\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}}}}}\]
    6. Applied associate-/r/33.2

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\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}} \cdot \left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right)}}\]
    7. Applied associate-/r*33.2

      \[\leadsto \color{blue}{\frac{\frac{1}{\frac{a}{\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}}}\]
    8. Applied simplify8.6

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

    if 8.534380665980131e-265 < b/2 < 1.7256352831247111e+65

    1. Initial program 9.3

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

    if 1.7256352831247111e+65 < b/2

    1. Initial program 41.8

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

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

Runtime

Time bar (total: 32.3s)Debug log

herbie shell --seed '#(151349756 408087815 228312487 2538703040 1980610373 1250971417)' 
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))