Interval cosine function broken

Open
#13 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Inspect boost/numeric/interval/transc.hpp at the cos implementation and the rounded_math policy named in the compiler error. Run the supplied C++ reproducer to confirm the compilation failure; done means interval cosine compiles and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Description

Code to reproduce:

#include <boost/numeric/interval.hpp>

using boost::numeric::interval;
using namespace boost::numeric::interval_lib;

int main()
{
    auto x = cos(interval<double>(2.3));
    return 0;
}

Error message:

g++-7 -Wall -Wextra -Wfatal-errors -fext-numeric-literals main.cpp -o main.x -pthread
main.cpp: In function 'int main()':
main.cpp:8:10: warning: variable 'x' set but not used [-Wunused-but-set-variable]
     auto x = cos(interval<double>(2.3));
          ^
In file included from ../numeric/interval/include/boost/numeric/interval.hpp:30:0,
                 from main.cpp:1:
../numeric/interval/include/boost/numeric/interval/transc.hpp: In instantiation of 'boost::numeric::interval<T, Policies> boost::numeric::cos(const boost::numeric::interval<T, Policies>&) [with T = double; Policies = boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >]':
main.cpp:8:39:   required from here
../numeric/interval/include/boost/numeric/interval/transc.hpp:73:18: error: 'boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >::rounding {aka struct boost::numeric::interval_lib::rounded_math<double>}' has no member named 'cos_down'; did you mean 'conv_down'?
     return I(rnd.cos_down(u), rnd.cos_up(l), true);
              ~~~~^~~~~~~~
              conv_down
compilation terminated due to -Wfatal-errors.
make: *** [main.x] Error 1

Compiled against a fresh clone.

Dominant language
C++
Stars
31
Forks
48
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/interval

All issues in boostorg/interval

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.