Using the Raised Cosine Distribution in PRNG
12-26-2016, 08:01 PM
Post: #10
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Using the Raised Cosine Distribution in PRNG
(12-26-2016 07:39 AM)Paul Dale Wrote:  On calculators that support it:

$$RAND \\ \phi^{-1}$$

works really well. It might even be faster than the programme steps for the raised cosine distribution -- depending on the approximation used for $$\phi^{-1}$$

If you refer to the 34s: The Normal quantile is evaluated by an initial first guess which is then refined in one or (at most) two iterations. Since every iteration calls the Incomplete Gamma function which is a bit slow for arguments > √3, a faster simplified approach could be used that only applies the first guess to the random number. At least for the suggested application in games this should be sufficiently exact. But the Normal guess routine is not exposed to the user so the suggested method is not applicable. At least not directly. ;-)

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread Using the Raised Cosine Distribution in PRNG - Namir - 12-18-2016, 01:51 AM RE: Using the Raised Cosine Distribution in PRNG - mark4flies - 12-21-2016, 01:42 PM RE: Using the Raised Cosine Distribution in PRNG - Namir - 12-21-2016, 03:20 PM RE: Using the Raised Cosine Distribution in PRNG - mark4flies - 12-25-2016, 12:30 PM RE: Using the Raised Cosine Distribution in PRNG - ttw - 12-26-2016, 01:37 AM RE: Using the Raised Cosine Distribution in PRNG - Paul Dale - 12-26-2016, 01:42 AM RE: Using the Raised Cosine Distribution in PRNG - Namir - 12-26-2016, 02:12 AM RE: Using the Raised Cosine Distribution in PRNG - Paul Dale - 12-26-2016, 07:39 AM RE: Using the Raised Cosine Distribution in PRNG - Namir - 12-26-2016, 11:03 AM RE: Using the Raised Cosine Distribution in PRNG - Dieter - 12-26-2016 08:01 PM

User(s) browsing this thread: 1 Guest(s)