MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / log1p

Function log1p

include/rabitqlib/third/Eigen/src/Core/MathFunctions.h:725–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723 // or that there is no suitable std::log1p function available
724 template<typename Scalar>
725 EIGEN_DEVICE_FUNC inline Scalar log1p(const Scalar& x) {
726 EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
727 typedef typename NumTraits<Scalar>::Real RealScalar;
728 EIGEN_USING_STD(log);
729 Scalar x1p = RealScalar(1) + x;
730 Scalar log_1p = log_impl<Scalar>::run(x1p);
731 const bool is_small = numext::equal_strict(x1p, Scalar(1));
732 const bool is_inf = numext::equal_strict(x1p, log_1p);
733 return (is_small || is_inf) ? x : x * (log_1p / (x1p - RealScalar(1)));
734 }
735}
736
737template<typename Scalar>

Callers 3

plog1pFunction · 0.70
runMethod · 0.70

Calls 2

runFunction · 0.85
equal_strictFunction · 0.85

Tested by

no test coverage detected