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

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. Taylor expanded around inf 0.2

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

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

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

Reproduce

herbie shell --seed 2019091 +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))