Average Error: 29.5 → 29.5
Time: 1.6s
Precision: binary64
\[\left(-p\right) + \sqrt{{p}^{2} + q}\]
\[\sqrt{{p}^{2} + q} - p\]

Error

Bits error versus p

Bits error versus q

Derivation

  1. Initial program 29.5

    \[\left(-p\right) + \sqrt{{p}^{2} + q}\]
  2. Simplified29.5

    \[\leadsto \color{blue}{\sqrt{{p}^{2} + q} - p}\]
  3. Final simplification29.5

    \[\leadsto \sqrt{{p}^{2} + q} - p\]

Reproduce

herbie shell --seed 2020153 
(FPCore (p q)
  :name "(+ (- p) (sqrt (+ (pow p 2) q)))"
  :precision binary64
  (+ (neg p) (sqrt (+ (pow p 2.0) q))))