JuliaIntervals / TaylorModels.jl

Rigorous function approximation using Taylor models in Julia
Other
63 stars 14 forks source link

Fix bound_truncation for TaylorModel1 with TaylorN{T} coeffs #136

Closed lbenet closed 2 years ago

lbenet commented 2 years ago

Fixes #135

lbenet commented 2 years ago

With this PR, the example in #135 yields:

julia> using TaylorModels;

julia> xN, yN = set_variables("x y", order=4, numvars=2);

julia> xtm1_order5 = exp( TaylorModel1( Taylor1(xN, 5), 0..0, 0..0, -0.5 .. 0.5) )
  1.0 + 1.0 x + 0.5 x² + 0.16666666666666666 x³ + 0.041666666666666664 x⁴ + [-4.63936, 3.17106]

julia> xtm1_order4 = TaylorModel1( Taylor1(xN, 4), 0..0, 0..0, -0.5 .. 0.5)
  1.0 x + [0, 0]

julia> new_xtm1_order4, _ = TaylorSeries.fixorder(xtm1_order5, xtm1_order4)
(  1.0 + 1.0 x + 0.5 x² + 0.16666666666666666 x³ + 0.041666666666666664 x⁴ + [-4.63936, 3.17106],   1.0 x + [0, 0])

julia> exp(xtm1_order4)
  1.0 + 1.0 x + 0.5 x² + 0.16666666666666666 x³ + 0.041666666666666664 x⁴ + [-4.61679, 3.16968]
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 1935247971

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/auxiliary.jl 0 6 0.0%
<!-- Total: 0 6 0.0% -->
Totals Coverage Status
Change from base Build 1930417175: -0.1%
Covered Lines: 1005
Relevant Lines: 1544

💛 - Coveralls
lbenet commented 2 years ago

cc @AnderGray