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

Error

Bits error versus alphaD

Bits error versus Kp

Derivation

  1. Initial program 21.3

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

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

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

Reproduce

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