Skip to content
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

Fix tan #22

Merged
merged 4 commits into from
May 19, 2017
Merged

Fix tan #22

merged 4 commits into from
May 19, 2017

Conversation

dpsanders
Copy link
Member

No description provided.

@dpsanders
Copy link
Member Author

dpsanders commented Apr 30, 2017

Tests are failing for values right on quadrant boundaries, but I don't see what to do about that.
Tests are now passing.

@dpsanders dpsanders mentioned this pull request May 1, 2017
@codecov-io
Copy link

codecov-io commented May 1, 2017

Codecov Report

Merging #22 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   92.14%   92.15%   +<.01%     
==========================================
  Files          22       22              
  Lines         917      918       +1     
==========================================
+ Hits          845      846       +1     
  Misses         72       72
Impacted Files Coverage Δ
src/multidim/intervalbox.jl 81.25% <ø> (ø) ⬆️
src/intervals/trigonometric.jl 99.1% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0bb130...ae79f37. Read the comment docs.

@lbenet
Copy link
Member

lbenet commented May 18, 2017

Tests are passing, so I think we should also merge this.

@lbenet
Copy link
Member

lbenet commented Jun 9, 2017

I'm reopening this because the issue isn't really solved.

Current master yields the following:

julia>    # This examples appears in the tests
x = 2.0^1000
1.0715086071862673e301

julia> Interval(x)
Interval(1.0715086071862673e301, 1.0715086071862673e301)

julia> big(2.0)^1000  ans   # OK
true

julia> # This seems to be a corner case
x = Interval(2.0)^100
Interval(1.2676506002282294e30, 1.2676506002282294e30)

julia> tan(x)
Interval(-1.7829551493767193, -1.782955149376719)

julia> big(2.0)^100  ans    # WRONG
false

julia> # Another case
x = Interval(2.0)^60
Interval(1.152921504606847e18, 1.152921504606847e18)

julia> tan(x)  # USEFUL ?
Interval(-Inf, Inf)

julia> prevfloat(tan(x.lo)), nextfloat(tan(x.hi))
(1.4918373962705977, 1.4918373962705977)

julia> tan(big(2.0)^60) # this is contained by the bounds above 
1.491837396270597700887517480636152973049592658670418036396829287651786928528278

The problem seems to be in find_quadrant, more concretely in this line, which for intervals with large values returns results that are not accurate enough to be useful. (Note that currently, temp in that function corresponds to Interval(Inf,Inf), for Interval(2.0)^1000 in the tests, which makes no sense.)

@dpsanders
Copy link
Member Author

I agree that there's an issue with large values of the argument, but I have no idea how to fix it!

I believe that Siegfried Rump has a method for this.

@lbenet
Copy link
Member

lbenet commented Jun 9, 2017

For the case of tan I think I understand where our method is weak; that weekness should somehow also appear elsewhere.

@dpsanders
Copy link
Member Author

All the trig functions have problems with large arguments. But I don't think it's worth spending that much effort on myself.

@dpsanders dpsanders deleted the fix_tan branch August 2, 2017 19:39
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.

3 participants