Error: 35.9 → 6.0
Time: 45.9s
Precision: 64
Ground Truth: 128
\[\frac{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
\[\begin{cases} \frac{b + \left(-b\right)}{2 \cdot a} - \frac{c}{b} & \text{when } b \le -7.355523810646533 \cdot 10^{-17} \\ \frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a} & \text{when } b \le -1.4796916138221627 \cdot 10^{-93} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}{a \cdot 2} & \text{when } b \le 9.656800156747535 \cdot 10^{+100} \\ \frac{-b}{a} & \text{otherwise} \end{cases}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

    if b < -7.355523810646533e-17

    1. Initial program 58.0

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

      \[\leadsto \frac{\left(-b\right) - \left(2 \cdot \frac{a \cdot c}{b} - b\right)}{2 \cdot a}\]
    3. Taylor expanded around -inf 40.7

      \[\leadsto \frac{\left(-b\right) - \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} - b\right)}}{2 \cdot a}\]
    4. Applied simplify 0

      \[\leadsto \color{blue}{\frac{b + \left(-b\right)}{2 \cdot a} - \frac{c}{b \cdot 1}}\]
    5. Applied simplify 0

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

    if -7.355523810646533e-17 < b < -1.4796916138221627e-93

    1. Initial program 35.3

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

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

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

    if -1.4796916138221627e-93 < b < 9.656800156747535e+100

    1. Initial program 12.3

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

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

      \[\leadsto \left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right) \cdot \frac{1}{2 \cdot a}\]
    5. Taylor expanded around 0 12.4

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

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

    if 9.656800156747535e+100 < b

    1. Initial program 47.0

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

      \[\leadsto -1 \cdot \frac{b}{a}\]
    3. Taylor expanded around inf 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}}\]
    4. Applied simplify 0

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

Runtime

Total time: 45.9s Debug log

Please report a bug with the following info:

herbie --seed '#(271780363 724140849 4096135026 1182327035 2977206980 3365866325)'
(FPCore (a b c)
  :name "NMSE p42, negative"
  
  :target
  (if (< b 0) (/ c (* a (/ (+ (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)))) (/ (- (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)))(/ (- (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)))