Input Error: 38.2b
Output Error: 4.5b
Time: 48.1s
Precision: 64b
Ground Truth: 128b
\[\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 -1.8681440687605764 \cdot 10^{-97} \\ \left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right) \cdot \frac{1}{2 \cdot a} & \text{when } b \le 1.4221487181389516 \cdot 10^{+74} \\ \frac{c}{2} \cdot \frac{2}{b} - \frac{b}{a} & \text{otherwise} \end{cases}\]

Error

Bits error versus a
Bits error versus b
Bits error versus c

Derivation

    if b < -1.8681440687605764e-97

    1. Initial program 58.8b

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

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

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

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

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

    if -1.8681440687605764e-97 < b < 1.4221487181389516e+74

    1. Initial program 11.9b

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

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

    if 1.4221487181389516e+74 < b

    1. Initial program 42.0b

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

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

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

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

Runtime

Total time: 48.1s Debug log

herbie --seed '#(3210580112 2016943050 2736455008 1900213294 3045829802 3195281412)'
(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)))