Average Error: 33.8 → 6.9
Time: 43.2s
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 -3.59602107517978 \cdot 10^{+130}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le -2.0610253582781874 \cdot 10^{-258}:\\ \;\;\;\;\frac{c}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}\\ \mathbf{if}\;b/2 \le 1.762029297307501 \cdot 10^{+43}:\\ \;\;\;\;\left(\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b/2} - 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 < -3.59602107517978e+130

    1. Initial program 60.7

      \[\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 simplify2.0

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

    if -3.59602107517978e+130 < b/2 < -2.0610253582781874e-258

    1. Initial program 35.0

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

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

      \[\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/35.1

      \[\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 simplify7.4

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

    if -2.0610253582781874e-258 < b/2 < 1.762029297307501e+43

    1. Initial program 10.3

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

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

    if 1.762029297307501e+43 < b/2

    1. Initial program 35.7

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{c}{b/2} - 2 \cdot \frac{b/2}{a}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 43.2s)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' 
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))