You have a rather strange code to generate exponential distribution. Use RAND_MAX macros from (it's not equal to the funny pow expression).
const double max_rand = RAND_MAX;
...
... log (x/max_rand) ...
With 32-bit compilers you have huge intervals because of (usually) RAND_MAX is equal 32767 only (rand() is a very bad pseudorandom numbers generator ;))...
Alas, I have no time to inspect your code more carefully now.
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
> Alas, I have no time to inspect your code more carefully now.
Take your time, it was posted (and abandoned) on 8th Jan 2005
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
What's a nightmare!..
Thank you, Salem ;)
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348