Leigh worried: > My only question is how accurately D. performs > numerical differentiation.
I know nothing of numerical analysis, and remember little of calculus, but I also recall some complaints on the Forum along the lines that D. loses precision quickly. To that end, you may want to (A) get some test data (perhaps generated by Excel) and (B) try various formulations of the gammas to find the set whose output most closely matches that test data. Here's a script that automatically generates and compares a bunch of theoretically-equivalent gammas functions: http://www.jsoftware.com/svn/DanBron/trunk/environment/generate_j.ijs It is merely an example. It has some shortcomings: (A) Its test data is not independent. In real life, you'd want data which you know to be normative. This would usually come from the spec or the application you're trying to emulate; in this case, Excel. It appears my Excel does not have lngamma & derivatives. (B) The formulations are all naive: they all use D. . If D. turns out to be workable, then that's not a problem. But if my memory is correct and your fears are founded, then indeed you need a different approach. As I said, my calculus is rusty; I cannot help you on that front. Jose Quintana: if you're reading this, the script above is an example of the "auto-generation" technique, which you requested a while back: http://www.jsoftware.com/pipermail/programming/2007-March/005444.html -Dan ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
