JuliaIntervals / ValidatedNumerics.jl

Rigorous floating-point calculations with interval arithmetic in Julia
Other
85 stars 17 forks source link

Rounding modes using traits #220

Closed dpsanders closed 7 years ago

dpsanders commented 7 years ago

This is an implementation of changing the global rounding mode using "traits".

Note that actually changing the rounding mode for calculations works only on Julia v0.6, since it depends on the solution to https://github.com/JuliaLang/julia/issues/265.

From the point of view of the user, it reduces to doing

setrounding(Interval, :correct)

I have not yet added tests.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.07%) to 87.244% when pulling 551b7bc6a6405a0d6d5f12856409b3a01ea878b6 on rounding_modes_traits into daba4ef55ff2e536ec40d5684b1f452b8af50560 on master.

codecov-io commented 7 years ago

Codecov Report

Merging #220 into master will decrease coverage by 1.54%. The diff coverage is 40.47%.

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
- Coverage   91.33%   89.78%   -1.55%     
==========================================
  Files          26       26              
  Lines        1050     1067      +17     
==========================================
- Hits          959      958       -1     
- Misses         91      109      +18
Impacted Files Coverage Δ
src/intervals/functions.jl 95.74% <ø> (ø) :white_check_mark:
src/intervals/arithmetic.jl 100% <ø> (+1.32%) :white_check_mark:
src/ValidatedNumerics.jl 100% <ø> (ø) :white_check_mark:
src/intervals/rounding.jl 41.02% <39.47%> (-35.45%) :x:
src/intervals/precision.jl 84.61% <50%> (-5.04%) :x:

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 de9e9d2...980e350. Read the comment docs.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.9%) to 87.441% when pulling 53c9728305dbbaed83cd7a2089c97f4bef935f46 on rounding_modes_traits into daba4ef55ff2e536ec40d5684b1f452b8af50560 on master.

dpsanders commented 7 years ago

I changed RoundingType --> IntervalRounding for clarity and precision

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 8a20506937eae1690adc80894d07dd96a7b57575 on rounding_modes_traits into on master.

dpsanders commented 7 years ago

I think the CRlibm problem was because it requires CRlibm v0.5. This should now be fixed.

dpsanders commented 7 years ago

This branch is aimed only at post-Julia-0.4.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.1%) to 89.199% when pulling c02caed87a9dbe489ed0af86dfe8ff2ea3f32d06 on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.5%) to 89.784% when pulling 854092991593dec3bf59c72dccaf5798de08751c on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.5%) to 89.784% when pulling 854092991593dec3bf59c72dccaf5798de08751c on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.5%) to 89.784% when pulling 854092991593dec3bf59c72dccaf5798de08751c on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.5%) to 89.784% when pulling 854092991593dec3bf59c72dccaf5798de08751c on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

dpsanders commented 7 years ago

This is ready. All tests pass on 0.5, and all tests except multidimensional pass on 0.6; these are waiting for StaticArrays improvements.

I added a basic test in interval_tests/rounding.jl for changing the rounding mode. This checks that the sin function is correctly redefined on 0.6 (and is only run on 0.6) and tests pass there. The tests are tricky to get right due to "world-age" problems (the fix of Julia issue #265 on redefining dependent functions.)

I would like to merge and release 0.8.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.5%) to 89.784% when pulling 980e350cd9f905e5af13f413e8d468a716c9b909 on rounding_modes_traits into de9e9d26624059029e8b67b72e9e49adda387afb on master.

lbenet commented 7 years ago

Merging...