Average Error: 0.2 → 0.2
Time: 3.3m
Precision: 64
Internal Precision: 128
\[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m\]
\[(m \cdot \left(\frac{m}{v}\right) + \left(m \cdot \left(-1 - \frac{m}{\frac{v}{m}}\right)\right))_*\]

Error

Bits error versus m

Bits error versus v

Derivation

  1. Initial program 0.2

    \[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m\]
  2. Simplified0.2

    \[\leadsto \color{blue}{m \cdot \left(\frac{m}{v} - (m \cdot \left(\frac{m}{v}\right) + 1)_*\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.2

    \[\leadsto m \cdot \color{blue}{\left(\frac{m}{v} + \left(-(m \cdot \left(\frac{m}{v}\right) + 1)_*\right)\right)}\]
  5. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{m \cdot \frac{m}{v} + m \cdot \left(-(m \cdot \left(\frac{m}{v}\right) + 1)_*\right)}\]
  6. Simplified0.2

    \[\leadsto m \cdot \frac{m}{v} + \color{blue}{\left(-1 - m \cdot \frac{m}{v}\right) \cdot m}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.2

    \[\leadsto m \cdot \color{blue}{\left(1 \cdot \frac{m}{v}\right)} + \left(-1 - m \cdot \frac{m}{v}\right) \cdot m\]
  9. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(m \cdot 1\right) \cdot \frac{m}{v}} + \left(-1 - m \cdot \frac{m}{v}\right) \cdot m\]
  10. Applied fma-def0.2

    \[\leadsto \color{blue}{(\left(m \cdot 1\right) \cdot \left(\frac{m}{v}\right) + \left(\left(-1 - m \cdot \frac{m}{v}\right) \cdot m\right))_*}\]
  11. Simplified0.2

    \[\leadsto (\color{blue}{m} \cdot \left(\frac{m}{v}\right) + \left(\left(-1 - m \cdot \frac{m}{v}\right) \cdot m\right))_*\]
  12. Using strategy rm
  13. Applied clear-num0.2

    \[\leadsto (m \cdot \left(\frac{m}{v}\right) + \left(\left(-1 - m \cdot \color{blue}{\frac{1}{\frac{v}{m}}}\right) \cdot m\right))_*\]
  14. Applied un-div-inv0.2

    \[\leadsto (m \cdot \left(\frac{m}{v}\right) + \left(\left(-1 - \color{blue}{\frac{m}{\frac{v}{m}}}\right) \cdot m\right))_*\]
  15. Final simplification0.2

    \[\leadsto (m \cdot \left(\frac{m}{v}\right) + \left(m \cdot \left(-1 - \frac{m}{\frac{v}{m}}\right)\right))_*\]

Reproduce

herbie shell --seed 2019088 +o rules:numerics
(FPCore (m v)
  :name "a parameter of renormalized beta distribution"
  :pre (and (< 0 m) (< 0 v) (< v 0.25))
  (* (- (/ (* m (- 1 m)) v) 1) m))