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

Assertion error in eval_exp (transcendental.hpp) #120

Closed
kedarbhat opened this issue Feb 28, 2019 · 3 comments
Closed

Assertion error in eval_exp (transcendental.hpp) #120

kedarbhat opened this issue Feb 28, 2019 · 3 comments

Comments

@kedarbhat
Copy link

kedarbhat commented Feb 28, 2019

Since I can't delete this blank comment, I'll use the space.

The error below is with latest Boost 1.70. I'm not sure yet if this occurs in earlier versions.

@kedarbhat
Copy link
Author

kedarbhat commented Feb 28, 2019

I think this may be similar/related to issue #23. The below code (using boost::multiprecision::cpp_bin_float_50) fails an invariant in eval_exp (in transcendental.hpp). The computation using double as the type is included to verify it's a valid computation. This issue was discovered when boost::math::zeta was specialized with boost::multiprecision::cpp_bin_float_50, but this issue can be reproduced simply using the boost::multiprecision::exp call with the problematic argument.

BOOST_AUTO_TEST_CASE(multiprecision_zeta) {
  using T = boost::multiprecision::cpp_bin_float_50;
  static constexpr auto x = 2.0;
  static constexpr auto y = 95.0;
  T x_mp(x);
  T y_mp(y);
  auto answer = std::exp(y*std::log(x));
  BOOST_REQUIRE_CLOSE(answer, 3.9614081257131865e28, std::numeric_limits<T>::epsilon());
  auto answer_mp = boost::multiprecision::exp(y_mp*boost::multiprecision::log(x_mp));
  BOOST_REQUIRE_CLOSE(answer, answer_mp, std::numeric_limits<T>::epsilon());
}

@kedarbhat kedarbhat changed the title Assertion error in eval_exp (trancendental Assertion error in eval_exp (transcendental.hpp) Feb 28, 2019
jzmaddock added a commit that referenced this issue Mar 2, 2019
@jzmaddock
Copy link
Collaborator

Fixed in develop.

@kedarbhat
Copy link
Author

Thanks for the quick turnaround!

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

No branches or pull requests

2 participants