The R Project SVN R

Rev

Rev 80719 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80719 Rev 84215
Line 75... Line 75...
75
     *              =IEEE=  38.58601
75
     *              =IEEE=  38.58601
76
     * [on one x86_64 platform, effective boundary a bit lower: 38.56804]
76
     * [on one x86_64 platform, effective boundary a bit lower: 38.56804]
77
     */
77
     */
78
    if (x > sqrt(-2*M_LN2*(DBL_MIN_EXP + 1-DBL_MANT_DIG))) return 0.;
78
    if (x > sqrt(-2*M_LN2*(DBL_MIN_EXP + 1-DBL_MANT_DIG))) return 0.;
79
 
79
 
80
    /* Now, to get full accurary, split x into two parts,
80
    /* Now, to get full accuracy, split x into two parts,
81
     *  x = x1+x2, such that |x2| <= 2^-16.
81
     *  x = x1+x2, such that |x2| <= 2^-16.
82
     * Assuming that we are using IEEE doubles, that means that
82
     * Assuming that we are using IEEE doubles, that means that
83
     * x1*x1 is error free for x<1024 (but we have x < 38.6 anyway).
83
     * x1*x1 is error free for x<1024 (but we have x < 38.6 anyway).
84
 
84
 
85
     * If we do not have IEEE this is still an improvement over the naive formula.
85
     * If we do not have IEEE this is still an improvement over the naive formula.