Error: 34.0 → 5.3
Time: 25.7s
Precision: 64
Ground Truth: 128
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{cases} \frac{c}{b/2} \cdot \frac{-1}{2} & \text{when } b/2 \le -7.107724709955627 \cdot 10^{+136} \\ \frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}} & \text{when } b/2 \le 9.635810611632596 \cdot 10^{-305} \\ \frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a} & \text{when } b/2 \le 9.656800156747535 \cdot 10^{+100} \\ \frac{\frac{1}{2}}{b/2} \cdot c - 2 \cdot \frac{b/2}{a} & \text{otherwise} \end{cases}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

    if b/2 < -7.107724709955627e+136

    1. Initial program 61.3

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

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

      \[\leadsto \left(\frac{-1}{2} \cdot \frac{a \cdot c}{b/2}\right) \cdot \frac{1}{a}\]
    5. Taylor expanded around -inf 15.7

      \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{a \cdot c}{b/2}\right)} \cdot \frac{1}{a}\]
    6. Applied simplify 0.0

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

    if -7.107724709955627e+136 < b/2 < 9.635810611632596e-305

    1. Initial program 32.9

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

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

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

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

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

      \[\leadsto \frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}\]
    9. Taylor expanded around 0 8.0

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

    if 9.635810611632596e-305 < b/2 < 9.656800156747535e+100

    1. Initial program 8.8

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

    if 9.656800156747535e+100 < b/2

    1. Initial program 46.6

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{b/2} \cdot c - 2 \cdot \frac{b/2}{a}}\]
  1. Removed slow pow expressions

Runtime

Total time: 25.7s Debug log

Please report a bug with the following info:

herbie --seed '#(3401098667 3711380821 3658129563 336201726 698990018 4213686807)'
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1, negative"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))