From be152a8d41bd153306c932c5445bd57fa8cf5bd9 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 13 Feb 2021 17:16:18 +0100 Subject: [PATCH 01/19] [CI SKIP] e_float.hpp (2021) from mborland branch --- include/boost/math/bindings/e_float.hpp | 1284 +++++++++-------------- 1 file changed, 511 insertions(+), 773 deletions(-) diff --git a/include/boost/math/bindings/e_float.hpp b/include/boost/math/bindings/e_float.hpp index 0411da793..4adc5fad0 100644 --- a/include/boost/math/bindings/e_float.hpp +++ b/include/boost/math/bindings/e_float.hpp @@ -1,809 +1,547 @@ -// Copyright John Maddock 2008. +// Copyright John Maddock 2012 - 2021. +// Copyright Christopher Kormanyos 2017 - 2021. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Wrapper that works with mpfr_class defined in gmpfrxx.h -// See http://math.berkeley.edu/~wilken/code/gmpfrxx/ -// Also requires the gmp and mpfr libraries. -// -#ifndef BOOST_MATH_E_FLOAT_BINDINGS_HPP -#define BOOST_MATH_E_FLOAT_BINDINGS_HPP +// Wrapper that works with ::e_float-2021 +// See https://github.com/ckormanyos/::e_float-2021 -#include +#ifndef E_FLOAT_2017_08_18_HPP_ + #define E_FLOAT_2017_08_18_HPP_ + #include + #include + #include -#include -#include + #include + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include + #include + namespace boost { namespace math { namespace ef { -namespace boost{ namespace math{ namespace ef{ + // Forward declaration of the e_float multiple precision class. + // This class binds native ::e_float to boost::multiprecsion::e_float. + class e_float; -class e_float -{ -public: - // Constructors: - e_float() {} - e_float(const ::e_float& c) : m_value(c){} - e_float(char c) - { - m_value = ::e_float(c); - } -#ifndef BOOST_NO_INTRINSIC_WCHAR_T - e_float(wchar_t c) - { - m_value = ::e_float(c); - } -#endif - e_float(unsigned char c) - { - m_value = ::e_float(c); - } - e_float(signed char c) - { - m_value = ::e_float(c); - } - e_float(unsigned short c) - { - m_value = ::e_float(c); - } - e_float(short c) - { - m_value = ::e_float(c); - } - e_float(unsigned int c) - { - m_value = ::e_float(c); - } - e_float(int c) - { - m_value = ::e_float(c); - } - e_float(unsigned long c) - { - m_value = ::e_float((UINT64)c); - } - e_float(long c) - { - m_value = ::e_float((INT64)c); - } -#ifdef BOOST_HAS_LONG_LONG - e_float(boost::ulong_long_type c) - { - m_value = ::e_float(c); - } - e_float(boost::long_long_type c) - { - m_value = ::e_float(c); - } -#endif - e_float(float c) - { - assign_large_real(c); - } - e_float(double c) - { - assign_large_real(c); - } - e_float(long double c) - { - assign_large_real(c); - } + } } } - // Assignment: - e_float& operator=(char c) { m_value = ::e_float(c); return *this; } - e_float& operator=(unsigned char c) { m_value = ::e_float(c); return *this; } - e_float& operator=(signed char c) { m_value = ::e_float(c); return *this; } -#ifndef BOOST_NO_INTRINSIC_WCHAR_T - e_float& operator=(wchar_t c) { m_value = ::e_float(c); return *this; } -#endif - e_float& operator=(short c) { m_value = ::e_float(c); return *this; } - e_float& operator=(unsigned short c) { m_value = ::e_float(c); return *this; } - e_float& operator=(int c) { m_value = ::e_float(c); return *this; } - e_float& operator=(unsigned int c) { m_value = ::e_float(c); return *this; } - e_float& operator=(long c) { m_value = ::e_float((INT64)c); return *this; } - e_float& operator=(unsigned long c) { m_value = ::e_float((UINT64)c); return *this; } -#ifdef BOOST_HAS_LONG_LONG - e_float& operator=(boost::long_long_type c) { m_value = ::e_float(c); return *this; } - e_float& operator=(boost::ulong_long_type c) { m_value = ::e_float(c); return *this; } -#endif - e_float& operator=(float c) { assign_large_real(c); return *this; } - e_float& operator=(double c) { assign_large_real(c); return *this; } - e_float& operator=(long double c) { assign_large_real(c); return *this; } + // Define the number category as a floating-point kind + // for the e_float. This is needed for properly + // interacting as a backend with boost::muliprecision. + template<> + struct boost::multiprecision::number_category + : public boost::mpl::int_ { }; - // Access: - ::e_float& value(){ return m_value; } - ::e_float const& value()const{ return m_value; } + namespace boost { namespace math { namespace ef { - // Member arithmetic: - e_float& operator+=(const e_float& other) - { m_value += other.value(); return *this; } - e_float& operator-=(const e_float& other) - { m_value -= other.value(); return *this; } - e_float& operator*=(const e_float& other) - { m_value *= other.value(); return *this; } - e_float& operator/=(const e_float& other) - { m_value /= other.value(); return *this; } - e_float operator-()const - { return -m_value; } - e_float const& operator+()const - { return *this; } + // This is the e_float multiple precision class. + class e_float + { + public: + typedef boost::mpl::list< signed long long> signed_types; + typedef boost::mpl::list unsigned_types; + typedef boost::mpl::list float_types; + typedef std::int64_t exponent_type; -private: - ::e_float m_value; + e_float() : m_value() { } - template - void assign_large_real(const V& a) - { - using std::frexp; - using std::ldexp; - using std::floor; - if (a == 0) { - m_value = ::ef::zero(); - return; - } + explicit e_float(const ::e_float& rep) : m_value(rep) { } - if (a == 1) { - m_value = ::ef::one(); - return; - } + e_float(const e_float& other) : m_value(other.m_value) { } - if ((boost::math::isinf)(a)) + template::value == true) + && (std::is_unsigned::value == true))>::type const* = nullptr> + e_float(UnsignedIntegralType u) : m_value(::e_float(std::uint64_t(u))) { } + + template::value == true) + && (std::is_signed ::value == true))>::type const* = nullptr> + e_float(SignedIntegralType n) : m_value(::e_float(std::int64_t(n))) { } + + template::value == true>::type const* = nullptr> + e_float(FloatingPointType f) : m_value(::e_float(static_cast(f))) { } + + e_float(const char* c) : m_value(c) { } + + e_float(const std::string& str) : m_value(str) { } + + virtual ~e_float(); + + e_float& operator=(const e_float& other) + { + m_value = other.m_value; + + return *this; + } + + template::value == true>::type const* = nullptr> + e_float& operator=(const ArithmeticType& x) + { + m_value = ::e_float(x); + + return *this; + } + + e_float& operator=(const std::string& str_rep) { m_value = ::e_float(str_rep); return *this; } + e_float& operator=(const char* char_ptr) { m_value = ::e_float(char_ptr); return *this; } + + void swap(e_float& other_mp_cpp_backend) + { + m_value.swap(other_mp_cpp_backend.m_value); + } + + ::e_float& representation() { return m_value; } + const ::e_float& representation() const { return m_value; } + const ::e_float& crepresentation() const { return m_value; } + + std::string str(std::streamsize number_of_digits, const std::ios::fmtflags format_flags) const + { + std::string my_result_str; + std::stringstream my_stream_str; + + my_stream_str.flags(format_flags); + + static_cast(my_stream_str.precision(number_of_digits)); + + m_value.wr_string(my_result_str, my_stream_str); + + return my_result_str; + } + + void negate() + { + m_value.negate(); + } + + int compare(const e_float& other_mp_cpp_backend) const + { + return static_cast(m_value.compare(other_mp_cpp_backend.m_value)); + } + + template::value == true>::type const* = nullptr> + int compare(ArithmeticType x) + { + return static_cast(m_value.compare(::e_float(x))); + } + + private: + ::e_float m_value; + + e_float& operator=(const ::e_float&) = delete; + }; + + e_float::~e_float() { } + + void eval_add(e_float& result, const e_float& x) + { + result.representation() += x.crepresentation(); + } + + void eval_subtract(e_float& result, const e_float& x) + { + result.representation() -= x.crepresentation(); + } + + void eval_multiply(e_float& result, const e_float& x) + { + result.representation() *= x.crepresentation(); + } + + template::value == true) + && (std::is_signed ::value == true))>::type const* = nullptr> + void eval_multiply(e_float& result, const SignedIntegralType& n) + { + result.representation().mul_signed_long_long(static_cast(n)); + } + + void eval_divide(e_float& result, const e_float& x) + { + result.representation() /= x.crepresentation(); + } + + template::value == true) + && (std::is_signed ::value == true))>::type const* = nullptr> + void eval_divide(e_float& result, const SignedIntegralType& n) + { + result.representation().div_signed_long_long(static_cast(n)); + } + + bool eval_eq(const e_float& a, const e_float& b) + { + return (a.compare(b) == 0); + } + + template::value == true>::type const* = nullptr> + bool eval_eq(const e_float& a, const ArithmeticType& b) + { + return (a.compare(b) == 0); + } + + template::value == true>::type const* = nullptr> + bool eval_eq(const ArithmeticType& a, const e_float& b) + { + return (e_float(a).compare(b) == 0); + } + + bool eval_gt(const e_float& a, const e_float& b) + { + return (a.compare(b) == 1); + } + + template::value == true>::type const* = nullptr> + bool eval_gt(const e_float& a, const ArithmeticType& b) + { + return (a.compare(b) == 1); + } + + template::value>::type const* = nullptr> + bool eval_gt(const ArithmeticType& a, const e_float& b) + { + return (e_float(a).compare(b) == 1); + } + + bool eval_lt(const e_float& a, const e_float& b) + { + return (a.compare(b) == -1); + } + + template::value == true>::type const* = nullptr> + bool eval_lt(const e_float& a, const ArithmeticType& b) + { + return (a.compare(b) == -1); + } + + template::value == true>::type const* = nullptr> + bool eval_lt(const ArithmeticType& a, const e_float& b) + { + return (e_float(a).compare(b) == -1); + } + + bool eval_is_zero(const e_float& x) + { + return x.crepresentation().iszero(); + } + + int eval_get_sign(const e_float& x) + { + if (x.crepresentation().iszero()) { return 0; } + else if(x.crepresentation().isneg ()) { return -1; } + else { return 1; } + } + + void eval_convert_to(unsigned long long* result, + const e_float& val) + { + *result = (val.crepresentation()).extract_unsigned_long_long(); + } + + void eval_convert_to(signed long long* result, + const e_float& val) + { + *result = (val.crepresentation()).extract_signed_long_long(); + } + + void eval_convert_to(long double* result, + const e_float& val) + { + *result = (val.crepresentation()).extract_long_double(); + } + + void eval_frexp( e_float& result, + const e_float& x, + typename e_float::exponent_type* expptr) + { + typedef int local_exponent_type; + + local_exponent_type exp2; + + result.representation() = ::ef::frexp(x.crepresentation(), &exp2); + + *expptr = static_cast(exp2); + } + + void eval_frexp(e_float& result, + const e_float& x, + int* expptr, + typename std::enable_if::value == false>::type const* = nullptr) + { + result.representation() = ::ef::frexp(x.crepresentation(), expptr); + } + + void eval_ldexp( e_float& result, + const e_float& x, + const typename e_float::exponent_type exp_value) + { + typedef int local_exponent_type; + + result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); + } + + void eval_ldexp(e_float& result, + const e_float& x, + int exp_value, + typename std::enable_if::value == false>::type const* = nullptr) + { + typedef int local_exponent_type; + + result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); + } + + void eval_floor( e_float& result, + const e_float& x) + { + result.representation() = ::ef::floor(x.crepresentation()); + } + + void eval_ceil( e_float& result, + const e_float& x) + { + result.representation() = ::ef::ceil(x.crepresentation()); + } + + int eval_fpclassify(const e_float& x) + { + if ((x.crepresentation().isinf)()) { return FP_INFINITE; } + else if((x.crepresentation().isnan)()) { return FP_NAN; } + else if( x.crepresentation().iszero()) { return FP_ZERO; } + else { return FP_NORMAL; } + } + + void eval_trunc( e_float& result, + const e_float& x) + { + result.representation() = ::ef::integer_part(x.crepresentation()); + } + + void eval_abs( e_float& result, + const e_float& x) + { + result.representation() = x.crepresentation(); + + if(result.crepresentation().isneg()) + { + result.representation().negate(); + } + } + + void eval_fabs( e_float& result, + const e_float& x) + { + result.representation() = x.crepresentation(); + + if(result.crepresentation().isneg()) + { + result.representation().negate(); + } + } + + void eval_sqrt( e_float& result, + const e_float& x) + { + result.representation() = ::ef::sqrt(x.crepresentation()); + } + + void eval_sin( e_float& result, + const e_float& x) + { + result.representation() = ::ef::sin(x.crepresentation()); + } + + void eval_cos( e_float& result, + const e_float& x) + { + result.representation() = ::ef::cos(x.crepresentation()); + } + + void eval_tan( e_float& result, + const e_float& x) + { + result.representation() = ::ef::tan(x.crepresentation()); + } + + void eval_asin( e_float& result, + const e_float& x) + { + result.representation() = ::ef::asin(x.crepresentation()); + } + + void eval_acos( e_float& result, + const e_float& x) + { + result.representation() = ::ef::acos(x.crepresentation()); + } + + void eval_atan( e_float& result, + const e_float& x) + { + result.representation() = ::ef::atan(x.crepresentation()); + } + + void eval_atan2( e_float& result, + const e_float& y, + const e_float& x) + { + result.representation() = ::ef::atan2(y.crepresentation(), x.crepresentation()); + } + + void eval_log( e_float& result, + const e_float& x) + { + result.representation() = ::ef::log(x.crepresentation()); + } + + void eval_log10( e_float& result, + const e_float& x) + { + result.representation() = ::ef::log10(x.crepresentation()); + } + + void eval_exp( e_float& result, + const e_float& x) + { + result.representation() = ::ef::exp(x.crepresentation()); + } + + void eval_sinh( e_float& result, + const e_float& x) + { + result.representation() = ::ef::sinh(x.crepresentation()); + } + + void eval_cosh( e_float& result, + const e_float& x) + { + result.representation() = ::ef::cosh(x.crepresentation()); + } + + void eval_tanh( e_float& result, + const e_float& x) + { + result.representation() = ::ef::tanh(x.crepresentation()); + } + + void eval_fmod( e_float& result, + const e_float& x, + const e_float& y) + { + if(y.crepresentation().iszero()) + { + result.representation() = ::ef::zero(); + } + else + { + // Calculate the fractional part of x such that: + // x = (integer_part * y) + fractional_part, + // where + // |fractional_part| < |y|, + // and fractional_part has the same sign as x. + + const ::e_float integer_part = ::ef::floor(x.crepresentation() / y.crepresentation()); + + result.representation() = + x.crepresentation() - (integer_part * y.crepresentation()); + + if(x.crepresentation().isneg() != y.crepresentation().isneg()) { - m_value = a > 0 ? m_value.my_value_inf() : -m_value.my_value_inf(); - return; - } - if((boost::math::isnan)(a)) - { - m_value = m_value.my_value_nan(); - return; + result.representation() -= y.crepresentation(); } + } + } - int e; - long double f, term; - ::e_float t; - m_value = ::ef::zero(); + void eval_pow( e_float& result, + const e_float& x, + const e_float& a) + { + result.representation() = ::ef::pow(x.crepresentation(), a.crepresentation()); + } - f = frexp(a, &e); + } } } // namespace boost::math::ef - ::e_float shift = ::ef::pow2(30); + namespace boost { namespace math { namespace policies { - while(f) - { - // extract 30 bits from f: - f = ldexp(f, 30); - term = floor(f); - e -= 30; - m_value *= shift; - m_value += ::e_float(static_cast(term)); - f -= term; - } - m_value *= ::ef::pow2(e); - } -}; + // Specialization of the precision structure. + template + struct precision, + ThisPolicy> + { + typedef typename ThisPolicy::precision_type precision_type; + typedef digits2<((::e_float::ef_digits10 + 1LL) * 1000LL) / 301LL> local_digits_2; -// Non-member arithmetic: -inline e_float operator+(const e_float& a, const e_float& b) -{ - e_float result(a); - result += b; - return result; -} -inline e_float operator-(const e_float& a, const e_float& b) -{ - e_float result(a); - result -= b; - return result; -} -inline e_float operator*(const e_float& a, const e_float& b) -{ - e_float result(a); - result *= b; - return result; -} -inline e_float operator/(const e_float& a, const e_float& b) -{ - e_float result(a); - result /= b; - return result; -} - -// Comparison: -inline bool operator == (const e_float& a, const e_float& b) -{ return a.value() == b.value() ? true : false; } -inline bool operator != (const e_float& a, const e_float& b) -{ return a.value() != b.value() ? true : false;} -inline bool operator < (const e_float& a, const e_float& b) -{ return a.value() < b.value() ? true : false; } -inline bool operator <= (const e_float& a, const e_float& b) -{ return a.value() <= b.value() ? true : false; } -inline bool operator > (const e_float& a, const e_float& b) -{ return a.value() > b.value() ? true : false; } -inline bool operator >= (const e_float& a, const e_float& b) -{ return a.value() >= b.value() ? true : false; } - -std::istream& operator >> (std::istream& is, e_float& f) -{ - return is >> f.value(); -} - -std::ostream& operator << (std::ostream& os, const e_float& f) -{ - return os << f.value(); -} - -inline e_float fabs(const e_float& v) -{ - return ::ef::fabs(v.value()); -} - -inline e_float abs(const e_float& v) -{ - return ::ef::fabs(v.value()); -} - -inline e_float floor(const e_float& v) -{ - return ::ef::floor(v.value()); -} - -inline e_float ceil(const e_float& v) -{ - return ::ef::ceil(v.value()); -} - -inline e_float pow(const e_float& v, const e_float& w) -{ - return ::ef::pow(v.value(), w.value()); -} - -inline e_float pow(const e_float& v, int i) -{ - return ::ef::pow(v.value(), ::e_float(i)); -} - -inline e_float exp(const e_float& v) -{ - return ::ef::exp(v.value()); -} - -inline e_float log(const e_float& v) -{ - return ::ef::log(v.value()); -} - -inline e_float sqrt(const e_float& v) -{ - return ::ef::sqrt(v.value()); -} - -inline e_float sin(const e_float& v) -{ - return ::ef::sin(v.value()); -} - -inline e_float cos(const e_float& v) -{ - return ::ef::cos(v.value()); -} - -inline e_float tan(const e_float& v) -{ - return ::ef::tan(v.value()); -} - -inline e_float acos(const e_float& v) -{ - return ::ef::acos(v.value()); -} - -inline e_float asin(const e_float& v) -{ - return ::ef::asin(v.value()); -} - -inline e_float atan(const e_float& v) -{ - return ::ef::atan(v.value()); -} - -inline e_float atan2(const e_float& v, const e_float& u) -{ - return ::ef::atan2(v.value(), u.value()); -} - -inline e_float ldexp(const e_float& v, int e) -{ - return v.value() * ::ef::pow2(e); -} - -inline e_float frexp(const e_float& v, int* expon) -{ - double d; - INT64 i; - v.value().extract_parts(d, i); - *expon = static_cast(i); - return v.value() * ::ef::pow2(-i); -} - -inline e_float sinh (const e_float& x) -{ - return ::ef::sinh(x.value()); -} - -inline e_float cosh (const e_float& x) -{ - return ::ef::cosh(x.value()); -} - -inline e_float tanh (const e_float& x) -{ - return ::ef::tanh(x.value()); -} - -inline e_float asinh (const e_float& x) -{ - return ::ef::asinh(x.value()); -} - -inline e_float acosh (const e_float& x) -{ - return ::ef::acosh(x.value()); -} - -inline e_float atanh (const e_float& x) -{ - return ::ef::atanh(x.value()); -} - -e_float fmod(const e_float& v1, const e_float& v2) -{ - e_float n; - if(v1 < 0) - n = ceil(v1 / v2); - else - n = floor(v1 / v2); - return v1 - n * v2; -} - -} namespace detail{ - -template <> -inline int fpclassify_imp< boost::math::ef::e_float> BOOST_NO_MACRO_EXPAND(boost::math::ef::e_float x, const generic_tag&) -{ - if(x.value().isnan()) - return FP_NAN; - if(x.value().isinf()) - return FP_INFINITE; - if(x == 0) - return FP_ZERO; - return FP_NORMAL; -} - -} namespace ef{ - -template -inline int itrunc(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::trunc(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::itrunc<%1%>(%1%)", 0, 0, v, pol)); - return static_cast(r.value().extract_int64()); -} - -template -inline long ltrunc(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::trunc(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::ltrunc<%1%>(%1%)", 0, 0L, v, pol)); - return static_cast(r.value().extract_int64()); -} - -#ifdef BOOST_HAS_LONG_LONG -template -inline boost::long_long_type lltrunc(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::trunc(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, 0LL, pol).value().extract_int64()); - return static_cast(r.value().extract_int64()); -} -#endif - -template -inline int iround(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::round(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::iround<%1%>(%1%)", 0, v, 0, pol).value().extract_int64()); - return static_cast(r.value().extract_int64()); -} - -template -inline long lround(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::round(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::lround<%1%>(%1%)", 0, v, 0L, pol).value().extract_int64()); - return static_cast(r.value().extract_int64()); -} - -#ifdef BOOST_HAS_LONG_LONG -template -inline boost::long_long_type llround(const e_float& v, const Policy& pol) -{ - BOOST_MATH_STD_USING - e_float r = boost::math::round(v, pol); - if(fabs(r) > (std::numeric_limits::max)()) - return static_cast(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, 0LL, pol).value().extract_int64()); - return static_cast(r.value().extract_int64()); -} -#endif - -}}} - -namespace std{ - - template<> - class numeric_limits< ::boost::math::ef::e_float> : public numeric_limits< ::e_float> - { - public: - static const ::boost::math::ef::e_float (min) (void) - { - return (numeric_limits< ::e_float>::min)(); - } - static const ::boost::math::ef::e_float (max) (void) - { - return (numeric_limits< ::e_float>::max)(); - } - static const ::boost::math::ef::e_float epsilon (void) - { - return (numeric_limits< ::e_float>::epsilon)(); - } - static const ::boost::math::ef::e_float round_error(void) - { - return (numeric_limits< ::e_float>::round_error)(); - } - static const ::boost::math::ef::e_float infinity (void) - { - return (numeric_limits< ::e_float>::infinity)(); - } - static const ::boost::math::ef::e_float quiet_NaN (void) - { - return (numeric_limits< ::e_float>::quiet_NaN)(); - } - // - // e_float's supplied digits member is wrong - // - it should be same the same as digits 10 - // - given that radix is 10. - // - static const int digits = digits10; - }; - -} // namespace std - -namespace boost{ namespace math{ - -namespace policies{ - -template -struct precision< ::boost::math::ef::e_float, Policy> -{ - typedef typename Policy::precision_type precision_type; - typedef digits2<((::std::numeric_limits< ::boost::math::ef::e_float>::digits10 + 1) * 1000L) / 301L> digits_2; - typedef typename mpl::if_c< - ((digits_2::value <= precision_type::value) - || (Policy::precision_type::value <= 0)), - // Default case, full precision for RealType: - digits_2, - // User customised precision: - precision_type - >::type type; -}; - -} - -namespace tools{ - -template <> -inline int digits< ::boost::math::ef::e_float>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC( ::boost::math::ef::e_float)) -{ - return ((::std::numeric_limits< ::boost::math::ef::e_float>::digits10 + 1) * 1000L) / 301L; -} - -template <> -inline ::boost::math::ef::e_float root_epsilon< ::boost::math::ef::e_float>() -{ - return detail::root_epsilon_imp(static_cast< ::boost::math::ef::e_float const*>(0), boost::integral_constant()); -} - -template <> -inline ::boost::math::ef::e_float forth_root_epsilon< ::boost::math::ef::e_float>() -{ - return detail::forth_root_epsilon_imp(static_cast< ::boost::math::ef::e_float const*>(0), boost::integral_constant()); -} - -} - -namespace lanczos{ - -template -struct lanczos -{ - typedef typename mpl::if_c< - std::numeric_limits< ::e_float>::digits10 < 22, - lanczos13UDT, - typename mpl::if_c< - std::numeric_limits< ::e_float>::digits10 < 36, - lanczos22UDT, - typename mpl::if_c< - std::numeric_limits< ::e_float>::digits10 < 50, - lanczos31UDT, - typename mpl::if_c< - std::numeric_limits< ::e_float>::digits10 < 110, - lanczos61UDT, - undefined_lanczos - >::type - >::type + typedef typename mpl::if_c + < + ( (local_digits_2::value <= precision_type::value) + || (precision_type::value <= 0)), + local_digits_2, + precision_type >::type - >::type type; -}; + type; + }; -} // namespace lanczos + } } } // namespaces boost::math::policies -template -inline boost::math::ef::e_float skewness(const extreme_value_distribution& /*dist*/) -{ - // - // This is 12 * sqrt(6) * zeta(3) / pi^3: - // See http://mathworld.wolfram.com/ExtremeValueDistribution.html - // - return boost::lexical_cast("1.1395470994046486574927930193898461120875997958366"); -} - -template -inline boost::math::ef::e_float skewness(const rayleigh_distribution& /*dist*/) -{ - // using namespace boost::math::constants; - return boost::lexical_cast("0.63111065781893713819189935154422777984404221106391"); - // Computed using NTL at 150 bit, about 50 decimal digits. - // return 2 * root_pi() * pi_minus_three() / pow23_four_minus_pi(); -} - -template -inline boost::math::ef::e_float kurtosis(const rayleigh_distribution& /*dist*/) -{ - // using namespace boost::math::constants; - return boost::lexical_cast("3.2450893006876380628486604106197544154170667057995"); - // Computed using NTL at 150 bit, about 50 decimal digits. - // return 3 - (6 * pi() * pi() - 24 * pi() + 16) / - // (four_minus_pi() * four_minus_pi()); -} - -template -inline boost::math::ef::e_float kurtosis_excess(const rayleigh_distribution& /*dist*/) -{ - //using namespace boost::math::constants; - // Computed using NTL at 150 bit, about 50 decimal digits. - return boost::lexical_cast("0.2450893006876380628486604106197544154170667057995"); - // return -(6 * pi() * pi() - 24 * pi() + 16) / - // (four_minus_pi() * four_minus_pi()); -} // kurtosis - -namespace detail{ - -// -// Version of Digamma accurate to ~100 decimal digits. -// -template -boost::math::ef::e_float digamma_imp(boost::math::ef::e_float x, const boost::integral_constant* , const Policy& pol) -{ - // - // This handles reflection of negative arguments, and all our - // eboost::math::ef::e_floator handling, then forwards to the T-specific approximation. - // - BOOST_MATH_STD_USING // ADL of std functions. - - boost::math::ef::e_float result = 0; - // - // Check for negative arguments and use reflection: - // - if(x < 0) - { - // Reflect: - x = 1 - x; - // Argument reduction for tan: - boost::math::ef::e_float remainder = x - floor(x); - // Shift to negative if > 0.5: - if(remainder > 0.5) - { - remainder -= 1; - } - // - // check for evaluation at a negative pole: - // - if(remainder == 0) - { - return policies::raise_pole_error("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol); - } - result = constants::pi() / tan(constants::pi() * remainder); - } - result += big_digamma(x); - return result; -} -boost::math::ef::e_float bessel_i0(boost::math::ef::e_float x) -{ - static const boost::math::ef::e_float P1[] = { - boost::lexical_cast("-2.2335582639474375249e+15"), - boost::lexical_cast("-5.5050369673018427753e+14"), - boost::lexical_cast("-3.2940087627407749166e+13"), - boost::lexical_cast("-8.4925101247114157499e+11"), - boost::lexical_cast("-1.1912746104985237192e+10"), - boost::lexical_cast("-1.0313066708737980747e+08"), - boost::lexical_cast("-5.9545626019847898221e+05"), - boost::lexical_cast("-2.4125195876041896775e+03"), - boost::lexical_cast("-7.0935347449210549190e+00"), - boost::lexical_cast("-1.5453977791786851041e-02"), - boost::lexical_cast("-2.5172644670688975051e-05"), - boost::lexical_cast("-3.0517226450451067446e-08"), - boost::lexical_cast("-2.6843448573468483278e-11"), - boost::lexical_cast("-1.5982226675653184646e-14"), - boost::lexical_cast("-5.2487866627945699800e-18"), - }; - static const boost::math::ef::e_float Q1[] = { - boost::lexical_cast("-2.2335582639474375245e+15"), - boost::lexical_cast("7.8858692566751002988e+12"), - boost::lexical_cast("-1.2207067397808979846e+10"), - boost::lexical_cast("1.0377081058062166144e+07"), - boost::lexical_cast("-4.8527560179962773045e+03"), - boost::lexical_cast("1.0"), - }; - static const boost::math::ef::e_float P2[] = { - boost::lexical_cast("-2.2210262233306573296e-04"), - boost::lexical_cast("1.3067392038106924055e-02"), - boost::lexical_cast("-4.4700805721174453923e-01"), - boost::lexical_cast("5.5674518371240761397e+00"), - boost::lexical_cast("-2.3517945679239481621e+01"), - boost::lexical_cast("3.1611322818701131207e+01"), - boost::lexical_cast("-9.6090021968656180000e+00"), - }; - static const boost::math::ef::e_float Q2[] = { - boost::lexical_cast("-5.5194330231005480228e-04"), - boost::lexical_cast("3.2547697594819615062e-02"), - boost::lexical_cast("-1.1151759188741312645e+00"), - boost::lexical_cast("1.3982595353892851542e+01"), - boost::lexical_cast("-6.0228002066743340583e+01"), - boost::lexical_cast("8.5539563258012929600e+01"), - boost::lexical_cast("-3.1446690275135491500e+01"), - boost::lexical_cast("1.0"), - }; - boost::math::ef::e_float value, factor, r; - - BOOST_MATH_STD_USING - using namespace boost::math::tools; - - if (x < 0) + namespace std + { + template + class numeric_limits> { - x = -x; // even function - } - if (x == 0) - { - return static_cast(1); - } - if (x <= 15) // x in (0, 15] - { - boost::math::ef::e_float y = x * x; - value = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y); - } - else // x in (15, \infty) - { - boost::math::ef::e_float y = 1 / x - boost::math::ef::e_float(1) / 15; - r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y); - factor = exp(x) / sqrt(x); - value = factor * r; - } + public: + static constexpr bool is_specialized = true; + static constexpr bool is_signed = true; + static constexpr bool is_integer = false; + static constexpr bool is_exact = false; + static constexpr bool is_bounded = true; + static constexpr bool is_modulo = false; + static constexpr bool is_iec559 = false; + static constexpr int digits = ::e_float::ef_digits10; + static constexpr int digits10 = ::e_float::ef_digits10; + static constexpr int max_digits10 = ::e_float::ef_digits10 + 1; - return value; -} + static constexpr std::int64_t max_exponent = ::e_float::ef_max_exp; + static constexpr std::int64_t max_exponent10 = ::e_float::ef_max_exp10; + static constexpr std::int64_t min_exponent = ::e_float::ef_min_exp; + static constexpr std::int64_t min_exponent10 = ::e_float::ef_min_exp10; -boost::math::ef::e_float bessel_i1(boost::math::ef::e_float x) -{ - static const boost::math::ef::e_float P1[] = { - lexical_cast("-1.4577180278143463643e+15"), - lexical_cast("-1.7732037840791591320e+14"), - lexical_cast("-6.9876779648010090070e+12"), - lexical_cast("-1.3357437682275493024e+11"), - lexical_cast("-1.4828267606612366099e+09"), - lexical_cast("-1.0588550724769347106e+07"), - lexical_cast("-5.1894091982308017540e+04"), - lexical_cast("-1.8225946631657315931e+02"), - lexical_cast("-4.7207090827310162436e-01"), - lexical_cast("-9.1746443287817501309e-04"), - lexical_cast("-1.3466829827635152875e-06"), - lexical_cast("-1.4831904935994647675e-09"), - lexical_cast("-1.1928788903603238754e-12"), - lexical_cast("-6.5245515583151902910e-16"), - lexical_cast("-1.9705291802535139930e-19"), + static constexpr int radix = 10; + static constexpr std::float_round_style round_style = std::round_indeterminate; + static constexpr bool has_infinity = true; + static constexpr bool has_quiet_NaN = true; + static constexpr bool has_signaling_NaN = false; + static constexpr std::float_denorm_style has_denorm = std::denorm_absent; + static constexpr bool has_denorm_loss = false; + static constexpr bool traps = false; + static constexpr bool tinyness_before = false; + + static constexpr boost::multiprecision::number (min) () { return boost::math::ef::e_float(ef::value_min()); } + static constexpr boost::multiprecision::number (max) () { return boost::math::ef::e_float(ef::value_max()); } + static constexpr boost::multiprecision::number lowest () { return boost::math::ef::e_float(ef::zero()); } + static constexpr boost::multiprecision::number epsilon () { return boost::math::ef::e_float(ef::value_eps()); } + static constexpr boost::multiprecision::number round_error () { return boost::math::ef::e_float(ef::half()); } + static constexpr boost::multiprecision::number infinity () { return boost::math::ef::e_float(ef::value_inf()); } + static constexpr boost::multiprecision::number quiet_NaN () { return boost::math::ef::e_float(ef::value_nan()); } + static constexpr boost::multiprecision::number signaling_NaN() { return boost::math::ef::e_float(ef::zero()); } + static constexpr boost::multiprecision::number denorm_min () { return boost::math::ef::e_float(ef::zero()); } }; - static const boost::math::ef::e_float Q1[] = { - lexical_cast("-2.9154360556286927285e+15"), - lexical_cast("9.7887501377547640438e+12"), - lexical_cast("-1.4386907088588283434e+10"), - lexical_cast("1.1594225856856884006e+07"), - lexical_cast("-5.1326864679904189920e+03"), - lexical_cast("1.0"), - }; - static const boost::math::ef::e_float P2[] = { - lexical_cast("1.4582087408985668208e-05"), - lexical_cast("-8.9359825138577646443e-04"), - lexical_cast("2.9204895411257790122e-02"), - lexical_cast("-3.4198728018058047439e-01"), - lexical_cast("1.3960118277609544334e+00"), - lexical_cast("-1.9746376087200685843e+00"), - lexical_cast("8.5591872901933459000e-01"), - lexical_cast("-6.0437159056137599999e-02"), - }; - static const boost::math::ef::e_float Q2[] = { - lexical_cast("3.7510433111922824643e-05"), - lexical_cast("-2.2835624489492512649e-03"), - lexical_cast("7.4212010813186530069e-02"), - lexical_cast("-8.5017476463217924408e-01"), - lexical_cast("3.2593714889036996297e+00"), - lexical_cast("-3.8806586721556593450e+00"), - lexical_cast("1.0"), - }; - boost::math::ef::e_float value, factor, r, w; - BOOST_MATH_STD_USING - using namespace boost::math::tools; - - w = abs(x); - if (x == 0) - { - return static_cast(0); - } - if (w <= 15) // w in (0, 15] - { - boost::math::ef::e_float y = x * x; - r = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y); - factor = w; - value = factor * r; - } - else // w in (15, \infty) - { - boost::math::ef::e_float y = 1 / w - boost::math::ef::e_float(1) / 15; - r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y); - factor = exp(w) / sqrt(w); - value = factor * r; - } - - if (x < 0) - { - value *= -value; // odd function - } - return value; -} - -} // namespace detail - -}} -#endif // BOOST_MATH_E_FLOAT_BINDINGS_HPP + } // namespace std +#endif // E_FLOAT_2017_08_18_HPP_ From 949d185e8d31d449c3080bbfd273503f601616ff Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Mon, 15 Feb 2021 22:54:16 +0100 Subject: [PATCH 02/19] [CI SKIP] Re-vitalize e_float.hpp for 2021/c++11 --- include/boost/math/bindings/e_float.hpp | 63 +++++++++++++------------ 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/include/boost/math/bindings/e_float.hpp b/include/boost/math/bindings/e_float.hpp index 4adc5fad0..ac3e81f25 100644 --- a/include/boost/math/bindings/e_float.hpp +++ b/include/boost/math/bindings/e_float.hpp @@ -1,18 +1,19 @@ // Copyright John Maddock 2012 - 2021. -// Copyright Christopher Kormanyos 2017 - 2021. +// Copyright Christopher Kormanyos 2016 - 2021. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Wrapper that works with ::e_float-2021 -// See https://github.com/ckormanyos/::e_float-2021 +// Wrapper that works with e_float-2021, see also +// https://github.com/ckormanyos/e_float-2021 #ifndef E_FLOAT_2017_08_18_HPP_ #define E_FLOAT_2017_08_18_HPP_ #include #include + #include #include #include @@ -34,7 +35,7 @@ // interacting as a backend with boost::muliprecision. template<> struct boost::multiprecision::number_category - : public boost::mpl::int_ { }; + : public std::integral_constant { }; namespace boost { namespace math { namespace ef { @@ -42,16 +43,17 @@ class e_float { public: - typedef boost::mpl::list< signed long long> signed_types; - typedef boost::mpl::list unsigned_types; - typedef boost::mpl::list float_types; - typedef std::int64_t exponent_type; + using signed_types = std::tuple< signed char, signed short, signed int, signed long, signed long long, std::intmax_t>; + using unsigned_types = std::tuple; + using float_types = std::tuple; + using exponent_type = std::int64_t; e_float() : m_value() { } explicit e_float(const ::e_float& rep) : m_value(rep) { } e_float(const e_float& other) : m_value(other.m_value) { } + e_float(e_float&& other) : m_value(static_cast<::e_float&&>(other.m_value)) { } template::value == true) @@ -71,11 +73,21 @@ e_float(const std::string& str) : m_value(str) { } - virtual ~e_float(); + ~e_float() { } e_float& operator=(const e_float& other) { - m_value = other.m_value; + if(this != &other) + { + m_value = other.m_value; + } + + return *this; + } + + e_float& operator=(e_float&& other) + { + m_value.operator=(static_cast<::e_float&&>(other.m_value)); return *this; } @@ -138,8 +150,6 @@ e_float& operator=(const ::e_float&) = delete; }; - e_float::~e_float() { } - void eval_add(e_float& result, const e_float& x) { result.representation() += x.crepresentation(); @@ -267,7 +277,7 @@ const e_float& x, typename e_float::exponent_type* expptr) { - typedef int local_exponent_type; + using local_exponent_type = int; local_exponent_type exp2; @@ -276,9 +286,9 @@ *expptr = static_cast(exp2); } - void eval_frexp(e_float& result, + void eval_frexp( e_float& result, const e_float& x, - int* expptr, + int* expptr, typename std::enable_if::value == false>::type const* = nullptr) { result.representation() = ::ef::frexp(x.crepresentation(), expptr); @@ -288,17 +298,17 @@ const e_float& x, const typename e_float::exponent_type exp_value) { - typedef int local_exponent_type; + using local_exponent_type = int; result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); } - void eval_ldexp(e_float& result, + void eval_ldexp( e_float& result, const e_float& x, - int exp_value, + int exp_value, typename std::enable_if::value == false>::type const* = nullptr) { - typedef int local_exponent_type; + using local_exponent_type = int; result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); } @@ -482,18 +492,13 @@ ExpressionTemplates>, ThisPolicy> { - typedef typename ThisPolicy::precision_type precision_type; + using precision_type = typename ThisPolicy::precision_type; - typedef digits2<((::e_float::ef_digits10 + 1LL) * 1000LL) / 301LL> local_digits_2; + using local_digits_2 = digits2<((::e_float::ef_digits10 + 1LL) * 1000LL) / 301LL>; - typedef typename mpl::if_c - < - ( (local_digits_2::value <= precision_type::value) - || (precision_type::value <= 0)), - local_digits_2, - precision_type - >::type - type; + using type = typename std::conditional<((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)), + local_digits_2, + precision_type>::type; }; } } } // namespaces boost::math::policies From 22e5a1ee982c2471e88baf7f5c5674e4dc76357c Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Tue, 16 Feb 2021 13:59:36 +0100 Subject: [PATCH 03/19] [CI SKIP] Repair inline and add eval-scalbn/ilogb --- include/boost/math/bindings/e_float.hpp | 193 ++++++++++++++---------- 1 file changed, 117 insertions(+), 76 deletions(-) diff --git a/include/boost/math/bindings/e_float.hpp b/include/boost/math/bindings/e_float.hpp index ac3e81f25..a25c92024 100644 --- a/include/boost/math/bindings/e_float.hpp +++ b/include/boost/math/bindings/e_float.hpp @@ -150,21 +150,26 @@ e_float& operator=(const ::e_float&) = delete; }; - void eval_add(e_float& result, const e_float& x) + inline void eval_add(e_float& result, const e_float& x) { result.representation() += x.crepresentation(); } - void eval_subtract(e_float& result, const e_float& x) + inline void eval_subtract(e_float& result, const e_float& x) { result.representation() -= x.crepresentation(); } - void eval_multiply(e_float& result, const e_float& x) + inline void eval_multiply(e_float& result, const e_float& x) { result.representation() *= x.crepresentation(); } + inline void eval_multiply(e_float& result, const e_float& x, const e_float& y) + { + result.representation() = x.crepresentation() * y.crepresentation(); + } + template::value == true) && (std::is_signed ::value == true))>::type const* = nullptr> @@ -173,7 +178,7 @@ result.representation().mul_signed_long_long(static_cast(n)); } - void eval_divide(e_float& result, const e_float& x) + inline void eval_divide(e_float& result, const e_float& x) { result.representation() /= x.crepresentation(); } @@ -186,7 +191,7 @@ result.representation().div_signed_long_long(static_cast(n)); } - bool eval_eq(const e_float& a, const e_float& b) + inline bool eval_eq(const e_float& a, const e_float& b) { return (a.compare(b) == 0); } @@ -205,7 +210,7 @@ return (e_float(a).compare(b) == 0); } - bool eval_gt(const e_float& a, const e_float& b) + inline bool eval_gt(const e_float& a, const e_float& b) { return (a.compare(b) == 1); } @@ -224,7 +229,7 @@ return (e_float(a).compare(b) == 1); } - bool eval_lt(const e_float& a, const e_float& b) + inline bool eval_lt(const e_float& a, const e_float& b) { return (a.compare(b) == -1); } @@ -243,39 +248,39 @@ return (e_float(a).compare(b) == -1); } - bool eval_is_zero(const e_float& x) + inline bool eval_is_zero(const e_float& x) { return x.crepresentation().iszero(); } - int eval_get_sign(const e_float& x) + inline int eval_get_sign(const e_float& x) { if (x.crepresentation().iszero()) { return 0; } else if(x.crepresentation().isneg ()) { return -1; } else { return 1; } } - void eval_convert_to(unsigned long long* result, - const e_float& val) + inline void eval_convert_to(unsigned long long* result, + const e_float& val) { *result = (val.crepresentation()).extract_unsigned_long_long(); } - void eval_convert_to(signed long long* result, - const e_float& val) + inline void eval_convert_to(signed long long* result, + const e_float& val) { *result = (val.crepresentation()).extract_signed_long_long(); } - void eval_convert_to(long double* result, - const e_float& val) + inline void eval_convert_to(long double* result, + const e_float& val) { *result = (val.crepresentation()).extract_long_double(); } - void eval_frexp( e_float& result, - const e_float& x, - typename e_float::exponent_type* expptr) + inline void eval_frexp( e_float& result, + const e_float& x, + typename e_float::exponent_type* expptr) { using local_exponent_type = int; @@ -286,46 +291,83 @@ *expptr = static_cast(exp2); } - void eval_frexp( e_float& result, - const e_float& x, - int* expptr, - typename std::enable_if::value == false>::type const* = nullptr) + inline void eval_frexp( e_float& result, + const e_float& x, + int* expptr, + typename std::enable_if::value == false>::type const* = nullptr) { result.representation() = ::ef::frexp(x.crepresentation(), expptr); } - void eval_ldexp( e_float& result, - const e_float& x, - const typename e_float::exponent_type exp_value) + inline void eval_ldexp( e_float& result, + const e_float& x, + const typename e_float::exponent_type exp_value) { using local_exponent_type = int; result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); } - void eval_ldexp( e_float& result, - const e_float& x, - int exp_value, - typename std::enable_if::value == false>::type const* = nullptr) + inline void eval_ldexp( e_float& result, + const e_float& x, + int exp_value, + typename std::enable_if::value == false>::type const* = nullptr) { using local_exponent_type = int; result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); } - void eval_floor( e_float& result, - const e_float& x) + inline e_float::exponent_type eval_ilogb(const e_float& val) + { + if(val.crepresentation().iszero()) + { + return (std::numeric_limits::min)(); + } + + if ((val.crepresentation().isinf)()) + { + return (std::numeric_limits::max)(); + } + + if ((val.crepresentation().isnan)()) + { + #if defined(FP_ILOGBNAN) + return FP_ILOGBNAN; + #else + return (std::numeric_limits::max)(); + #endif + } + + // Set the result to base-10 exponent (order) of the value. + return val.crepresentation().order(); + } + + template::value == true) + && (std::is_integral ::value == true))>::type const* = nullptr> + void eval_scalbn(e_float& result, const e_float& val, IntegralType e) + { + const std::int64_t my_e = static_cast(e); + + const e_float t(::e_float(1.0, e)); + + eval_multiply(result, val, t); + } + + inline void eval_floor( e_float& result, + const e_float& x) { result.representation() = ::ef::floor(x.crepresentation()); } - void eval_ceil( e_float& result, - const e_float& x) + inline void eval_ceil( e_float& result, + const e_float& x) { result.representation() = ::ef::ceil(x.crepresentation()); } - int eval_fpclassify(const e_float& x) + inline int eval_fpclassify(const e_float& x) { if ((x.crepresentation().isinf)()) { return FP_INFINITE; } else if((x.crepresentation().isnan)()) { return FP_NAN; } @@ -333,14 +375,14 @@ else { return FP_NORMAL; } } - void eval_trunc( e_float& result, - const e_float& x) + inline void eval_trunc( e_float& result, + const e_float& x) { result.representation() = ::ef::integer_part(x.crepresentation()); } - void eval_abs( e_float& result, - const e_float& x) + inline void eval_abs( e_float& result, + const e_float& x) { result.representation() = x.crepresentation(); @@ -350,8 +392,8 @@ } } - void eval_fabs( e_float& result, - const e_float& x) + inline void eval_fabs( e_float& result, + const e_float& x) { result.representation() = x.crepresentation(); @@ -361,94 +403,94 @@ } } - void eval_sqrt( e_float& result, - const e_float& x) + inline void eval_sqrt( e_float& result, + const e_float& x) { result.representation() = ::ef::sqrt(x.crepresentation()); } - void eval_sin( e_float& result, - const e_float& x) + inline void eval_sin( e_float& result, + const e_float& x) { result.representation() = ::ef::sin(x.crepresentation()); } - void eval_cos( e_float& result, - const e_float& x) + inline void eval_cos( e_float& result, + const e_float& x) { result.representation() = ::ef::cos(x.crepresentation()); } - void eval_tan( e_float& result, - const e_float& x) + inline void eval_tan( e_float& result, + const e_float& x) { result.representation() = ::ef::tan(x.crepresentation()); } - void eval_asin( e_float& result, - const e_float& x) + inline void eval_asin( e_float& result, + const e_float& x) { result.representation() = ::ef::asin(x.crepresentation()); } - void eval_acos( e_float& result, - const e_float& x) + inline void eval_acos( e_float& result, + const e_float& x) { result.representation() = ::ef::acos(x.crepresentation()); } - void eval_atan( e_float& result, - const e_float& x) + inline void eval_atan( e_float& result, + const e_float& x) { result.representation() = ::ef::atan(x.crepresentation()); } - void eval_atan2( e_float& result, - const e_float& y, - const e_float& x) + inline void eval_atan2( e_float& result, + const e_float& y, + const e_float& x) { result.representation() = ::ef::atan2(y.crepresentation(), x.crepresentation()); } - void eval_log( e_float& result, - const e_float& x) + inline void eval_log( e_float& result, + const e_float& x) { result.representation() = ::ef::log(x.crepresentation()); } - void eval_log10( e_float& result, - const e_float& x) + inline void eval_log10( e_float& result, + const e_float& x) { result.representation() = ::ef::log10(x.crepresentation()); } - void eval_exp( e_float& result, - const e_float& x) + inline void eval_exp( e_float& result, + const e_float& x) { result.representation() = ::ef::exp(x.crepresentation()); } - void eval_sinh( e_float& result, - const e_float& x) + inline void eval_sinh( e_float& result, + const e_float& x) { result.representation() = ::ef::sinh(x.crepresentation()); } - void eval_cosh( e_float& result, - const e_float& x) + inline void eval_cosh( e_float& result, + const e_float& x) { result.representation() = ::ef::cosh(x.crepresentation()); } - void eval_tanh( e_float& result, - const e_float& x) + inline void eval_tanh( e_float& result, + const e_float& x) { result.representation() = ::ef::tanh(x.crepresentation()); } - void eval_fmod( e_float& result, - const e_float& x, - const e_float& y) + inline void eval_fmod( e_float& result, + const e_float& x, + const e_float& y) { if(y.crepresentation().iszero()) { @@ -474,9 +516,9 @@ } } - void eval_pow( e_float& result, - const e_float& x, - const e_float& a) + inline void eval_pow( e_float& result, + const e_float& x, + const e_float& a) { result.representation() = ::ef::pow(x.crepresentation(), a.crepresentation()); } @@ -546,7 +588,6 @@ static constexpr boost::multiprecision::number signaling_NaN() { return boost::math::ef::e_float(ef::zero()); } static constexpr boost::multiprecision::number denorm_min () { return boost::math::ef::e_float(ef::zero()); } }; - } // namespace std #endif // E_FLOAT_2017_08_18_HPP_ From fa7853a374a7820dd3e2ef67b1b227ab676ef508 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 18:19:02 +0100 Subject: [PATCH 04/19] Temp. deactivate ci.yml and try build w/e_float --- .github/workflows/{ci.yml => ci.nml} | 0 .github/workflows/e_float_boost_test.yml | 69 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+) rename .github/workflows/{ci.yml => ci.nml} (100%) create mode 100644 .github/workflows/e_float_boost_test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.nml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/ci.nml diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml new file mode 100644 index 000000000..a25455aec --- /dev/null +++ b/.github/workflows/e_float_boost_test.yml @@ -0,0 +1,69 @@ +# Copyright 2020 Evan Miller +# Copyright 2020 Matt Borland +# Copyright 2021 Christopher Kormanyos +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +name: e_float_boost_test +on: + push: + branches: + - master + - develop + pull_request: + release: + types: [published, created, edited] +jobs: + ubuntu-focal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++ ] + standard: [ gnu++11 ] + suite: [ E_FLOAT_TYPE_EFX ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install libgmp-dev libmpfr-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Checkout e_float repo + uses: actions/checkout@v2 + with: + repository: ckormanyos/e_float-2021 + path: e_float + - name: build test_boost + run: | + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + working-directory: ./e_float/libs/e_float/build From 5d83f07084f19b66bc9755f78260ca8ba480239b Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 18:29:37 +0100 Subject: [PATCH 05/19] Temp. disable drone and try find headers --- .github/workflows/e_float_boost_test.yml | 4 +++- {.drone => .no.drone}/after-success.sh | 0 {.drone => .no.drone}/before-install.sh | 0 {.drone => .no.drone}/before-script.sh | 0 {.drone => .no.drone}/boost.sh | 0 5 files changed, 3 insertions(+), 1 deletion(-) rename {.drone => .no.drone}/after-success.sh (100%) mode change 100755 => 100644 rename {.drone => .no.drone}/before-install.sh (100%) mode change 100755 => 100644 rename {.drone => .no.drone}/before-script.sh (100%) mode change 100755 => 100644 rename {.drone => .no.drone}/boost.sh (100%) mode change 100755 => 100644 diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index a25455aec..5a02ac2d1 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -65,5 +65,7 @@ jobs: path: e_float - name: build test_boost run: | - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + echo ls ../../../../../../boost-root/libs/math/include + ls ../../../../../../boost-root/libs/math/include + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../../../boost-root/libs/math/include ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe working-directory: ./e_float/libs/e_float/build diff --git a/.drone/after-success.sh b/.no.drone/after-success.sh old mode 100755 new mode 100644 similarity index 100% rename from .drone/after-success.sh rename to .no.drone/after-success.sh diff --git a/.drone/before-install.sh b/.no.drone/before-install.sh old mode 100755 new mode 100644 similarity index 100% rename from .drone/before-install.sh rename to .no.drone/before-install.sh diff --git a/.drone/before-script.sh b/.no.drone/before-script.sh old mode 100755 new mode 100644 similarity index 100% rename from .drone/before-script.sh rename to .no.drone/before-script.sh diff --git a/.drone/boost.sh b/.no.drone/boost.sh old mode 100755 new mode 100644 similarity index 100% rename from .drone/boost.sh rename to .no.drone/boost.sh From 2cd9ef961ae798dfb70a3f59f0fc0aa53490d6ca Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 18:43:56 +0100 Subject: [PATCH 06/19] [CI SKIP] Re-try e_float bindings test build --- .github/workflows/e_float_boost_test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index 5a02ac2d1..b9e1de725 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -62,10 +62,9 @@ jobs: uses: actions/checkout@v2 with: repository: ckormanyos/e_float-2021 - path: e_float + path: ../boost-root/libs/math/test/e_float - name: build test_boost run: | - echo ls ../../../../../../boost-root/libs/math/include - ls ../../../../../../boost-root/libs/math/include - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../../../boost-root/libs/math/include ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - working-directory: ./e_float/libs/e_float/build + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -Ie_float/libs/e_float/src e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp e_float/libs/e_float/src/e_float/e_float.cpp e_float/libs/e_float/src/e_float/e_float_base.cpp e_float/libs/e_float/src/functions/constants/constants.cpp e_float/libs/e_float/src/functions/elementary/elementary_complex.cpp e_float/libs/e_float/src/functions/elementary/elementary_hyper_g.cpp e_float/libs/e_float/src/functions/elementary/elementary_math.cpp e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp e_float/libs/e_float/src/functions/elementary/elementary_trig.cpp e_float/libs/e_float/test_boost/test_boost.cpp e_float/libs/e_float/test_boost/test_boost_real_concept.cpp e_float/libs/e_float/test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + ls -la e_float_boost_test.exe + working-directory: ../boost-root/libs/math/test From b78ef0ea4bf063400fc92cc512aecc609f8fdcac Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 19:38:07 +0100 Subject: [PATCH 07/19] [CI SKIP] Re-try e_float bindings build --- .github/workflows/e_float_boost_test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index b9e1de725..b9c528f6b 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -62,9 +62,10 @@ jobs: uses: actions/checkout@v2 with: repository: ckormanyos/e_float-2021 - path: ../boost-root/libs/math/test/e_float + path: e_float - name: build test_boost run: | - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -Ie_float/libs/e_float/src e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp e_float/libs/e_float/src/e_float/e_float.cpp e_float/libs/e_float/src/e_float/e_float_base.cpp e_float/libs/e_float/src/functions/constants/constants.cpp e_float/libs/e_float/src/functions/elementary/elementary_complex.cpp e_float/libs/e_float/src/functions/elementary/elementary_hyper_g.cpp e_float/libs/e_float/src/functions/elementary/elementary_math.cpp e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp e_float/libs/e_float/src/functions/elementary/elementary_trig.cpp e_float/libs/e_float/test_boost/test_boost.cpp e_float/libs/e_float/test_boost/test_boost_real_concept.cpp e_float/libs/e_float/test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - ls -la e_float_boost_test.exe - working-directory: ../boost-root/libs/math/test + echo ls ../../../../../../boost-root + ls ../../../../../../boost-root + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + working-directory: ./e_float/libs/e_float/build From d69b32cae4d40299a2ed4ee961ccf12a07e888fb Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 21:08:19 +0100 Subject: [PATCH 08/19] [CI SKIP] Try to figure out paths --- .github/workflows/e_float_boost_test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index b9c528f6b..03f311a17 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -65,7 +65,17 @@ jobs: path: e_float - name: build test_boost run: | - echo ls ../../../../../../boost-root - ls ../../../../../../boost-root + echo ls -la + ls -la + echo ls -la ../ + ls -la ../ + echo ls -la ../../ + ls -la ../../ + echo ls -la ../../../ + ls -la ../../../ + echo ls -la ../../../../ + ls -la ../../../../ + echo ls -la ../../../../../ + ls -la ../../../../../ ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe working-directory: ./e_float/libs/e_float/build From 590010205274649c2a51a88fd93c6cb70338f6e6 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 22:34:48 +0100 Subject: [PATCH 09/19] [CI SKIP] Re-try build with e_float bindings --- .github/workflows/e_float_boost_test.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index 03f311a17..4c57dcf50 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -65,17 +65,6 @@ jobs: path: e_float - name: build test_boost run: | - echo ls -la - ls -la - echo ls -la ../ - ls -la ../ - echo ls -la ../../ - ls -la ../../ - echo ls -la ../../../ - ls -la ../../../ - echo ls -la ../../../../ - ls -la ../../../../ - echo ls -la ../../../../../ - ls -la ../../../../../ - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - working-directory: ./e_float/libs/e_float/build + echo compile and link to e_float_boost_test.exe + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../e_float/libs/e_float/src -I../include ../e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp ../e_float/libs/e_float/src/e_float/e_float.cpp ../e_float/libs/e_float/src/e_float/e_float_base.cpp ../e_float/libs/e_float/src/functions/constants/constants.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_complex.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_hyper_g.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_math.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trig.cpp ../e_float/libs/e_float/test_boost/test_boost.cpp ../e_float/libs/e_float/test_boost/test_boost_real_concept.cpp ../e_float/libs/e_float/test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + working-directory: ../boost-root/libs/config/test From bb17bf3c7b6ef5f1c70823fdc04a7f9ad0546991 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 22:42:03 +0100 Subject: [PATCH 10/19] [CI SKIP] Correct a home path --- .github/workflows/e_float_boost_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index 4c57dcf50..1d639e7ae 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -67,4 +67,4 @@ jobs: run: | echo compile and link to e_float_boost_test.exe ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../e_float/libs/e_float/src -I../include ../e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp ../e_float/libs/e_float/src/e_float/e_float.cpp ../e_float/libs/e_float/src/e_float/e_float_base.cpp ../e_float/libs/e_float/src/functions/constants/constants.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_complex.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_hyper_g.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_math.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trig.cpp ../e_float/libs/e_float/test_boost/test_boost.cpp ../e_float/libs/e_float/test_boost/test_boost_real_concept.cpp ../e_float/libs/e_float/test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - working-directory: ../boost-root/libs/config/test + working-directory: ../boost-root/libs/math/test From 1d0cc2d84b8af27966766eb18bdacd060238d949 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 22:54:49 +0100 Subject: [PATCH 11/19] [CI SKIP] Re-try e_float bindings build --- .github/workflows/e_float_boost_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index 1d639e7ae..bb3c290e1 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -66,5 +66,5 @@ jobs: - name: build test_boost run: | echo compile and link to e_float_boost_test.exe - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../e_float/libs/e_float/src -I../include ../e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp ../e_float/libs/e_float/src/e_float/e_float.cpp ../e_float/libs/e_float/src/e_float/e_float_base.cpp ../e_float/libs/e_float/src/functions/constants/constants.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_complex.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_hyper_g.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_math.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp ../e_float/libs/e_float/src/functions/elementary/elementary_trig.cpp ../e_float/libs/e_float/test_boost/test_boost.cpp ../e_float/libs/e_float/test_boost/test_boost_real_concept.cpp ../e_float/libs/e_float/test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - working-directory: ../boost-root/libs/math/test + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + working-directory: ./e_float/libs/e_float/build From 390eba77c60363276782e3cc5b412b6642a20a5c Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 23:04:12 +0100 Subject: [PATCH 12/19] [CI SKIP] Remember include path rest of boost --- .github/workflows/e_float_boost_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index bb3c290e1..f79860a22 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -66,5 +66,5 @@ jobs: - name: build test_boost run: | echo compile and link to e_float_boost_test.exe - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe working-directory: ./e_float/libs/e_float/build From 2de60442395a3b1bb585581b519da032e9e2e2c8 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 20 Feb 2021 23:10:47 +0100 Subject: [PATCH 13/19] [CI SKIP] Add more e_float bindings jobs --- .github/workflows/e_float_boost_test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index f79860a22..1a15c71ff 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: compiler: [ g++ ] - standard: [ gnu++11 ] + standard: [ gnu++11, gnu++14, gnu++17, gnu++2a ] suite: [ E_FLOAT_TYPE_EFX ] steps: - uses: actions/checkout@v2 @@ -67,4 +67,8 @@ jobs: run: | echo compile and link to e_float_boost_test.exe ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe + echo ls -la e_float_boost_test.exe + ls -la e_float_boost_test.exe + echo run e_float_boost_test.exe + ./e_float_boost_test.exe working-directory: ./e_float/libs/e_float/build From 41cc31c99fb862c1daab50e9799a942196ad206c Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sun, 21 Feb 2021 07:57:25 +0100 Subject: [PATCH 14/19] [CI SKIP] Acc more e_float bindings CI runs --- .github/workflows/e_float_boost_test.yml | 66 ++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index 1a15c71ff..c93ae51b2 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -14,12 +14,12 @@ on: release: types: [published, created, edited] jobs: - ubuntu-focal: + gcc-clang-native-efx: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - compiler: [ g++ ] + compiler: [ g++, clang++ ] standard: [ gnu++11, gnu++14, gnu++17, gnu++2a ] suite: [ E_FLOAT_TYPE_EFX ] steps: @@ -30,8 +30,6 @@ jobs: run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - name: Add repository run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install libgmp-dev libmpfr-dev - name: Checkout main boost run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - name: Update tools/boostdep @@ -63,7 +61,7 @@ jobs: with: repository: ckormanyos/e_float-2021 path: e_float - - name: build test_boost + - name: build-run-e_float_boost_test-efx run: | echo compile and link to e_float_boost_test.exe ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe @@ -72,3 +70,61 @@ jobs: echo run e_float_boost_test.exe ./e_float_boost_test.exe working-directory: ./e_float/libs/e_float/build + gcc-clang-native-gmp: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++, clang++ ] + standard: [ gnu++11, gnu++14, gnu++17, gnu++2a ] + suite: [ E_FLOAT_TYPE_GMP ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install libgmp-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Checkout e_float repo + uses: actions/checkout@v2 + with: + repository: ckormanyos/e_float-2021 + path: e_float + - name: build-run-e_float_boost_test-gmp + run: | + echo compile and link to e_float_boost_test.exe + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -lgmp -o e_float_boost_test.exe + echo ls -la e_float_boost_test.exe + ls -la e_float_boost_test.exe + echo run e_float_boost_test.exe + ./e_float_boost_test.exe + working-directory: ./e_float/libs/e_float/build From 4cafdedb17910d48b7bf44866c83be6d2392328d Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sun, 21 Feb 2021 08:02:34 +0100 Subject: [PATCH 15/19] [CI SKIP] Repair e_float bindings gmp version --- .github/workflows/e_float_boost_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml index c93ae51b2..1ba4b4e96 100644 --- a/.github/workflows/e_float_boost_test.yml +++ b/.github/workflows/e_float_boost_test.yml @@ -122,7 +122,7 @@ jobs: - name: build-run-e_float_boost_test-gmp run: | echo compile and link to e_float_boost_test.exe - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -lgmp -o e_float_boost_test.exe + ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/gmp/e_float_gmp.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -lgmp -o e_float_boost_test.exe echo ls -la e_float_boost_test.exe ls -la e_float_boost_test.exe echo run e_float_boost_test.exe From 5f0c9f7a44c89de31beb36a78cbc0ef8dcce73f2 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sun, 21 Feb 2021 08:07:19 +0100 Subject: [PATCH 16/19] Restore drone and original ci.yml and run all CI --- {.no.drone => .drone}/after-success.sh | 0 {.no.drone => .drone}/before-install.sh | 0 {.no.drone => .drone}/before-script.sh | 0 {.no.drone => .drone}/boost.sh | 0 .github/workflows/{ci.nml => ci.yml} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {.no.drone => .drone}/after-success.sh (100%) rename {.no.drone => .drone}/before-install.sh (100%) rename {.no.drone => .drone}/before-script.sh (100%) rename {.no.drone => .drone}/boost.sh (100%) rename .github/workflows/{ci.nml => ci.yml} (100%) diff --git a/.no.drone/after-success.sh b/.drone/after-success.sh similarity index 100% rename from .no.drone/after-success.sh rename to .drone/after-success.sh diff --git a/.no.drone/before-install.sh b/.drone/before-install.sh similarity index 100% rename from .no.drone/before-install.sh rename to .drone/before-install.sh diff --git a/.no.drone/before-script.sh b/.drone/before-script.sh similarity index 100% rename from .no.drone/before-script.sh rename to .drone/before-script.sh diff --git a/.no.drone/boost.sh b/.drone/boost.sh similarity index 100% rename from .no.drone/boost.sh rename to .drone/boost.sh diff --git a/.github/workflows/ci.nml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.nml rename to .github/workflows/ci.yml From 172467881eb3bd160901246c386be6adbf79495b Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Mon, 22 Feb 2021 20:37:11 +0100 Subject: [PATCH 17/19] drone exec permits and clean remove e_float --- .drone/after-success.sh | 0 .drone/before-install.sh | 0 .drone/before-script.sh | 0 .drone/boost.sh | 0 .github/workflows/e_float_boost_test.yml | 130 ---- config/Jamfile.v2 | 3 - config/has_e_float.cpp | 15 - doc/concepts/concepts.qbk | 22 +- include/boost/math/bindings/e_float.hpp | 593 ------------------ .../math/constants/calculate_constants.hpp | 70 +-- test/Jamfile.v2 | 1 - test/e_float_concept_check.cpp | 40 -- 12 files changed, 49 insertions(+), 825 deletions(-) mode change 100644 => 100755 .drone/after-success.sh mode change 100644 => 100755 .drone/before-install.sh mode change 100644 => 100755 .drone/before-script.sh mode change 100644 => 100755 .drone/boost.sh delete mode 100644 .github/workflows/e_float_boost_test.yml delete mode 100644 config/has_e_float.cpp delete mode 100644 include/boost/math/bindings/e_float.hpp delete mode 100644 test/e_float_concept_check.cpp diff --git a/.drone/after-success.sh b/.drone/after-success.sh old mode 100644 new mode 100755 diff --git a/.drone/before-install.sh b/.drone/before-install.sh old mode 100644 new mode 100755 diff --git a/.drone/before-script.sh b/.drone/before-script.sh old mode 100644 new mode 100755 diff --git a/.drone/boost.sh b/.drone/boost.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/e_float_boost_test.yml b/.github/workflows/e_float_boost_test.yml deleted file mode 100644 index 1ba4b4e96..000000000 --- a/.github/workflows/e_float_boost_test.yml +++ /dev/null @@ -1,130 +0,0 @@ -# Copyright 2020 Evan Miller -# Copyright 2020 Matt Borland -# Copyright 2021 Christopher Kormanyos -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -name: e_float_boost_test -on: - push: - branches: - - master - - develop - pull_request: - release: - types: [published, created, edited] -jobs: - gcc-clang-native-efx: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++, clang++ ] - standard: [ gnu++11, gnu++14, gnu++17, gnu++2a ] - suite: [ E_FLOAT_TYPE_EFX ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Checkout e_float repo - uses: actions/checkout@v2 - with: - repository: ckormanyos/e_float-2021 - path: e_float - - name: build-run-e_float_boost_test-efx - run: | - echo compile and link to e_float_boost_test.exe - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/efx/e_float_efx.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -o e_float_boost_test.exe - echo ls -la e_float_boost_test.exe - ls -la e_float_boost_test.exe - echo run e_float_boost_test.exe - ./e_float_boost_test.exe - working-directory: ./e_float/libs/e_float/build - gcc-clang-native-gmp: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++, clang++ ] - standard: [ gnu++11, gnu++14, gnu++17, gnu++2a ] - suite: [ E_FLOAT_TYPE_GMP ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install libgmp-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Checkout e_float repo - uses: actions/checkout@v2 - with: - repository: ckormanyos/e_float-2021 - path: e_float - - name: build-run-e_float_boost_test-gmp - run: | - echo compile and link to e_float_boost_test.exe - ${{ matrix.compiler }} -Wall -Wextra -m64 -O3 -std=${{ matrix.standard }} -D${{ matrix.suite }} -I../../../libs/e_float/src -I../../../../include -I../../../../../boost-root ../src/e_float/gmp/e_float_gmp.cpp ../src/e_float/e_float.cpp ../src/e_float/e_float_base.cpp ../src/functions/constants/constants.cpp ../src/functions/elementary/elementary_complex.cpp ../src/functions/elementary/elementary_hyper_g.cpp ../src/functions/elementary/elementary_math.cpp ../src/functions/elementary/elementary_trans.cpp ../src/functions/elementary/elementary_trig.cpp ../test_boost/test_boost.cpp ../test_boost/test_boost_real_concept.cpp ../test_boost/test_boost_sf.cpp -lgmp -o e_float_boost_test.exe - echo ls -la e_float_boost_test.exe - ls -la e_float_boost_test.exe - echo run e_float_boost_test.exe - ./e_float_boost_test.exe - working-directory: ./e_float/libs/e_float/build diff --git a/config/Jamfile.v2 b/config/Jamfile.v2 index 86db71501..2754ef111 100644 --- a/config/Jamfile.v2 +++ b/config/Jamfile.v2 @@ -8,7 +8,6 @@ import path ; local ntl-path = [ modules.peek : NTL_PATH ] ; local gmp_path = [ modules.peek : GMP_PATH ] ; -local e_float_path = [ modules.peek : E_FLOAT_PATH ] ; lib quadmath ; lib fftw3 ; @@ -26,7 +25,6 @@ obj has_gmpxx : has_gmpxx.cpp : $(gmp_path) $(gmp_path)/mpfr $(gmp_path)/gmpfrxx ; obj has_gcc_visibility : has_gcc_visibility.cpp : gcc:-fvisibility=hidden gcc:-Werror ; -obj has_e_float : has_e_float.cpp : $(e_float_path) ; exe has_float128 : has_float128.cpp quadmath ; exe has_fftw3 : has_fftw3.cpp fftw3 fftw3f fftw3l ; exe has_intel_quad : has_intel_quad.cpp : -Qoption,cpp,--extended_float_type ; @@ -44,7 +42,6 @@ explicit has_mpreal ; explicit has_ntl_rr ; explicit has_gmpxx ; explicit has_gcc_visibility ; -explicit has_e_float ; explicit has_float128 ; explicit has_intel_quad ; explicit has_128bit_floatmax_t ; diff --git a/config/has_e_float.cpp b/config/has_e_float.cpp deleted file mode 100644 index 1f3b30539..000000000 --- a/config/has_e_float.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright John Maddock 2011. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - - -#ifdef _MSC_VER -# pragma warning (disable : 4100) // unreferenced formal parameter -#endif - -#define E_FLOAT_TYPE_EFX - -#include -#include - diff --git a/doc/concepts/concepts.qbk b/doc/concepts/concepts.qbk index fa24d048b..25abd92af 100644 --- a/doc/concepts/concepts.qbk +++ b/doc/concepts/concepts.qbk @@ -197,18 +197,26 @@ There is a concept checking test program for mpfr support __multiprecision was a development from the __e_float library by Christopher Kormanyos. -e_float can still be used with Boost.Math library via the header: +The e_float library is still maintained in the +[@http://github/ckormanyos/e_float-2021/ e_float-2021 repository]. +It can still be used with the Boost.Math library via +its [@http://github.com/ckormanyos/e_float-2021/blob/main/libs/math/include/boost/math/bindings/e_float.hpp/ bindings header]: -And the type `boost::math::ef::e_float`: -this type is a thin wrapper class around ::e_float which provides the necessary -syntactic sugar to make everything "just work". +These bindings define the type `boost::math::ef::e_float`, +which is a thin wrapper around the original `::e_float` class. +The `e_float` bindings provide the necessary syntactic sugar +(such as namespaces, operators, ``-like functions, etc.) +to make `boost::math::ef::e_float` +work and interoperate seamlessly with the Boost.Math library. -There is also a concept checking test program for e_float support -[@../../../../libs/math/test/e_float_concept_check.cpp here]. +Test programs including non-trivial algorithmic +interaction with Boost.Math as well as a concept check +for `e_float` support are included +[@http://github.com/ckormanyos/e_float-2021/tree/main/libs/e_float/test_boost here]. -[*New projects are recommended to use __multiprecision with `cpp_float` backend instead.] +[*New projects are recommended to use __multiprecision with `cpp_bin_float` or `cpp_dec_float` backend instead.] [endsect] [/section:e_float Using e_float Library] diff --git a/include/boost/math/bindings/e_float.hpp b/include/boost/math/bindings/e_float.hpp deleted file mode 100644 index 4606fc4f4..000000000 --- a/include/boost/math/bindings/e_float.hpp +++ /dev/null @@ -1,593 +0,0 @@ -// Copyright John Maddock 2012 - 2021. -// Copyright Christopher Kormanyos 2016 - 2021. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -// Wrapper that works with e_float-2021, see also -// https://github.com/ckormanyos/e_float-2021 - -#ifndef E_FLOAT_2017_08_18_HPP_ - #define E_FLOAT_2017_08_18_HPP_ - - #include - #include - #include - #include - - #include - #include - - #include - #include - - namespace boost { namespace math { namespace ef { - - // Forward declaration of the e_float multiple precision class. - // This class binds native ::e_float to boost::multiprecsion::e_float. - class e_float; - - } } } - - // Define the number category as a floating-point kind - // for the e_float. This is needed for properly - // interacting as a backend with boost::muliprecision. - template<> - struct boost::multiprecision::number_category - : public std::integral_constant { }; - - namespace boost { namespace math { namespace ef { - - // This is the e_float multiple precision class. - class e_float - { - public: - using signed_types = std::tuple< signed char, signed short, signed int, signed long, signed long long, std::intmax_t>; - using unsigned_types = std::tuple; - using float_types = std::tuple; - using exponent_type = std::int64_t; - - e_float() : m_value() { } - - explicit e_float(const ::e_float& rep) : m_value(rep) { } - - e_float(const e_float& other) : m_value(other.m_value) { } - e_float(e_float&& other) : m_value(static_cast<::e_float&&>(other.m_value)) { } - - template::value == true) - && (std::is_unsigned::value == true))>::type const* = nullptr> - e_float(UnsignedIntegralType u) : m_value(::e_float(std::uint64_t(u))) { } - - template::value == true) - && (std::is_signed ::value == true))>::type const* = nullptr> - e_float(SignedIntegralType n) : m_value(::e_float(std::int64_t(n))) { } - - template::value == true>::type const* = nullptr> - e_float(FloatingPointType f) : m_value(::e_float(static_cast(f))) { } - - e_float(const char* c) : m_value(c) { } - - e_float(const std::string& str) : m_value(str) { } - - ~e_float() { } - - e_float& operator=(const e_float& other) - { - if(this != &other) - { - m_value = other.m_value; - } - - return *this; - } - - e_float& operator=(e_float&& other) - { - m_value.operator=(static_cast<::e_float&&>(other.m_value)); - - return *this; - } - - template::value == true>::type const* = nullptr> - e_float& operator=(const ArithmeticType& x) - { - m_value = ::e_float(x); - - return *this; - } - - e_float& operator=(const std::string& str_rep) { m_value = ::e_float(str_rep); return *this; } - e_float& operator=(const char* char_ptr) { m_value = ::e_float(char_ptr); return *this; } - - void swap(e_float& other_mp_cpp_backend) - { - m_value.swap(other_mp_cpp_backend.m_value); - } - - ::e_float& representation() { return m_value; } - const ::e_float& representation() const { return m_value; } - const ::e_float& crepresentation() const { return m_value; } - - std::string str(std::streamsize number_of_digits, const std::ios::fmtflags format_flags) const - { - std::string my_result_str; - std::stringstream my_stream_str; - - my_stream_str.flags(format_flags); - - static_cast(my_stream_str.precision(number_of_digits)); - - m_value.wr_string(my_result_str, my_stream_str); - - return my_result_str; - } - - void negate() - { - m_value.negate(); - } - - int compare(const e_float& other_mp_cpp_backend) const - { - return static_cast(m_value.compare(other_mp_cpp_backend.m_value)); - } - - template::value == true>::type const* = nullptr> - int compare(ArithmeticType x) - { - return static_cast(m_value.compare(::e_float(x))); - } - - private: - ::e_float m_value; - - e_float& operator=(const ::e_float&) = delete; - }; - - inline void eval_add(e_float& result, const e_float& x) - { - result.representation() += x.crepresentation(); - } - - inline void eval_subtract(e_float& result, const e_float& x) - { - result.representation() -= x.crepresentation(); - } - - inline void eval_multiply(e_float& result, const e_float& x) - { - result.representation() *= x.crepresentation(); - } - - inline void eval_multiply(e_float& result, const e_float& x, const e_float& y) - { - result.representation() = x.crepresentation() * y.crepresentation(); - } - - template::value == true) - && (std::is_signed ::value == true))>::type const* = nullptr> - void eval_multiply(e_float& result, const SignedIntegralType& n) - { - result.representation().mul_signed_long_long(static_cast(n)); - } - - inline void eval_divide(e_float& result, const e_float& x) - { - result.representation() /= x.crepresentation(); - } - - template::value == true) - && (std::is_signed ::value == true))>::type const* = nullptr> - void eval_divide(e_float& result, const SignedIntegralType& n) - { - result.representation().div_signed_long_long(static_cast(n)); - } - - inline bool eval_eq(const e_float& a, const e_float& b) - { - return (a.compare(b) == 0); - } - - template::value == true>::type const* = nullptr> - bool eval_eq(const e_float& a, const ArithmeticType& b) - { - return (a.compare(b) == 0); - } - - template::value == true>::type const* = nullptr> - bool eval_eq(const ArithmeticType& a, const e_float& b) - { - return (e_float(a).compare(b) == 0); - } - - inline bool eval_gt(const e_float& a, const e_float& b) - { - return (a.compare(b) == 1); - } - - template::value == true>::type const* = nullptr> - bool eval_gt(const e_float& a, const ArithmeticType& b) - { - return (a.compare(b) == 1); - } - - template::value>::type const* = nullptr> - bool eval_gt(const ArithmeticType& a, const e_float& b) - { - return (e_float(a).compare(b) == 1); - } - - inline bool eval_lt(const e_float& a, const e_float& b) - { - return (a.compare(b) == -1); - } - - template::value == true>::type const* = nullptr> - bool eval_lt(const e_float& a, const ArithmeticType& b) - { - return (a.compare(b) == -1); - } - - template::value == true>::type const* = nullptr> - bool eval_lt(const ArithmeticType& a, const e_float& b) - { - return (e_float(a).compare(b) == -1); - } - - inline bool eval_is_zero(const e_float& x) - { - return x.crepresentation().iszero(); - } - - inline int eval_get_sign(const e_float& x) - { - if (x.crepresentation().iszero()) { return 0; } - else if(x.crepresentation().isneg ()) { return -1; } - else { return 1; } - } - - inline void eval_convert_to(unsigned long long* result, - const e_float& val) - { - *result = (val.crepresentation()).extract_unsigned_long_long(); - } - - inline void eval_convert_to(signed long long* result, - const e_float& val) - { - *result = (val.crepresentation()).extract_signed_long_long(); - } - - inline void eval_convert_to(long double* result, - const e_float& val) - { - *result = (val.crepresentation()).extract_long_double(); - } - - inline void eval_frexp( e_float& result, - const e_float& x, - typename e_float::exponent_type* expptr) - { - using local_exponent_type = int; - - local_exponent_type exp2; - - result.representation() = ::ef::frexp(x.crepresentation(), &exp2); - - *expptr = static_cast(exp2); - } - - inline void eval_frexp( e_float& result, - const e_float& x, - int* expptr, - typename std::enable_if::value == false>::type const* = nullptr) - { - result.representation() = ::ef::frexp(x.crepresentation(), expptr); - } - - inline void eval_ldexp( e_float& result, - const e_float& x, - const typename e_float::exponent_type exp_value) - { - using local_exponent_type = int; - - result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); - } - - inline void eval_ldexp( e_float& result, - const e_float& x, - int exp_value, - typename std::enable_if::value == false>::type const* = nullptr) - { - using local_exponent_type = int; - - result.representation() = ::ef::ldexp(x.crepresentation(), local_exponent_type(exp_value)); - } - - inline e_float::exponent_type eval_ilogb(const e_float& val) - { - if(val.crepresentation().iszero()) - { - return (std::numeric_limits::min)(); - } - - if ((val.crepresentation().isinf)()) - { - return (std::numeric_limits::max)(); - } - - if ((val.crepresentation().isnan)()) - { - #if defined(FP_ILOGBNAN) - return FP_ILOGBNAN; - #else - return (std::numeric_limits::max)(); - #endif - } - - // Set the result to base-10 exponent (order) of the value. - return val.crepresentation().order(); - } - - template::value == true) - && (std::is_integral ::value == true))>::type const* = nullptr> - void eval_scalbn(e_float& result, const e_float& val, IntegralType e) - { - const std::int64_t my_e = static_cast(e); - - const e_float t(::e_float(1.0, my_e)); - - eval_multiply(result, val, t); - } - - inline void eval_floor( e_float& result, - const e_float& x) - { - result.representation() = ::ef::floor(x.crepresentation()); - } - - inline void eval_ceil( e_float& result, - const e_float& x) - { - result.representation() = ::ef::ceil(x.crepresentation()); - } - - inline int eval_fpclassify(const e_float& x) - { - if ((x.crepresentation().isinf)()) { return FP_INFINITE; } - else if((x.crepresentation().isnan)()) { return FP_NAN; } - else if( x.crepresentation().iszero()) { return FP_ZERO; } - else { return FP_NORMAL; } - } - - inline void eval_trunc( e_float& result, - const e_float& x) - { - result.representation() = ::ef::integer_part(x.crepresentation()); - } - - inline void eval_abs( e_float& result, - const e_float& x) - { - result.representation() = x.crepresentation(); - - if(result.crepresentation().isneg()) - { - result.representation().negate(); - } - } - - inline void eval_fabs( e_float& result, - const e_float& x) - { - result.representation() = x.crepresentation(); - - if(result.crepresentation().isneg()) - { - result.representation().negate(); - } - } - - inline void eval_sqrt( e_float& result, - const e_float& x) - { - result.representation() = ::ef::sqrt(x.crepresentation()); - } - - inline void eval_sin( e_float& result, - const e_float& x) - { - result.representation() = ::ef::sin(x.crepresentation()); - } - - inline void eval_cos( e_float& result, - const e_float& x) - { - result.representation() = ::ef::cos(x.crepresentation()); - } - - inline void eval_tan( e_float& result, - const e_float& x) - { - result.representation() = ::ef::tan(x.crepresentation()); - } - - inline void eval_asin( e_float& result, - const e_float& x) - { - result.representation() = ::ef::asin(x.crepresentation()); - } - - inline void eval_acos( e_float& result, - const e_float& x) - { - result.representation() = ::ef::acos(x.crepresentation()); - } - - inline void eval_atan( e_float& result, - const e_float& x) - { - result.representation() = ::ef::atan(x.crepresentation()); - } - - inline void eval_atan2( e_float& result, - const e_float& y, - const e_float& x) - { - result.representation() = ::ef::atan2(y.crepresentation(), x.crepresentation()); - } - - inline void eval_log( e_float& result, - const e_float& x) - { - result.representation() = ::ef::log(x.crepresentation()); - } - - inline void eval_log10( e_float& result, - const e_float& x) - { - result.representation() = ::ef::log10(x.crepresentation()); - } - - inline void eval_exp( e_float& result, - const e_float& x) - { - result.representation() = ::ef::exp(x.crepresentation()); - } - - inline void eval_sinh( e_float& result, - const e_float& x) - { - result.representation() = ::ef::sinh(x.crepresentation()); - } - - inline void eval_cosh( e_float& result, - const e_float& x) - { - result.representation() = ::ef::cosh(x.crepresentation()); - } - - inline void eval_tanh( e_float& result, - const e_float& x) - { - result.representation() = ::ef::tanh(x.crepresentation()); - } - - inline void eval_fmod( e_float& result, - const e_float& x, - const e_float& y) - { - if(y.crepresentation().iszero()) - { - result.representation() = ::ef::zero(); - } - else - { - // Calculate the fractional part of x such that: - // x = (integer_part * y) + fractional_part, - // where - // |fractional_part| < |y|, - // and fractional_part has the same sign as x. - - const ::e_float integer_part = ::ef::floor(x.crepresentation() / y.crepresentation()); - - result.representation() = - x.crepresentation() - (integer_part * y.crepresentation()); - - if(x.crepresentation().isneg() != y.crepresentation().isneg()) - { - result.representation() -= y.crepresentation(); - } - } - } - - inline void eval_pow( e_float& result, - const e_float& x, - const e_float& a) - { - result.representation() = ::ef::pow(x.crepresentation(), a.crepresentation()); - } - - } } } // namespace boost::math::ef - - namespace boost { namespace math { namespace policies { - - // Specialization of the precision structure. - template - struct precision, - ThisPolicy> - { - using precision_type = typename ThisPolicy::precision_type; - - using local_digits_2 = digits2<((::e_float::ef_digits10 + 1LL) * 1000LL) / 301LL>; - - using type = typename std::conditional<((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)), - local_digits_2, - precision_type>::type; - }; - - } } } // namespaces boost::math::policies - - namespace std - { - template - class numeric_limits> - { - public: - static constexpr bool is_specialized = true; - static constexpr bool is_signed = true; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr bool is_bounded = true; - static constexpr bool is_modulo = false; - static constexpr bool is_iec559 = false; - static constexpr int digits = ::e_float::ef_digits10; - static constexpr int digits10 = ::e_float::ef_digits10; - static constexpr int max_digits10 = ::e_float::ef_digits10 + 1; - - static constexpr std::int64_t max_exponent = ::e_float::ef_max_exp; - static constexpr std::int64_t max_exponent10 = ::e_float::ef_max_exp10; - static constexpr std::int64_t min_exponent = ::e_float::ef_min_exp; - static constexpr std::int64_t min_exponent10 = ::e_float::ef_min_exp10; - - static constexpr int radix = 10; - static constexpr std::float_round_style round_style = std::round_indeterminate; - static constexpr bool has_infinity = true; - static constexpr bool has_quiet_NaN = true; - static constexpr bool has_signaling_NaN = false; - static constexpr std::float_denorm_style has_denorm = std::denorm_absent; - static constexpr bool has_denorm_loss = false; - static constexpr bool traps = false; - static constexpr bool tinyness_before = false; - - static constexpr boost::multiprecision::number (min) () { return boost::math::ef::e_float(ef::value_min()); } - static constexpr boost::multiprecision::number (max) () { return boost::math::ef::e_float(ef::value_max()); } - static constexpr boost::multiprecision::number lowest () { return boost::math::ef::e_float(ef::zero()); } - static constexpr boost::multiprecision::number epsilon () { return boost::math::ef::e_float(ef::value_eps()); } - static constexpr boost::multiprecision::number round_error () { return boost::math::ef::e_float(ef::half()); } - static constexpr boost::multiprecision::number infinity () { return boost::math::ef::e_float(ef::value_inf()); } - static constexpr boost::multiprecision::number quiet_NaN () { return boost::math::ef::e_float(ef::value_nan()); } - static constexpr boost::multiprecision::number signaling_NaN() { return boost::math::ef::e_float(ef::zero()); } - static constexpr boost::multiprecision::number denorm_min () { return boost::math::ef::e_float(ef::zero()); } - }; - } // namespace std - -#endif // E_FLOAT_2017_08_18_HPP_ diff --git a/include/boost/math/constants/calculate_constants.hpp b/include/boost/math/constants/calculate_constants.hpp index 8ccab356c..22ac2ff90 100644 --- a/include/boost/math/constants/calculate_constants.hpp +++ b/include/boost/math/constants/calculate_constants.hpp @@ -765,8 +765,7 @@ inline T constant_khinchin::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC((s template template inline T constant_extreme_value_skewness::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC((std::integral_constant))) -{ // from e_float constants.cpp - // Mathematica: N[12 Sqrt[6] Zeta[3]/Pi^3, 1101] +{ // N[12 Sqrt[6] Zeta[3]/Pi^3, 1101] BOOST_MATH_STD_USING T ev(12 * sqrt(static_cast(6)) * zeta_three > >() / pi_cubed > >() ); @@ -885,56 +884,55 @@ inline T constant_glaisher::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC((s v /= -12; return exp(v); - /* + /* // from http://mpmath.googlecode.com/svn/data/glaisher.txt // 20,000 digits of the Glaisher-Kinkelin constant A = exp(1/2 - zeta'(-1)) // Computed using A = exp((6 (-zeta'(2))/pi^2 + log 2 pi + gamma)/12) - // with Euler-Maclaurin summation for zeta'(2). - T g( - "1.282427129100622636875342568869791727767688927325001192063740021740406308858826" - "46112973649195820237439420646120399000748933157791362775280404159072573861727522" - "14334327143439787335067915257366856907876561146686449997784962754518174312394652" - "76128213808180219264516851546143919901083573730703504903888123418813674978133050" - "93770833682222494115874837348064399978830070125567001286994157705432053927585405" - "81731588155481762970384743250467775147374600031616023046613296342991558095879293" - "36343887288701988953460725233184702489001091776941712153569193674967261270398013" - "52652668868978218897401729375840750167472114895288815996668743164513890306962645" - "59870469543740253099606800842447417554061490189444139386196089129682173528798629" - "88434220366989900606980888785849587494085307347117090132667567503310523405221054" - "14176776156308191919997185237047761312315374135304725819814797451761027540834943" - "14384965234139453373065832325673954957601692256427736926358821692159870775858274" - "69575162841550648585890834128227556209547002918593263079373376942077522290940187"); + // with Euler-Maclaurin summation for zeta'(2). + T g( + "1.282427129100622636875342568869791727767688927325001192063740021740406308858826" + "46112973649195820237439420646120399000748933157791362775280404159072573861727522" + "14334327143439787335067915257366856907876561146686449997784962754518174312394652" + "76128213808180219264516851546143919901083573730703504903888123418813674978133050" + "93770833682222494115874837348064399978830070125567001286994157705432053927585405" + "81731588155481762970384743250467775147374600031616023046613296342991558095879293" + "36343887288701988953460725233184702489001091776941712153569193674967261270398013" + "52652668868978218897401729375840750167472114895288815996668743164513890306962645" + "59870469543740253099606800842447417554061490189444139386196089129682173528798629" + "88434220366989900606980888785849587494085307347117090132667567503310523405221054" + "14176776156308191919997185237047761312315374135304725819814797451761027540834943" + "14384965234139453373065832325673954957601692256427736926358821692159870775858274" + "69575162841550648585890834128227556209547002918593263079373376942077522290940187"); - return g; - */ + return g; + */ } template template inline T constant_rayleigh_skewness::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC((std::integral_constant))) -{ // From e_float - // 1100 digits of the Rayleigh distribution skewness - // Mathematica: N[2 Sqrt[Pi] (Pi - 3)/((4 - Pi)^(3/2)), 1100] +{ // 1100 digits of the Rayleigh distribution skewness + // N[2 Sqrt[Pi] (Pi - 3)/((4 - Pi)^(3/2)), 1100] BOOST_MATH_STD_USING T rs(2 * root_pi > >() * pi_minus_three > >() / pow(four_minus_pi > >(), static_cast(3./2)) ); - // 6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264, + // 6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264, - //"0.6311106578189371381918993515442277798440422031347194976580945856929268196174737254599050270325373067" - //"9440004726436754739597525250317640394102954301685809920213808351450851396781817932734836994829371322" - //"5797376021347531983451654130317032832308462278373358624120822253764532674177325950686466133508511968" - //"2389168716630349407238090652663422922072397393006683401992961569208109477307776249225072042971818671" - //"4058887072693437217879039875871765635655476241624825389439481561152126886932506682176611183750503553" - //"1218982627032068396407180216351425758181396562859085306247387212297187006230007438534686340210168288" - //"8956816965453815849613622117088096547521391672977226658826566757207615552041767516828171274858145957" - //"6137539156656005855905288420585194082284972984285863898582313048515484073396332610565441264220790791" - //"0194897267890422924599776483890102027823328602965235306539844007677157873140562950510028206251529523" - //"7428049693650605954398446899724157486062545281504433364675815915402937209673727753199567661561209251" - //"4695589950526053470201635372590001578503476490223746511106018091907936826431407434894024396366284848"); ; - return rs; + //"0.6311106578189371381918993515442277798440422031347194976580945856929268196174737254599050270325373067" + //"9440004726436754739597525250317640394102954301685809920213808351450851396781817932734836994829371322" + //"5797376021347531983451654130317032832308462278373358624120822253764532674177325950686466133508511968" + //"2389168716630349407238090652663422922072397393006683401992961569208109477307776249225072042971818671" + //"4058887072693437217879039875871765635655476241624825389439481561152126886932506682176611183750503553" + //"1218982627032068396407180216351425758181396562859085306247387212297187006230007438534686340210168288" + //"8956816965453815849613622117088096547521391672977226658826566757207615552041767516828171274858145957" + //"6137539156656005855905288420585194082284972984285863898582313048515484073396332610565441264220790791" + //"0194897267890422924599776483890102027823328602965235306539844007677157873140562950510028206251529523" + //"7428049693650605954398446899724157486062545281504433364675815915402937209673727753199567661561209251" + //"4695589950526053470201635372590001578503476490223746511106018091907936826431407434894024396366284848"); ; + return rs; } template diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index dedec3110..f53945fd8 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -861,7 +861,6 @@ test-suite mp : [ compile ntl_concept_check.cpp : [ check-target-builds ../config//has_ntl_rr : : no ] off ] [ compile mpfr_concept_check.cpp : [ check-target-builds ../config//has_mpfr_class : : no ] off ] [ compile mpreal_concept_check.cpp : [ check-target-builds ../config//has_mpreal : : no ] off ] - [ compile e_float_concept_check.cpp : [ check-target-builds ../config//has_e_float : : no ] off ] ; test-suite misc : diff --git a/test/e_float_concept_check.cpp b/test/e_float_concept_check.cpp deleted file mode 100644 index 74149fbc8..000000000 --- a/test/e_float_concept_check.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -// Copyright John Maddock 2011. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// -// This tests two things: that e_float meets our -// conceptual requirements, and that we can instantiate -// all our distributions and special functions on this type. -// -#define BOOST_MATH_ASSERT_UNDEFINED_POLICY false -#define TEST_MPFR - -#ifdef _MSC_VER -# pragma warning(disable:4800) -# pragma warning(disable:4512) -# pragma warning(disable:4127) -# pragma warning(disable:4512) -# pragma warning(disable:4503) // decorated name length exceeded, name was truncated -#endif - -#define E_FLOAT_TYPE_EFX - -#include - -#include -#include "compile_test/instantiate.hpp" - -void foo() -{ - instantiate(boost::math::ef::e_float()); -} - -int main() -{ - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); -} - - From 2fa3805db364a2e97b7786d0d8b84a08b3003ae7 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Tue, 23 Feb 2021 07:06:22 +0100 Subject: [PATCH 18/19] [ci skip] Clarify e_float bindings in docs --- doc/concepts/concepts.qbk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/concepts/concepts.qbk b/doc/concepts/concepts.qbk index 25abd92af..20af5077b 100644 --- a/doc/concepts/concepts.qbk +++ b/doc/concepts/concepts.qbk @@ -198,25 +198,29 @@ There is a concept checking test program for mpfr support __multiprecision was a development from the __e_float library by Christopher Kormanyos. The e_float library is still maintained in the -[@http://github/ckormanyos/e_float-2021/ e_float-2021 repository]. -It can still be used with the Boost.Math library via +[@http://github/ckormanyos/e_float-2021/ e_float-2021 repository], +and it can still be used with the Boost.Math library via its [@http://github.com/ckormanyos/e_float-2021/blob/main/libs/math/include/boost/math/bindings/e_float.hpp/ bindings header]: These bindings define the type `boost::math::ef::e_float`, -which is a thin wrapper around the original `::e_float` class. +which provides a thin wrapper around the original `::e_float` class +that simultaneously fulfills the backend requirements of Boost.Multiprecision. The `e_float` bindings provide the necessary syntactic sugar (such as namespaces, operators, ``-like functions, etc.) to make `boost::math::ef::e_float` work and interoperate seamlessly with the Boost.Math library. +This backend is intended to use a type such as + + using big_float_type = boost::multiprecision::number; Test programs including non-trivial algorithmic interaction with Boost.Math as well as a concept check for `e_float` support are included [@http://github.com/ckormanyos/e_float-2021/tree/main/libs/e_float/test_boost here]. -[*New projects are recommended to use __multiprecision with `cpp_bin_float` or `cpp_dec_float` backend instead.] +[*New projects are recommended to use __multiprecision with one of its backends such as `cpp_bin_float` or `cpp_dec_float` instead.] [endsect] [/section:e_float Using e_float Library] From be6c24dadff60f37490dd96e5637aa8e4c2d411d Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Tue, 23 Feb 2021 22:36:48 +0100 Subject: [PATCH 19/19] [ci skip] Reduce depth and scope of e_float docs --- doc/concepts/concepts.qbk | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/doc/concepts/concepts.qbk b/doc/concepts/concepts.qbk index 20af5077b..afc95afb4 100644 --- a/doc/concepts/concepts.qbk +++ b/doc/concepts/concepts.qbk @@ -197,28 +197,9 @@ There is a concept checking test program for mpfr support __multiprecision was a development from the __e_float library by Christopher Kormanyos. -The e_float library is still maintained in the -[@http://github/ckormanyos/e_float-2021/ e_float-2021 repository], -and it can still be used with the Boost.Math library via -its [@http://github.com/ckormanyos/e_float-2021/blob/main/libs/math/include/boost/math/bindings/e_float.hpp/ bindings header]: - - - -These bindings define the type `boost::math::ef::e_float`, -which provides a thin wrapper around the original `::e_float` class -that simultaneously fulfills the backend requirements of Boost.Multiprecision. -The `e_float` bindings provide the necessary syntactic sugar -(such as namespaces, operators, ``-like functions, etc.) -to make `boost::math::ef::e_float` -work and interoperate seamlessly with the Boost.Math library. -This backend is intended to use a type such as - - using big_float_type = boost::multiprecision::number; - -Test programs including non-trivial algorithmic -interaction with Boost.Math as well as a concept check -for `e_float` support are included -[@http://github.com/ckormanyos/e_float-2021/tree/main/libs/e_float/test_boost here]. +The e_float library can still be used with Boost.Math. +The [@http://github.com/ckormanyos/e_float-2021/blob/main/libs/math/include/boost/math/bindings/e_float.hpp/ e_float bindings header] +has been relocated to the [@http://github/ckormanyos/e_float-2021/ e_float-2021 repository]. [*New projects are recommended to use __multiprecision with one of its backends such as `cpp_bin_float` or `cpp_dec_float` instead.]