Skip to content

Fix property tests & update CI#71

Open
konsumlamm wants to merge 1 commit intoBodigrim:masterfrom
konsumlamm:quickcheck
Open

Fix property tests & update CI#71
konsumlamm wants to merge 1 commit intoBodigrim:masterfrom
konsumlamm:quickcheck

Conversation

@konsumlamm
Copy link
Contributor

Fixes #64.

There were some cases where division by zero could occur. I believe the reason these cases weren't triggered before is that older QuickCheck versions had a worse Arbitrary Rational instance.

@konsumlamm
Copy link
Contributor Author

Not sure why the CI failed, on my repo it worked.

prop_jacobi_de :: Rational -> Rational -> Property
prop_jacobi_de a b = foldl' (.&&.) (property True) $
prop_jacobi_de :: NonNegative Rational -> NonNegative Rational -> Property
prop_jacobi_de (NonNegative a) (NonNegative b) = foldl' (.&&.) (property True) $
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jacobi polynomials are defined for negative arguments, but our implementation is faulty. When a+b is integer, one can probably directly compute via the second formula at https://en.wikipedia.org/wiki/Jacobi_polynomials#Via_the_hypergeometric_function - two gamma functions degenerate to factorials and the ratio of other two is a Pochhammer symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix tests against QuickCheck-2.14.3

2 participants