[phobos] phobos commit, revision 2186

Don Clugston dclugston at googlemail.com
Sun Nov 21 09:38:24 PST 2010


I just realized, that because of the bug in how array literals are
treated, there are memory allocations involved. If there is a bug in
array literal code, or in the memory allocation, it could well be
triggered by a change in the environment.

It should be possible to track this down a bit more.
Please, in gammafunction.d, around line 611, add the line:

    /* Resort to interval halving if not close enough. */
ihalve:

    dir = 0;
    di = 0.5L;
    for( i=0; i<400; i++ ) {
+   printf("%La %La %La\n", x0, x1, y0);
        if( i != 0 ) {
            x = x0  +  di * (x1 - x0);
            if( x == 1.0L ) {
                x = 1.0L - real.epsilon;

and also add an import core.stdc.stdio; in this file somewhere.

Also at line 704,

    if ( nflg ) {
        goto done;
    }
    nflg = 1;
    lgm = logGamma(a+b) - logGamma(a) - logGamma(b);

    for( i=0; i<15; i++ ) {
        /* Compute the function at this point. */
+   printf("NEWT %La %La %La\n", x, x0, x1);
        if ( i != 0 )
            y = betaIncomplete(a,b,x);
        if ( y < yl ) {


Then compile & run this:

import std.mathspecial;
import std.stdio;

void main()
{
writefln("%a", betaIncompleteInverse(0x1.ff1275ae5b939bcap-41, 4.6713e18,
 0.0813601));
}


More information about the phobos mailing list