-
Notifications
You must be signed in to change notification settings - Fork 12
Add new tests for Jacobi elliptic function simplification. #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add new tests for Jacobi elliptic function simplification. #22
Conversation
|
This is great work! Thanks for doing it.
|
a26f724 to
611b2ea
Compare
|
Looking good (modulo the squashing, no hurries though). How's the situation? |
9caffb1 to
aaaa5af
Compare
|
@alt-romes The squash will definitely be done, and maybe I should do one even before passing the tests. There's just a little trouble at the moment getting things to pass the tests. Achieving sum-of-products while collecting powers of variables in monomials is taking some thought to figure out how to deal with by using a cost function. |
|
I see, that doesn't sound easy indeed! |
@alt-romes It's probably safe to say that I'm a little stuck. The good news is that the rules seem to be involved enough to get testcases to spin for something like 45s. |
|
Great @NadiaYvette! That's good for benchmarking and optimizing the library further. I would argue that getting a cost function to arrive at a SOP simplification is not all that too important, not for the testsuite at least (it would be different if this were a symbolic maths library -- i'd like to do that some time in the image of Metatheory.jl, but in a separate project). Is your problem only that the simplification doesn't end up exactly as the one you wrote for the test? If so, I suggest you look at whatever it actually does rewrite the expressions too, and manually see if they are equivalent to the ones you were expecting, and if they were in fact simplified. If all is good, just write the thing it produces as the expected output -- even if that isn't exactly what you'd expect from a computer algebra system. |
eb291c6 to
d2862ab
Compare
Hand-resolve merge conflicts.
Various of these fail in a way, though they may be faults in the cost functions rather than the rewrite rules per se.
It's now a type synonym, so the decl is no longer valid.
Guiding sum-of-products simplification via cost functions with access only to outermost constructors is difficult. The effects are limited.
Also have the special value sinh(0)=0 and restore underscored helper function's name for use in the identities.
6ae764c to
e6630fa
Compare
|
I've rebased your PR and fixed the build and a TODO @NadiaYvette. |
This adds addition theorems, Pythagorean analogues, and derivatives where absent for cos, sin, cosh, sinh, and sn, cn, and dn in a new file in test/ -- Jacobi.hs derived from Sym.hs (mostly a copy with some new primops and rewrite rules).