Average Error: 21.7 → 21.7
Time: 1.7s
Precision: binary64
\[\frac{-\left(\left(1 - alphaD\right) + \sqrt{\left(\left(1 - 2 \cdot alphaD\right) + \left(4 \cdot Kp\right) \cdot alphaD\right) + alphaD \cdot alphaD}\right)}{2 \cdot Kp}\]
\[\frac{\left(alphaD - 1\right) - \sqrt{\left(\left(1 - 2 \cdot alphaD\right) + \left(4 \cdot Kp\right) \cdot alphaD\right) + alphaD \cdot alphaD}}{Kp \cdot 2}\]

Error

Bits error versus alphaD

Bits error versus Kp

Derivation

  1. Initial program 21.7

    \[\frac{-\left(\left(1 - alphaD\right) + \sqrt{\left(\left(1 - 2 \cdot alphaD\right) + \left(4 \cdot Kp\right) \cdot alphaD\right) + alphaD \cdot alphaD}\right)}{2 \cdot Kp}\]
  2. Simplified21.7

    \[\leadsto \color{blue}{\frac{\left(alphaD - 1\right) - \sqrt{\left(\left(1 - 2 \cdot alphaD\right) + \left(4 \cdot Kp\right) \cdot alphaD\right) + alphaD \cdot alphaD}}{Kp \cdot 2}}\]
  3. Final simplification21.7

    \[\leadsto \frac{\left(alphaD - 1\right) - \sqrt{\left(\left(1 - 2 \cdot alphaD\right) + \left(4 \cdot Kp\right) \cdot alphaD\right) + alphaD \cdot alphaD}}{Kp \cdot 2}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (alphaD Kp)
  :name "(/ (- (+ (- 1.0 alphaD) (sqrt (+ (+ (- 1.0 (* 2.0 alphaD)) (* (* 4.0 Kp) alphaD)) (* alphaD alphaD))))) (* 2.0 Kp))"
  :precision binary64
  (/ (neg (+ (- 1.0 alphaD) (sqrt (+ (+ (- 1.0 (* 2.0 alphaD)) (* (* 4.0 Kp) alphaD)) (* alphaD alphaD))))) (* 2.0 Kp)))