Average Error: 0.2 → 0.2
Time: 3.6s
Precision: 64
\[0.0 \lt m \land 0.0 \lt v \land v \lt 0.25\]
\[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m\]
\[1 \cdot \left(\frac{m}{\frac{v}{m}} - m\right) - \frac{{m}^{3}}{v}\]
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m
1 \cdot \left(\frac{m}{\frac{v}{m}} - m\right) - \frac{{m}^{3}}{v}
double code(double m, double v) {
	return ((((m * (1.0 - m)) / v) - 1.0) * m);
}
double code(double m, double v) {
	return ((1.0 * ((m / (v / m)) - m)) - (pow(m, 3.0) / v));
}

Error

Bits error versus m

Bits error versus v

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.4

    \[\leadsto \left(\frac{m \cdot \left(1 - m\right)}{\color{blue}{\sqrt{v} \cdot \sqrt{v}}} - 1\right) \cdot m\]
  4. Applied associate-/r*0.4

    \[\leadsto \left(\color{blue}{\frac{\frac{m \cdot \left(1 - m\right)}{\sqrt{v}}}{\sqrt{v}}} - 1\right) \cdot m\]
  5. Taylor expanded around 0 7.1

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

    \[\leadsto \color{blue}{1 \cdot \left(\frac{{m}^{2}}{v} - m\right) - \frac{{m}^{3}}{v}}\]
  7. Using strategy rm
  8. Applied unpow27.1

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

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

    \[\leadsto 1 \cdot \left(\frac{m}{\frac{v}{m}} - m\right) - \frac{{m}^{3}}{v}\]

Reproduce

herbie shell --seed 2020105 
(FPCore (m v)
  :name "a parameter of renormalized beta distribution"
  :precision binary64
  :pre (and (< 0.0 m) (< 0.0 v) (< v 0.25))
  (* (- (/ (* m (- 1 m)) v) 1) m))