\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot \left(1 - m\right)\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot 1 + \mathsf{fma}\left(m, 1, \mathsf{fma}\left({m}^{3}, \frac{1}{v}, -1 \cdot \frac{{m}^{2}}{v}\right)\right)double code(double m, double v) {
return ((((m * (1.0 - m)) / v) - 1.0) * (1.0 - m));
}
double code(double m, double v) {
return (((((m * (1.0 - m)) / v) - 1.0) * 1.0) + fma(m, 1.0, fma(pow(m, 3.0), (1.0 / v), -(1.0 * (pow(m, 2.0) / v)))));
}



Bits error versus m



Bits error versus v
Results
Initial program 0.1
rmApplied sub-neg0.1
Applied distribute-lft-in0.1
Taylor expanded around 0 0.1
Simplified0.1
rmApplied div-inv0.1
Applied fma-neg0.1
Final simplification0.1
herbie shell --seed 2020053 +o rules:numerics
(FPCore (m v)
:name "b parameter of renormalized beta distribution"
:precision binary64
:pre (and (< 0.0 m) (< 0.0 v) (< v 0.25))
(* (- (/ (* m (- 1 m)) v) 1) (- 1 m)))