diff --git a/lemon/random.h b/lemon/random.h
--- a/lemon/random.h
+++ b/lemon/random.h
@@ -798,16 +798,12 @@
/// This function generates a Pareto distribution random number.
///
+ ///\param k shape parameter (k>0)
///\param x_min location parameter (x_min>0)
- ///\param k shape parameter (k>0)
///
- ///\warning This function used inverse transform sampling, therefore may
- ///suffer from numerical unstability.
- ///
- ///\todo Implement a numerically stable method
- double pareto(double x_min,double k)
+ double pareto(double k,double x_min)
{
- return x_min*pow(1.0-real(),1.0/k);
+ return exponential(gamma(k,1.0/x_min));
}
///@}