On Sep 8, 2019, at 14:44, Tim Peters <tim.pet...@gmail.com> wrote: > > From my POV, the audience for complex gamma is relatively tiny
Agreed. Especially people who need complex gamma who aren’t dealing with arrays (in which case you’d have to use scipy anyway). Also, I suspect different uses might actually need different tradeoffs between performance, accuracy, and consistency with math.gamma, which would make the audience for a stdlib function even smaller. Digging through my pile of code, I found a few places where I use the scipy function, but all with arrays. And I found two places where I don’t use scipy, but I don’t think cmath would have helped there either. My infinitesimal-calculator toy has a gamma function, which uses the simple but inaccurate Stirling algorithm for both (extended) real and complex values. Probably because it extends trivially to Levi-Civita series. I have a notes.md file that mentions other algorithms to try if I ever need a better gamma, and ones that I tried and rejected, but (a) apparently I never needed a better gamma, and (b) working out how to extend finite math.gamma was one of the things I already tried and rejected. And I’ve got some other code where I implemented the Spouge approximation (using only operators rather than sqrt and exp for some reason, so it probably would have worked out of the box for L-C extended numbers, just as it does for most other number-like types from an array of complex64 to a quarternion…), with a comment that says “# don’t use scipy.gamma because it” and cuts off there, which isn’t very helpful. I’m _guessing_ I needed identical values for float and complex. Anyway, it’s slower than scipy even with a small table, and less accurate even with a large one (as in `gamma(1.0+0j)` gives you 0.9999995 instead of 1.0), so presumably, whatever my reason was eclipsed both of those considerations, and likely the same would have been true if cmath.gamma had existed, except I would have had a slightly longer useless comment saying “# don’t use cmath.gamma or scipy.gamma because they”. :) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RPECCHYBAKJF6CDSQM34NHNBTUBMCGM7/ Code of Conduct: http://python.org/psf/codeofconduct/