commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-1293) Tabulating the logarithmic factorial
Date Sat, 19 Dec 2015 17:44:46 GMT


Gilles commented on MATH-1293:

Feature committed as 00439211981af7b5baed495f526ef8ad76ee7c5b on "master" branch (4.0).
Please review and let me know if my modifications suit you.  Thanks.

> Tabulating the logarithmic factorial
> ------------------------------------
>                 Key: MATH-1293
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.5
>            Reporter: Aleksei Dievskii
>            Priority: Minor
>              Labels: feature, patch
>         Attachments: factlog.patch, factlog_ondemand.patch
> Presently, CombinatoricsUtils#factorialLog is calculated via a tabulated value for the
first 21 entries, and for the rest it employs linear-complexity direct summing. For the factorial-heavy
computations this can be rather painful. I propose a patch which allocates additional 16KB
of tabulated log-factorial values, allowing very fast (constant complexity) computation for
arguments up to 17000, and delegating to the log-gamma for the rest. Benchmarks show a speed-up
of up to 200x.

This message was sent by Atlassian JIRA

View raw message