The corresponding cumulative distribution function is

(5.41) |

Since it is not possible to calculate an explicit expression for the inverse function , which is useful for the inverse method, the rejection technique is chosen instead [25]. For the rejection method an instrumental distribution is necessary, which is an upper bound approximation of , and which leads to an invertable cumulative distribution function.

Using the inequalities

(5.42) |

and

(5.43) |

(see Inequality 1 and Inequality 2 in Appendix C) such an instrumental probability density function for (5.40) is given by

The corresponding cumulative distribution function is

(5.45) |

According to the rejection method a random polar angle following can be generated by feeding the inverse of the instrumental cumulative distribution function

with uniformly distributed random variates and accepting , if

where denotes another uniformly distributed variate on . Algorithm 5.3 summarizes the entire procedure for determining random polar angles, which are distributed according to the coned cosine distribution.

The efficiency of rejection sampling for this case, thus the fraction of successful attempts satisfying (5.47), is given by

(5.48) |

The presented algorithm shows a very high efficiency, since holds for all (see Inequality 3 in Appendix C), which corresponds to a success rate of approximately in the worst case.

Otmar Ertl: Numerical Methods for Topography Simulation