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

Error

Bits error versus m

Bits error versus v

Derivation

  1. Initial program 0.1

    \[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot \left(1 - m\right)\]
  2. Taylor expanded around 0 0.1

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

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

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

Reproduce

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