This snippet based on Binet's formula combined with fast power algorithm. Four multiplications run in parallel, thus processor with four cores recommended. Bitwise operators improve divisions and multiplications by pow of 2.
0 people like thisPosted: 3 months ago by Pavel Tatarintsev
The random hyperharmonic series is the infinite series S = Sum(1,inf,d(i)/i^pow), where integer pow is greater than 1, and d(i) are independent, identically distributed random variables with property P(d(i)=0) = P(d(i)=1) = 0.5. Cumulative function F(x) = P(S < x) for even powers can be build by combination of analytical and numerical computations.
1 people like thisPosted: 7 days ago by Pavel Tatarintsev