[phobos] Proposed changes to std.math + introduce std.mathspecial

Don Clugston dclugston at googlemail.com
Thu Nov 18 05:29:19 PST 2010


On 18 November 2010 12:40, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> On Thu, 2010-11-18 at 12:06 +0100, Lars Tandle Kyllingstad wrote:
>> On Wed, 2010-11-17 at 22:09 +0100, Don Clugston wrote:
>>
>> > (2) Delete etc.gamma
>>
>> I didn't even know this module existed.  I recently implemented the
>> gamma function myself, based on the same source (Cephes).  If I'd known
>> about this it would have saved me quite a bit of time, so I say yes,
>> let's bring it out of hiding.
>
> Well, how about that -- it seems I would have saved even more time by
> realising that there is a tgamma() function in std.math already... :p
> (It seems to be slightly less accurate than the Cephes one, though, as
> it doesn't pass the unittests I wrote for my implementation.)

Really? It started life as the Cephes one. I ported it to D, then
Walter ported it back to C and put in the C standard library, where it
is called from D (!) If you find a case where it fails, please let me
know.

I have D ports of pretty much all of Cephes. The main value I added is
unit tests to get high code coverage (well over 90%).


More information about the phobos mailing list