Average Error: 0.2 → 0.2
Time: 5.3s
Precision: binary64
\[\left(0 < m \land 0 < v\right) \land v < 0.25\]
\[\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m \]
\[\frac{m}{v} \cdot \left(m - m \cdot m\right) - m \]
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m
\frac{m}{v} \cdot \left(m - m \cdot m\right) - m
(FPCore (m v) :precision binary64 (* (- (/ (* m (- 1.0 m)) v) 1.0) m))
(FPCore (m v) :precision binary64 (- (* (/ m v) (- m (* m m))) m))
double code(double m, double v) {
	return (((m * (1.0 - m)) / v) - 1.0) * m;
}
double code(double m, double v) {
	return ((m / v) * (m - (m * m))) - m;
}

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. Simplified0.2

    \[\leadsto \color{blue}{m \cdot \mathsf{fma}\left(m, \frac{1 - m}{v}, -1\right)} \]
  3. Applied fma-udef_binary640.2

    \[\leadsto m \cdot \color{blue}{\left(m \cdot \frac{1 - m}{v} + -1\right)} \]
  4. Applied distribute-rgt-in_binary640.2

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

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

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

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

Reproduce

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