5 #ifndef BPP_PHYL_LIKELIHOOD_DATAFLOW_EXTENDEDFLOAT_H
6 #define BPP_PHYL_LIKELIHOOD_DATAFLOW_EXTENDEDFLOAT_H
24 inline int powi (
int base,
unsigned int exp)
49 static constexpr
int radix = std::numeric_limits<FloatType>::radix;
93 if (std::isfinite (
f_))
95 bool normalized =
false;
111 bool normalized =
false;
213 template<typename F, typename = typename std::enable_if<std::is_arithmetic<F>::value>::type>
228 template<typename F, typename = typename std::enable_if<std::is_arithmetic<F>::value>::type>
352 inline double log ()
const
363 inline std::tuple<int, double>
lround()
const
365 throw Exception(
"ExtendedFloat::lround need to be checked.");
371 auto d = std::lround(t);
372 return std::tuple<int, double>{d, remainder(t, 1)};
379 auto lrc = std::lround(c);
385 auto t = c * constexpr_power<double>(
radix, b);
386 auto it = std::lround(t);
387 return std::tuple<int, double>{res + it, remainder(t, 1)};
399 auto u = ef.lround();
408 operator double()
const
413 template<
typename Scalar,
typename NullaryOp,
bool has_nullary,
bool has_unary,
bool has_binary>
455 return rhs.ExtendedFloat::operator+(-lhs);
460 return rhs.ExtendedFloat::operator+(lhs);
465 return rhs * (1 / lhs);
502 struct NumTraits<
bpp::ExtendedFloat> :
513 RequireInitialization = 1,
519 template<
typename BinaryOp>
522 template<
typename BinaryOp>
ExtendedFloat operator-() const
static ExtendedFloat denorm_pow(const ExtendedFloat &lhs, double exp)
bool operator!=(const ExtendedFloat &rhs) const
static ExtendedFloat denorm_sub(const ExtendedFloat &lhs, const double &rhs)
ExtendedFloat pow(double exp) const
static constexpr int smallest_repr_radix_power
ExtendedFloat operator*(const F &rhs) const
void normalize() noexcept
ExtendedFloat pow(int exp) const
ExtendedFloat & operator-=(const ExtendedFloat &rhs)
static const double ln_radix
static ExtendedFloat denorm_add(const ExtendedFloat &lhs, const ExtendedFloat &rhs)
bool operator<=(const ExtendedFloat &rhs) const
ExtendedFloat & operator=(const ExtendedFloat &ef)
static ExtendedFloat denorm_pow(const ExtendedFloat &lhs, int exp)
ExtendedFloat & operator+=(const ExtendedFloat &rhs)
bool operator==(const ExtendedFloat &rhs) const
static ExtendedFloat denorm_div(const ExtendedFloat &lhs, const ExtendedFloat &rhs)
constexpr ExtendedFloat(FloatType f=0.0, ExtType e=0) noexcept
ExtendedFloat operator-(const ExtendedFloat &rhs) const
static constexpr FloatType normalize_big_factor
ExtendedFloat abs() const
static constexpr int allowed_product_without_normalization
std::tuple< int, double > lround() const
ExtendedFloat operator-(const F &rhs) const
static ExtendedFloat denorm_mul(const ExtendedFloat &lhs, const ExtendedFloat &rhs)
static ExtendedFloat denorm_sub(const ExtendedFloat &lhs, const ExtendedFloat &rhs)
static constexpr FloatType smallest_normalized_value
ExtendedFloat & operator*=(const ExtendedFloat &rhs)
bool operator>=(const double &rhs) const
static constexpr FloatType normalize_small_factor
bool operator>=(const ExtendedFloat &rhs) const
ExtType & exponent_part() noexcept
const FloatType & float_part() const noexcept
const ExtType & exponent_part() const noexcept
ExtendedFloat operator/(const ExtendedFloat &rhs) const
bool operator>(const ExtendedFloat &rhs) const
ExtendedFloat & operator/=(const ExtendedFloat &rhs)
friend struct Eigen::internal::nullary_wrapper
ExtendedFloat exp() const
ExtendedFloat operator*(const ExtendedFloat &rhs) const
bool operator<(const ExtendedFloat &rhs) const
static constexpr FloatType biggest_normalized_value
static double convert(const ExtendedFloat &ef)
ExtendedFloat(const ExtendedFloat &ef) noexcept
static constexpr int biggest_normalized_radix_power
static constexpr int smallest_normalized_radix_power
bool normalize_big() noexcept
static constexpr int radix
FloatType & float_part() noexcept
bool operator>(const double &rhs) const
static constexpr int biggest_repr_radix_power
ExtendedFloat operator+(const ExtendedFloat &rhs) const
Defines the basic types of data flow nodes.
double log(const ExtendedFloat &ef)
ExtendedFloat exp(const ExtendedFloat &ef)
int powi(int base, unsigned int exp)
std::vector< T > operator-(const std::vector< T > &v1, const std::vector< T > &v2)
std::string to_string(const ExtendedFloat &ef)
std::string to_string(const NoDimension &)
ExtendedFloat pow(const ExtendedFloat &ef, double exp)
std::vector< T > operator*(const std::vector< T > &v1, const std::vector< T > &v2)
std::vector< T > operator+(const std::vector< T > &v1, const std::vector< T > &v2)
std::vector< T > operator/(const std::vector< T > &v1, const std::vector< T > &v2)
double convert(const bpp::ExtendedFloat &ef)
std::ostream & operator<<(std::ostream &out, const BppBoolean &s)
ExtendedFloat abs(const ExtendedFloat &ef)
constexpr T constexpr_power(T d, int n)
bpp::ExtendedFloat NonInteger
bpp::ExtendedFloat Nested
bpp::ExtendedFloat ReturnType
bpp::ExtendedFloat ReturnType