You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.3 KiB

  1. From 5f19fd7dc6c4dd37fb0409f08a0b7dbb887dd516 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Thu, 19 Dec 2019 17:46:46 -0800
  4. Subject: [PATCH] roots: Fix fma_workaround
  5. fma takes three parameters, not one.
  6. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  7. ---
  8. include/boost/math/tools/roots.hpp | 6 +++---
  9. 1 file changed, 3 insertions(+), 3 deletions(-)
  10. diff --git a/boost/math/tools/roots.hpp b/boost/math/tools/roots.hpp
  11. index 8b3ab7eb9..5d7936bb2 100644
  12. --- a/boost/math/tools/roots.hpp
  13. +++ b/boost/math/tools/roots.hpp
  14. @@ -861,10 +861,10 @@ Complex complex_newton(F g, Complex guess, int max_iterations = std::numeric_lim
  15. namespace detail
  16. {
  17. #if defined(BOOST_GNU_STDLIB) && !defined(_GLIBCXX_USE_C99_MATH_TR1)
  18. -float fma_workaround(float f) { return ::fmaf(f); }
  19. -double fma_workaround(double f) { return ::fma(f); }
  20. +inline float fma_workaround(float x, float y, float z) { return ::fmaf(x, y, z); }
  21. +inline double fma_workaround(double x, double y, double z) { return ::fma(x, y, z); }
  22. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  23. -long double fma_workaround(long double f) { return ::fmal(f); }
  24. +inline long double fma_workaround(long double x, long double y, long double z) { return ::fmal(x, y, z); }
  25. #endif
  26. #endif
  27. template<class T>