simpleqt commented on PR #140:
URL:
https://github.com/apache/commons-statistics/pull/140#issuecomment-6642831523
Both done, on head `3d3f1d14` (one commit, now three files).
**PMD.** Fixed with the constant, as you suggested: `private static final
double HALF = 0.5;` at the top of the class, and the new helpers use it.
`cotPi` needs the value for a different reason (whether `pi * x` is below one
half, where `1 / tan` is more accurate), so it uses the same constant rather
than a second name.
I reproduced the failure before fixing it rather than trusting the green
run: putting the literal back in the condition alone reinstates exactly what CI
reported.
```
PMD with the literal back in the if-condition:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-pmd-plugin:3.28.0:check (default-cli) on project
commons-statistics-distribution: PMD 7.28.0 has found 1 violation.
after the fix:
[INFO] BUILD SUCCESS
```
Also run locally: `checkstyle:check` -> `You have 0 Checkstyle violations.`,
and `-Dtest=CauchyDistributionTest` -> `Tests run: 58, Failures: 0, Errors: 0,
Skipped: 0`. CI on `3d3f1d14` has no check runs yet, so none of that is a CI
result.
**JIRA and the change log.** The commit message now starts with the ticket
in the subject body:
```
Fix the Cauchy distribution quantile function in the tails
STATISTICS-102
```
and `src/changes/changes.xml` has an entry in the 1.4 release referencing
`STATISTICS-102`:
```xml
<action dev="aherbert" type="fix" due-to="simpleqt" issue="STATISTICS-102">
"CauchyDistribution": Correct the inverse cumulative probability function.
Subtraction of one half from a probability close to 0 or 1 discarded the
significant digits, so the result saturated in the tails and was not
monotonic. The tails are evaluated using the equivalent cotangent forms
of the tangent.
</action>
```
I used your `dev` attribute since the section is otherwise yours throughout;
say the word if you would rather attribute it differently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]