ekmett / intervals

Interval Arithmetic
http://hackage.haskell.org/package/intervals
BSD 2-Clause "Simplified" License
27 stars 13 forks source link

Conservative trig functions #29

Closed dmcclean closed 9 years ago

dmcclean commented 10 years ago

Fixes issue #20 and related issues.

I have doctests that test this, but they also test everything else (#4), and I didn't want to send up one pull request that was so huge.

See if you think that this approach can be modified to work for empty/kaucher intervals or whether you want to go a different way to address #20.

dmcclean commented 10 years ago

Wait, don't merge this. While I was driving home from Akamai I had a thought that it might be wrong "with probability 0" (on the reals) when the interval starts exactly at a local extreme and extends beyond the other local extreme.

Will test and patch in a bit.

dmcclean commented 10 years ago

OK, fixed that problem. I'm not a big fan of it because it is a bit redundant (lines 107-110 are almost exactly like 101-104) but I can't think of a way to clean it up without either pattern synonyms, view patterns, or complicated pattern guards.

dmcclean commented 9 years ago

Closing this, as it is better done as part of a larger pull request I have prepared.

ekmett commented 9 years ago

Fair nuff