GDC/ARM: Help needed: Porting std.math.internal.gammafunction

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 3 21:05:59 PDT 2014


Am Thu, 03 Jul 2014 18:13:45 +0000
schrieb "John Colvin" <john.loughran.colvin at gmail.com>:

> On Thursday, 3 July 2014 at 17:54:17 UTC, John Colvin wrote:
> > On Thursday, 3 July 2014 at 15:35:35 UTC, Johannes Pfau wrote:
> >> Hi,
> >>
> >> std.math.internal.gammafunction is the last module with failing
> >> unittest on ARM, simply because it assumes that reals are 
> >> always in
> >> x86 extended precision format which is obviously not true on 
> >> ARM.
> >>
> >> I haven't got the required (maths) knowledge to fix this, so 
> >> it'd be
> >> very appreciated if somebody could take a look.
> >>
> >> It's actually possible to easily test this on x86 with gdc: 
> >> Just install
> >> a recent gdc build and use the -mlong-double-64 command line 
> >> argument.
> >> More details and bug report here:
> >>
> >> https://issues.dlang.org/show_bug.cgi?id=13032
> >
> > some trial and error suggests that gammaStirling needs it's 
> > threshold changing from 1024.0L to 143.0L when using 64bit 
> > reals to avoid overflow.
> 
> MAXGAMMA will also need changing. I don't think there's anything 
> else wrong with gamma and gammaStirling, I haven't looked at the 
> others yet.

Thanks for having a look at this. AFAIK this code is based on cephes,
http://www.netlib.org/cephes/cprob.tgz
(link to double version) so the correct values can probably be found in
that source code.


More information about the Digitalmars-d mailing list