commons-numbers.git
33 hours agoRemove javadoc links to JDK. master
Alex Herbert [Sat, 24 Sep 2022 21:20:04 +0000 (22:20 +0100)] 
Remove javadoc links to JDK.

The links configured in CP create redirect warnings on JDK 17 which fail
the build. JDK links are automatically added by the javadoc plugin based
on the target version.

3 weeks agoJavadoc @link tags do not need to use a FQCN for classes in java.lang
Gary Gregory [Mon, 29 Aug 2022 11:36:51 +0000 (07:36 -0400)] 
Javadoc @link tags do not need to use a FQCN for classes in java.lang

3 weeks agoJavadoc @see tags do not need to use a FQCN for classes in java.lang
Gary Gregory [Mon, 29 Aug 2022 11:19:04 +0000 (07:19 -0400)] 
Javadoc @see tags do not need to use a FQCN for classes in java.lang

4 weeks agoUpdate README to use the default Maven goal
Gary Gregory [Fri, 26 Aug 2022 12:30:25 +0000 (08:30 -0400)] 
Update README to use the default Maven goal

2 months agoadded my name to contributor list
Sumanth Rajkumar [Fri, 8 Jul 2022 15:33:05 +0000 (11:33 -0400)] 
added my name to contributor list

2 months agoMigrate workflows from adopt to temurin
Alex Herbert [Wed, 29 Jun 2022 22:26:35 +0000 (23:26 +0100)] 
Migrate workflows from adopt to temurin

2 months agoTrim whitespace
Alex Herbert [Wed, 29 Jun 2022 13:01:42 +0000 (14:01 +0100)] 
Trim whitespace

2 months agoUse GitHub Actions setup-java Maven cache property
Alex Herbert [Wed, 29 Jun 2022 12:49:30 +0000 (13:49 +0100)] 
Use GitHub Actions setup-java Maven cache property

2 months ago* Use Math.min
Arturo Bernal [Sun, 26 Jun 2022 20:41:13 +0000 (22:41 +0200)] 
* Use Math.min
* Use System.arraycopy

Revert some changes.

2 months agoActivate notifications for GH actions
Alex Herbert [Mon, 27 Jun 2022 16:56:30 +0000 (17:56 +0100)] 
Activate notifications for GH actions

2 months agoMerge duplicate javadoc plugin declaration
Alex Herbert [Sun, 26 Jun 2022 21:27:56 +0000 (22:27 +0100)] 
Merge duplicate javadoc plugin declaration

3 months agoRequire method javadoc for private scope
Alex Herbert [Sun, 26 Jun 2022 21:23:45 +0000 (22:23 +0100)] 
Require method javadoc for private scope

3 months agoDo not fail on javadoc warnings in the JMH module
Alex Herbert [Sun, 26 Jun 2022 20:22:17 +0000 (21:22 +0100)] 
Do not fail on javadoc warnings in the JMH module

3 months agoCorrect erasure of unnecessary parentheses
Alex Herbert [Sun, 26 Jun 2022 20:11:32 +0000 (21:11 +0100)] 
Correct erasure of unnecessary parentheses

3 months agoUpdate checkstyle
Alex Herbert [Sat, 25 Jun 2022 10:06:51 +0000 (11:06 +0100)] 
Update checkstyle

plugin 3.1.0 -> 3.1.2
dependency 8.29 -> 8.45

Correct unnecessary parentheses in code or using suppressions

3 months agoAdd missing javadoc checks
Alex Herbert [Sat, 25 Jun 2022 09:21:10 +0000 (10:21 +0100)] 
Add missing javadoc checks

3 months agoFail javadoc on warnings
Alex Herbert [Sat, 25 Jun 2022 09:01:39 +0000 (10:01 +0100)] 
Fail javadoc on warnings

3 months agoFail build on coverage checks
Alex Herbert [Sat, 25 Jun 2022 08:45:56 +0000 (09:45 +0100)] 
Fail build on coverage checks

3 months agoRemove block level element from inside <p> tags
Alex Herbert [Thu, 9 Jun 2022 15:35:21 +0000 (16:35 +0100)] 
Remove block level element from inside <p> tags

3 months agoUpdate developers contributing guide
Alex Herbert [Thu, 9 Jun 2022 15:22:50 +0000 (16:22 +0100)] 
Update developers contributing guide

Ensure correct HTML formatting.

Remove reference to building with ant.

Use https and correct links.

Detail contributing by PR.

Update maven set-up and commit message guide.

3 months agoRemove travis profile
aherbert [Tue, 7 Jun 2022 12:22:10 +0000 (13:22 +0100)] 
Remove travis profile

3 months agoDisable Travis CI
Alex Herbert [Sun, 5 Jun 2022 21:25:54 +0000 (22:25 +0100)] 
Disable Travis CI

3 months agoUpdate README badges
Alex Herbert [Sun, 5 Jun 2022 21:22:30 +0000 (22:22 +0100)] 
Update README badges

coveralls to codecov
travis to GH actions

3 months agoUse a single build goal
Alex Herbert [Sat, 4 Jun 2022 14:11:47 +0000 (15:11 +0100)] 
Use a single build goal

This allows the examples modules to use the dependency artifacts from
the build and not the local repository.

3 months agoUse greater than expression in GH workflow
Alex Herbert [Sun, 29 May 2022 21:24:10 +0000 (22:24 +0100)] 
Use greater than expression in GH workflow

3 months agoSkip spotbugs in JMH module
Alex Herbert [Sun, 29 May 2022 07:23:28 +0000 (08:23 +0100)] 
Skip spotbugs in JMH module

3 months agoIgnore generated files from checkstyle
Alex Herbert [Sun, 29 May 2022 07:22:50 +0000 (08:22 +0100)] 
Ignore generated files from checkstyle

3 months agoBuild examples on JDK 17
Alex Herbert [Sun, 29 May 2022 07:06:07 +0000 (08:06 +0100)] 
Build examples on JDK 17

3 months agoUpdate javadoc plugin config.
Alex Herbert [Sun, 29 May 2022 07:04:57 +0000 (08:04 +0100)] 
Update javadoc plugin config.

Ignore JMH generated files.

Drop duplicate plugin configuration. This is inherited from the parent.

3 months agoUpgrade JMH version
Alex Herbert [Sun, 29 May 2022 07:07:37 +0000 (08:07 +0100)] 
Upgrade JMH version

3 months agoCorrect files entry
Alex Herbert [Fri, 27 May 2022 19:05:24 +0000 (20:05 +0100)] 
Correct files entry

3 months agoAll coverage files on a single line
Alex Herbert [Fri, 27 May 2022 19:03:55 +0000 (20:03 +0100)] 
All coverage files on a single line

3 months agoQuote the files for coverage submission
Alex Herbert [Fri, 27 May 2022 18:44:58 +0000 (19:44 +0100)] 
Quote the files for coverage submission

3 months agoSimplify GH build workflow for examples
Alex Herbert [Fri, 27 May 2022 15:31:04 +0000 (16:31 +0100)] 
Simplify GH build workflow for examples

3 months agoDo not fail PMD in examples modules
Alex Herbert [Fri, 27 May 2022 15:30:41 +0000 (16:30 +0100)] 
Do not fail PMD in examples modules

4 months agoReplace deprecated RandomSource.create
Alex Herbert [Thu, 26 May 2022 16:38:41 +0000 (17:38 +0100)] 
Replace deprecated RandomSource.create

4 months agoBuild the correct examples project
Alex Herbert [Thu, 26 May 2022 16:29:58 +0000 (17:29 +0100)] 
Build the correct examples project

4 months agoRemove HTML headings tags
Alex Herbert [Thu, 26 May 2022 16:13:43 +0000 (17:13 +0100)] 
Remove HTML headings tags

4 months agoCorrect java 11 build step
Alex Herbert [Thu, 26 May 2022 15:57:24 +0000 (16:57 +0100)] 
Correct java 11 build step

4 months agoAdd GH actions for build and coverage
Alex Herbert [Thu, 26 May 2022 15:55:31 +0000 (16:55 +0100)] 
Add GH actions for build and coverage

Build targets JDK 8, 11, 17

4 months agoJavadoc typo
aherbert [Wed, 4 May 2022 17:08:03 +0000 (18:08 +0100)] 
Javadoc typo

4 months agoSonar fix: Use constants in place of methods for constant values
aherbert [Wed, 4 May 2022 17:06:33 +0000 (18:06 +0100)] 
Sonar fix: Use constants in place of methods for constant values

4 months agoSonar fix: custom assertEquals method so that expected can be last
aherbert [Wed, 4 May 2022 17:02:18 +0000 (18:02 +0100)] 
Sonar fix: custom assertEquals method so that expected can be last

4 months agoSonar fix: Extract nested ternary
aherbert [Wed, 4 May 2022 16:55:04 +0000 (17:55 +0100)] 
Sonar fix: Extract nested ternary

4 months agoSonar fix: remove useless assignment
aherbert [Wed, 4 May 2022 16:50:31 +0000 (17:50 +0100)] 
Sonar fix: remove useless assignment

5 months agoRemove extra new lines
aherbert [Mon, 25 Apr 2022 11:52:12 +0000 (12:52 +0100)] 
Remove extra new lines

5 months agoJavadoc typo
aherbert [Mon, 25 Apr 2022 11:47:22 +0000 (12:47 +0100)] 
Javadoc typo

6 months agoAdd SECURITY.md
Gary Gregory [Fri, 25 Feb 2022 13:23:07 +0000 (08:23 -0500)] 
Add SECURITY.md

6 months agoAdd CODE_OF_CONDUCT.md
Gary Gregory [Fri, 25 Feb 2022 13:18:48 +0000 (08:18 -0500)] 
Add CODE_OF_CONDUCT.md

7 months agoNUMBERS-185: Allow Precision.compareTo using a max ULP to be used for
aherbert [Wed, 16 Feb 2022 13:44:41 +0000 (13:44 +0000)] 
NUMBERS-185: Allow Precision.compareTo using a max ULP to be used for
sorting.

Updated tests to ensure compareTo is symmetric for the arguments.

Updated the documentation to state expected behaviour with NaN
arguments.

7 months agoUse Double.MIN_VALUE for the SAFE_MIN constant.
aherbert [Wed, 16 Feb 2022 12:33:14 +0000 (12:33 +0000)] 
Use Double.MIN_VALUE for the SAFE_MIN constant.

7 months agoEnsure Precision equals is symmetric
aherbert [Wed, 16 Feb 2022 12:32:30 +0000 (12:32 +0000)] 
Ensure Precision equals is symmetric

Update the tests to use an interface that asserts the return value is
the same when arguments are reversed.

7 months agoNUMBERS-184: Reduce operations in Precision.equals using a maxUlps
aherbert [Wed, 16 Feb 2022 11:29:38 +0000 (11:29 +0000)] 
NUMBERS-184: Reduce operations in Precision.equals using a maxUlps

8 months agoReplace deprecated calls.
Gilles Sadowski [Sun, 23 Jan 2022 23:02:03 +0000 (00:02 +0100)] 
Replace deprecated calls.

8 months agoUpgrade parent POM.
Gilles Sadowski [Sun, 23 Jan 2022 23:01:17 +0000 (00:01 +0100)] 
Upgrade parent POM.

8 months agoNUMBERS-181: Track changes
Alex Herbert [Sat, 22 Jan 2022 13:12:50 +0000 (13:12 +0000)] 
NUMBERS-181: Track changes

8 months agoNUMBERS-181: New public API for beta functions
Alex Herbert [Thu, 20 Jan 2022 23:17:31 +0000 (23:17 +0000)] 
NUMBERS-181: New public API for beta functions

8 months agoNUMBERS-181: Port the Boost beta functions
Alex Herbert [Wed, 5 Jan 2022 23:49:59 +0000 (23:49 +0000)] 
NUMBERS-181: Port the Boost beta functions

8 months agoMove DataReader to package level class
Alex Herbert [Tue, 4 Jan 2022 23:06:33 +0000 (23:06 +0000)] 
Move DataReader to package level class

8 months agoMove BoostGamma.Policy to package level class
Alex Herbert [Tue, 4 Jan 2022 21:17:50 +0000 (21:17 +0000)] 
Move BoostGamma.Policy to package level class

8 months agoNUMBERS-183: Track changes
aherbert [Thu, 20 Jan 2022 15:51:09 +0000 (15:51 +0000)] 
NUMBERS-183: Track changes

8 months agoNUMBERS-183: Improve binomial coefficient classes
aherbert [Thu, 20 Jan 2022 14:58:26 +0000 (14:58 +0000)] 
NUMBERS-183: Improve binomial coefficient classes

Refactor the tests to use JUnit 5 parameterized test features.

Refactor the test for all binomial coefficients up to n=200 to compute
the result using n! / (n-k)! / k!. Removes the caching test
implementation which only works for results within a long datatype. This
has been updated for BinomialCoefficientDouble and
LogBinomialCoefficient to test the result is correct even when a long
overflows.

Update the implementations:

- Avoid recursive method call if k > n/2.

- Add early exit if the result cannot fit into the output datatype. This
is k >= 34 for long, and k >= 515 for a double.

- BinomialCoefficientDouble: Use the precomputed factorials to compute
n! / k! / (n-k)! if possible.

- BinomialCoefficientDouble: avoid overflow by checking the intermediate
result

- LogBinomialCoefficient: Compute the terms using the LogBeta class

8 months agoUpdate NOTICE to 2022
aherbert [Thu, 20 Jan 2022 10:18:26 +0000 (10:18 +0000)] 
Update NOTICE to 2022

8 months agoNUMBERS-182: Avoid overflow in LogBeta for tiny arguments
Alex Herbert [Sat, 8 Jan 2022 09:23:32 +0000 (09:23 +0000)] 
NUMBERS-182: Avoid overflow in LogBeta for tiny arguments

9 months agoNUMBERS-180: Track changes
Alex Herbert [Thu, 23 Dec 2021 21:46:44 +0000 (21:46 +0000)] 
NUMBERS-180: Track changes

9 months agoNUMBERS-180: Gamma ratio and delta ratio
Alex Herbert [Wed, 22 Dec 2021 08:37:14 +0000 (08:37 +0000)] 
NUMBERS-180: Gamma ratio and delta ratio

Added support for the ratio of two gamma functions. Copied the test
data from the source Boost implementation.

9 months agoRemove public from package level utility class
Alex Herbert [Thu, 23 Dec 2021 13:03:51 +0000 (13:03 +0000)] 
Remove public from package level utility class

9 months agoRemove redundant variable assignment
aherbert [Thu, 16 Dec 2021 16:34:00 +0000 (16:34 +0000)] 
Remove redundant variable assignment

Use e directly and update to d in the condition that accepts the
interpolation. The condition that rejects interpolation updates e
anyway.

9 months agoRemove dependency on Precision
aherbert [Thu, 16 Dec 2021 16:32:51 +0000 (16:32 +0000)] 
Remove dependency on Precision

Since this was used to compare to zero the method can be more simply
implemented:

Precision.equals(b, 0) == Math.abs(b) <= Double.MIN_VALUE

9 months agoAvoid underflow computing the initial value
aherbert [Thu, 16 Dec 2021 14:08:36 +0000 (14:08 +0000)] 
Avoid underflow computing the initial value

This is an extreme edge case for the solver called with no bracketing.
It ensures the bracket can be used to return a value if within the
current function accuracy tolerance.

9 months agoAvoid overflow computing the initial value
aherbert [Thu, 16 Dec 2021 11:38:24 +0000 (11:38 +0000)] 
Avoid overflow computing the initial value

9 months agoNUMBERS-179: Update threshold in regularisedGammaPrefix
Alex Herbert [Tue, 14 Dec 2021 18:04:27 +0000 (18:04 +0000)] 
NUMBERS-179: Update threshold in regularisedGammaPrefix

Modifies the threshold from a > 150 (Boost version) to a > 128.

9 months agoLower threshold for a ~ z
Alex Herbert [Mon, 13 Dec 2021 08:25:15 +0000 (08:25 +0000)] 
Lower threshold for a ~ z

This threshold requires optimisation. The threshold was too high to pass
existing tests in Commons Statistics (see STATISTICS-39).

9 months agoMove the direct computation before checks for base near 1
Alex Herbert [Mon, 13 Dec 2021 00:10:54 +0000 (00:10 +0000)] 
Move the direct computation before checks for base near 1

When the direct computation can be used then there is no requirement for
the Lanczos code that uses pow(z / (z+g-0.5), a). Thus there is no need
to avoid a base near 1 in the power function. This check only applies
after the direct computation has been eliminated.

9 months agoAdd another log1pmx test case to hit code coverage
aherbert [Wed, 8 Dec 2021 15:54:11 +0000 (15:54 +0000)] 
Add another log1pmx test case to hit code coverage

9 months agoNUMBERS-177: Add scaled complementary error function Erfcx
Alex Herbert [Mon, 6 Dec 2021 08:34:26 +0000 (08:34 +0000)] 
NUMBERS-177: Add scaled complementary error function Erfcx

Updates the rational function approximation for erfc(x > 4) to a
function valid for the approximation limit of erfcx (x ~ 6.71e7).

Improves the scaling by exp(-x*x) and exp(x*x).

9 months agoNUMBERS-178: Add Factorial.doubleValue(int)
Alex Herbert [Sat, 4 Dec 2021 00:52:12 +0000 (00:52 +0000)] 
NUMBERS-178: Add Factorial.doubleValue(int)

Deprecate the FactorialDouble class.

9 months agoAdd since tags for new API additions
Alex Herbert [Fri, 3 Dec 2021 23:06:42 +0000 (23:06 +0000)] 
Add since tags for new API additions

9 months agoNUMBERS-178: Tabulate all representable factorials in FactorialDouble
aherbert [Fri, 3 Dec 2021 13:47:57 +0000 (13:47 +0000)] 
NUMBERS-178: Tabulate all representable factorials in FactorialDouble

Values are verified using BigInteger computation of n!

This change deprecates the now redundant caching functionality.

9 months agoAdd Commons Numbers 1.0 implementation to ErfPerformance benchmark
aherbert [Tue, 30 Nov 2021 11:30:01 +0000 (11:30 +0000)] 
Add Commons Numbers 1.0 implementation to ErfPerformance benchmark

Previously the code called RegularizedGamma.P or Q. Since these have
been updated the 1.0 version has been preserved for a reference
benchmark.

9 months agoUpdate Commons RNG from 1.3 to 1.4
aherbert [Mon, 29 Nov 2021 18:09:27 +0000 (18:09 +0000)] 
Update Commons RNG from 1.3 to 1.4

9 months agoNUMBERS-176: ContinuedFraction delegates to GeneralizedContinuedFraction
aherbert [Wed, 24 Nov 2021 14:15:11 +0000 (14:15 +0000)] 
NUMBERS-176: ContinuedFraction delegates to GeneralizedContinuedFraction

9 months agoNUMBERS-174: Track changes
aherbert [Mon, 29 Nov 2021 15:55:29 +0000 (15:55 +0000)] 
NUMBERS-174: Track changes

10 months agoNUMBERS-174: Update gamma functions public API 110/head
Alex Herbert [Tue, 16 Nov 2021 16:42:16 +0000 (16:42 +0000)] 
NUMBERS-174: Update gamma functions public API

Use the Boost gamma function implementations.

Add new IncompleteGamma class and tests.

Add LogGamma with a sign output.

Update the test data for Gamma and tighten the tolerances for the
improved function. The data is not duplicated from the Boost test data.

Remove obsolete tests for RegularizedGamma.

Add Gamma P and Q derivative.

10 months agoNUMBERS-174: Use Boost gamma function implementation
Alex Herbert [Tue, 26 Oct 2021 20:43:27 +0000 (21:43 +0100)] 
NUMBERS-174: Use Boost gamma function implementation

10 months agoAdd usable maven modules to the main README.md page
aherbert [Wed, 24 Nov 2021 12:59:43 +0000 (12:59 +0000)] 
Add usable maven modules to the main README.md page

This replaces the example for commons-numbers-parent

10 months agoTest isPowerOfTwo with negative arguments and all true powers up to 2^62
aherbert [Wed, 24 Nov 2021 12:54:45 +0000 (12:54 +0000)] 
Test isPowerOfTwo with negative arguments and all true powers up to 2^62

10 months agoNUMBERS-175: Track changes
aherbert [Wed, 24 Nov 2021 12:56:54 +0000 (12:56 +0000)] 
NUMBERS-175: Track changes

10 months agoNUMBERS-175: A continued fraction class to compute using a generator 109/head
aherbert [Wed, 17 Nov 2021 18:27:00 +0000 (18:27 +0000)] 
NUMBERS-175: A continued fraction class to compute using a generator

Added a GeneralizedContinuedFraction class. This has evaluation methods
to include or exclude the leading term b0.

10 months agoChange Travis CI openjdk9 to openjdk11
aherbert [Wed, 24 Nov 2021 10:24:27 +0000 (10:24 +0000)] 
Change Travis CI openjdk9 to openjdk11

openjdk9 is no longer supported on Travis CI

10 months agoReuse the golden ratio continued fraction implementation.
aherbert [Tue, 2 Nov 2021 10:54:32 +0000 (10:54 +0000)] 
Reuse the golden ratio continued fraction implementation.

10 months agoNUMBERS-173: Set minimum bound on continued fraction epsilon
aherbert [Tue, 2 Nov 2021 10:48:35 +0000 (10:48 +0000)] 
NUMBERS-173: Set minimum bound on continued fraction epsilon

10 months agoSonar fix: Use assertEquals
Alex Herbert [Wed, 27 Oct 2021 11:21:57 +0000 (12:21 +0100)] 
Sonar fix: Use assertEquals

10 months agoSonar fix: lambda to contain only one source of an exception
Alex Herbert [Wed, 27 Oct 2021 11:19:47 +0000 (12:19 +0100)] 
Sonar fix: lambda to contain only one source of an exception

10 months agoCorrect javadoc
Alex Herbert [Tue, 26 Oct 2021 20:46:55 +0000 (21:46 +0100)] 
Correct javadoc

11 months agoPrevent caching infinite factorial values.
aherbert [Tue, 26 Oct 2021 10:19:42 +0000 (11:19 +0100)] 
Prevent caching infinite factorial values.

11 months agoUse String.format when doubles are used in messages.
aherbert [Tue, 26 Oct 2021 10:02:46 +0000 (11:02 +0100)] 
Use String.format when doubles are used in messages.

MessageFormat.format by default will represent numbers with too low a
precision. E.g. nextUp(1.5) is 1.5 not 1.5000000000000002.

11 months agoUse isFinite
aherbert [Tue, 26 Oct 2021 09:42:20 +0000 (10:42 +0100)] 
Use isFinite

11 months agoUpdate ErfDifference X_CRIT value
Alex Herbert [Fri, 22 Oct 2021 00:11:16 +0000 (01:11 +0100)] 
Update ErfDifference X_CRIT value

11 months agoTrack changes
Alex Herbert [Thu, 21 Oct 2021 08:40:59 +0000 (09:40 +0100)] 
Track changes