I was wondering if any CAS could even attempt to handle the following problem.
There is a naturally occurring probability distribution on the positive reals, with cumulative distribution function
F(x) = coth(x) - x*csch^2(x)
f(x) = 2*csch^2(x) * (x*coth(x) - 1).
Both of these have a removable singularity at 0. The point is that one can, and should, use a simple procedure computing ONE transcendental function, different for small and large values, to compute these without much loss of accuracy.
Now I have found such a way, and it is not difficult. Can any CAS accomplish this? I have shown mine below, to show how it can be done.
For x near 0, use coth(x) = 1/x + x*m(x). Then F(x) = x*(1 - m(x) - (x*m(x))^2) and f(x) = 2*((1+x^2*m(x))^2-x^2)^2*m(x).
For x large, exp(-2*x) is the only transcendental needed. Calling exp(-2*x) y, we have F(x) = 1 + 2*y/(1-y) - 4*x*y/(1-y)^2, and f(x) = 8*(x*(1+2*y/(1-y)) -1)*y/(1-y)^2.
Possibly the algebra can be rearranged for some slight improvement. "Small" and "large" overlap.
-- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Department of Statistics, Purdue University email@example.com Phone: (765)494-6054 FAX: (765)494-0558