Average Error: 34.2 → 5.4
Time: 16.1s
Precision: 64
Internal precision: 2944
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -1.718982199476945 \cdot 10^{+89}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le -2.321564696919607 \cdot 10^{-245}:\\ \;\;\;\;{\left(\sqrt[3]{\frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}\right)}^3\\ \mathbf{if}\;b/2 \le 9.141549925217606 \cdot 10^{+73}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}\\ \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.718982199476945e+89

    1. Initial program 59.3

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Applied taylor 15.8

      \[\leadsto \frac{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}{a}\]
    3. Taylor expanded around -inf 15.8

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}}{a}\]
    4. Applied simplify 0.0

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

    if -1.718982199476945e+89 < b/2 < -2.321564696919607e-245

    1. Initial program 33.6

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b/2\right)}^2 - {\left(\sqrt{{b/2}^2 - a \cdot c}\right)}^2}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
    4. Applied simplify 17.1

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt 17.8

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}}\right)}^3}\]
    7. Applied simplify 9.3

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

    if -2.321564696919607e-245 < b/2 < 9.141549925217606e+73

    1. Initial program 9.7

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

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

    if 9.141549925217606e+73 < b/2

    1. Initial program 42.4

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Applied taylor 0

      \[\leadsto -2 \cdot \frac{b/2}{a}\]
    3. 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: 16.1s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))