"Hemming" wrote in message <firstname.lastname@example.org>... > Im trying to extract a scattering angle for a photon using the Klein-Nishina scattering angle distribution (KN in the code) and for this I need the CDF (of KN) to be able to use the Monte Carlo method when that is achieved. All i've managed so far is to plot the PDF between 0 degrees and Pi to see that it looks alright, and that it has that "peanut shape". Ive tried to use the built in CDF function but it seems very slow. - - - - - - - - - - Do I understand correctly that this is a probability density function with respect to a solid angle of scattering? Wouldn't that need to be known in obtaining a cumulative distribution? Perhaps you need to explain your problem in much greater detail since you are communicating with people who are not necessarily conversant with quantum electrodynamics. Pretend we know nothing about the physics of the subject and explain your question in purely mathematical terms and in great detail.