Error: 34.5 → 5.3
Time: 52.6s
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{c}{2} \cdot \frac{2}{b} - \frac{b}{a} & \text{when } b \le -3.2138303248745144 \cdot 10^{+50} \\ \frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} & \text{when } b \le -1.1925195063372953 \cdot 10^{-204} \\ \frac{4}{2} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}} & \text{when } b \le 9.656800156747535 \cdot 10^{+100} \\ \frac{\frac{c}{\frac{2}{4}}}{\left(\left(-b\right) - b\right) + \left(2 \cdot a\right) \cdot \frac{c}{b}} & \text{otherwise} \end{cases}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

    if b < -3.2138303248745144e+50

    1. Initial program 40.1

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

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

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

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

    if -3.2138303248745144e+50 < b < -1.1925195063372953e-204

    1. Initial program 7.9

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

    if -1.1925195063372953e-204 < b < 9.656800156747535e+100

    1. Initial program 28.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-+ 28.5

      \[\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 15.8

      \[\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}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity 15.8

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

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

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

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

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

    if 9.656800156747535e+100 < b

    1. Initial program 58.9

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

      \[\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 33.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}\]
    5. Applied taylor 15.9

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{c}{\frac{2}{4}}}}{\left(\left(-b\right) - b\right) + \left(2 \cdot a\right) \cdot \frac{c}{b}}\]
  1. Removed slow pow expressions

Runtime

Total time: 52.6s Debug log

Please report a bug with the following info:

herbie --seed '#(1974006715 102148312 1929025970 1539711721 1637432478 559978523)'
(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)))