Changeset cae6ce6 in sasmodels


Ignore:
Timestamp:
Mar 17, 2016 12:17:00 PM (8 years ago)
Author:
wojciech
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
684eff9
Parents:
070ecee
Message:

Gamma function doc clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/lib/lgamma.c

    r070ecee rcae6ce6  
    1 /*                                                      gamma.c 
    2  * 
    3  *      Gamma function 
     1/*                                                      lgamma.c 
     2 * 
     3 *      Log Gamma function 
     4 * 
     5 */ 
     6 
     7/*                                                      lgamma() 
     8 * 
     9 *      Natural logarithm of gamma function 
    410 * 
    511 * 
     
    713 * SYNOPSIS: 
    814 * 
    9  * double x, y, gamma(); 
     15 * double x, y, lgamma(); 
    1016 * extern int sgngam; 
    1117 * 
    12  * y = gamma( x ); 
    13  * 
    14  * 
    15  * 
    16  * DESCRIPTION: 
    17  * 
    18  * Returns gamma function of the argument.  The result is 
    19  * correctly signed, and the sign (+1 or -1) is also 
    20  * returned in a global (extern) variable named sgngam. 
    21  * This variable is also filled in by the logarithmic gamma 
    22  * function lgam(). 
    23  * 
    24  * Arguments |x| <= 34 are reduced by recurrence and the function 
    25  * approximated by a rational function of degree 6/7 in the 
    26  * interval (2,3).  Large arguments are handled by Stirling's 
    27  * formula. Large negative arguments are made positive using 
    28  * a reflection formula.   
    29  * 
    30  * 
    31  * ACCURACY: 
    32  * 
    33  *                      Relative error: 
    34  * arithmetic   domain     # trials      peak         rms 
    35  *    DEC      -34, 34      10000       1.3e-16     2.5e-17 
    36  *    IEEE    -170,-33      20000       2.3e-15     3.3e-16 
    37  *    IEEE     -33,  33     20000       9.4e-16     2.2e-16 
    38  *    IEEE      33, 171.6   20000       2.3e-15     3.2e-16 
    39  * 
    40  * Error for arguments outside the test range will be larger 
    41  * owing to error amplification by the exponential function. 
    42  * 
    43  */ 
    44  
    45 /*                                                      lgam() 
    46  * 
    47  *      Natural logarithm of gamma function 
    48  * 
    49  * 
    50  * 
    51  * SYNOPSIS: 
    52  * 
    53  * double x, y, lgam(); 
    54  * extern int sgngam; 
    55  * 
    56  * y = lgam( x ); 
     18 * y = lgamma( x ); 
    5719 * 
    5820 * 
     
    9860 
    9961 
    100 /*                                                      gamma.c */ 
    101 /*      gamma function  */ 
    102  
    10362/* 
    10463Cephes Math Library Release 2.8:  June, 2000 
     
    10766 
    10867 
    109 double lanczos_gamma( double ); 
    110  
    111 double lanczos_gamma( double x) { 
     68double lgamma( double ); 
     69 
     70double lgamma( double x) { 
    11271 
    11372#if FLOAT_SIZE > 4 
Note: See TracChangeset for help on using the changeset viewer.