Input Error: 34.6b
Output Error: 8.0b
Time: 41.0s
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}{a} & \text{when } b \le -2.4063664882097058 \cdot 10^{+146} \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{when } b \le 0.034260571810453756 \\ \frac{b + \left(-b\right)}{2 \cdot a} - \frac{c}{b} & \text{otherwise} \end{cases}\]

Error

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

Derivation

    if b < -2.4063664882097058e+146

    1. Initial program 57.8b

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

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

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

      \[\leadsto \color{blue}{\frac{-b}{a}}\]

    if -2.4063664882097058e+146 < b < 0.034260571810453756

    1. Initial program 14.8b

      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
    2. Using strategy rm
    3. Applied associate-*r* 14.7b

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

    if 0.034260571810453756 < b

    1. Initial program 57.9b

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b - 2 \cdot \frac{a \cdot c}{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}}\]
  1. Removed slow pow expressions

Runtime

Total time: 41.0s Debug log

herbie --seed '#(1985129295 1558437691 463586651 1724996692 3338673416 2932607883)'
(FPCore (a b c)
  :name "NMSE p42, positive"
  
  :target
  (if (< b 0) (/ (+ (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)) (/ c (* a (/ (- (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)))))(/ (+ (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)))