Theoretica
A C++ numerical and automatic mathematical library
real_analysis.h File Reference

Real functions. More...

#include "./core_traits.h"
#include "./constants.h"
#include "./error.h"

Go to the source code of this file.

Namespaces

 theoretica
 Main namespace of the library which contains all functions and objects.
 

Functions

TH_CONSTEXPR real theoretica::identity (real x)
 Identity.
 
template<typename Type , typename = std::enable_if<is_real_type<Type>::value>>
TH_CONSTEXPR Type theoretica::conjugate (Type x)
 Complex conjugate of a real number (identity)
 
TH_CONSTEXPR real theoretica::square (real x)
 Compute the square of a real number. More...
 
TH_CONSTEXPR real theoretica::cube (real x)
 Compute the cube of a real number. More...
 
template<typename UnsignedIntType = uint64_t>
UnsignedIntType theoretica::isqrt (UnsignedIntType n)
 Compute the integer square root of a positive integer. More...
 
template<typename UnsignedIntType = uint64_t>
UnsignedIntType theoretica::icbrt (UnsignedIntType n)
 Compute the integer cubic root of a positive integer. More...
 
real theoretica::sqrt (real x)
 Compute the square root of a real number. More...
 
real theoretica::cbrt (real x)
 Compute the cubic root of x. More...
 
real theoretica::abs (real x)
 Compute the absolute value of a real number. More...
 
int theoretica::sgn (real x)
 Return the sign of x (1 if positive, -1 if negative, 0 if null) More...
 
TH_CONSTEXPR int theoretica::floor (real x)
 Compute the floor of x Computes the maximum integer number that is smaller than x. More...
 
real theoretica::fract (real x)
 Compute the fractional part of a real number. More...
 
real theoretica::max (real x, real y)
 Return the greatest number between two real numbers. More...
 
template<typename T >
theoretica::max (T x, T y)
 Compare two objects and return the greatest. More...
 
real theoretica::min (real x, real y)
 Return the smallest number between two real numbers. More...
 
template<typename T >
theoretica::min (T x, T y)
 Compare two objects and return the greatest. More...
 
real theoretica::clamp (real x, real a, real b)
 Clamp x between a and b. More...
 
template<typename T >
theoretica::clamp (T x, T a, T b)
 Clamp a value between two other values. More...
 
real theoretica::log2 (real x)
 Compute the binary logarithm of a real number. More...
 
real theoretica::log10 (real x)
 Compute the base-10 logarithm of x. More...
 
real theoretica::ln (real x)
 Compute the natural logarithm of x. More...
 
template<typename UnsignedIntType = uint64_t>
UnsignedIntType theoretica::ilog2 (UnsignedIntType x)
 Find the integer logarithm of x. More...
 
template<typename UnsignedIntType = uint64_t>
UnsignedIntType theoretica::pad2 (UnsignedIntType x)
 Get the smallest power of 2 bigger than or equal to x. More...
 
template<typename T = real>
TH_CONSTEXPRtheoretica::pow (T x, int n)
 Compute the n-th power of x (where n is natural) More...
 
template<typename T = real>
TH_CONSTEXPRtheoretica::ipow (T x, unsigned int n, T neutral_element=T(1))
 Compute the n-th positive power of x (where n is natural) More...
 
template<typename IntType = uint64_t>
TH_CONSTEXPR IntType theoretica::fact (unsigned int n)
 Compute the factorial of n.
 
template<typename T = uint64_t>
TH_CONSTEXPRtheoretica::falling_fact (T x, unsigned int n)
 Compute the falling factorial of n.
 
template<typename T = uint64_t>
TH_CONSTEXPRtheoretica::rising_fact (T x, unsigned int n)
 Compute the rising factorial of n.
 
template<typename IntType = unsigned long long int>
TH_CONSTEXPR IntType theoretica::double_fact (unsigned int n)
 Compute the double factorial of n.
 
real theoretica::exp (real x)
 Compute the real exponential. More...
 
real theoretica::expm1 (real x)
 Compute the exponential of x minus 1 more accurately for really small x. More...
 
real theoretica::powf (real x, real a)
 Approximate x elevated to a real exponent. More...
 
real theoretica::root (real x, int n)
 Compute the n-th root of x. More...
 
real theoretica::sin (real x)
 Compute the sine of a real number. More...
 
real theoretica::cos (real x)
 Compute the cosine of a real number. More...
 
real theoretica::tan (real x)
 Compute the tangent of x. More...
 
real theoretica::cot (real x)
 Compute the cotangent of x. More...
 
real theoretica::atan (real x)
 Compute the arctangent. More...
 
real theoretica::asin (real x)
 Compute the arcsine. More...
 
real theoretica::acos (real x)
 Compute the arccosine. More...
 
real theoretica::atan2 (real y, real x)
 Compute the 2 argument arctangent. More...
 
real theoretica::sinh (real x)
 Compute the hyperbolic sine. More...
 
real theoretica::cosh (real x)
 Compute the hyperbolic cosine. More...
 
real theoretica::tanh (real x)
 Compute the hyperbolic tangent. More...
 
real theoretica::coth (real x)
 Compute the hyperbolic cotangent. More...
 
real theoretica::asinh (real x)
 Compute the inverse hyperbolic sine.
 
real theoretica::acosh (real x)
 Compute the inverse hyperbolic cosine.
 
real theoretica::atanh (real x)
 Compute the inverse hyperbolic tangent.
 
real theoretica::sigmoid (real x)
 Compute the sigmoid function. More...
 
real theoretica::sinc (real x)
 Compute the normalized sinc function. More...
 
real theoretica::heaviside (real x)
 Compute the heaviside function. More...
 
template<typename IntType = unsigned long long int>
TH_CONSTEXPR IntType theoretica::binomial_coeff (unsigned int n, unsigned int m)
 Compute the binomial coefficient. More...
 
TH_CONSTEXPR real theoretica::radians (real degrees)
 Convert degrees to radians. More...
 
TH_CONSTEXPR real theoretica::degrees (real radians)
 Convert radians to degrees. More...
 
template<typename T >
TH_CONSTEXPRtheoretica::kronecker_delta (T i, T j)
 Kronecker delta, equals 1 if i is equal to j, 0 otherwise. More...
 
template<typename IntType = unsigned long long int>
TH_CONSTEXPR IntType theoretica::catalan (unsigned int n)
 The n-th Catalan number.
 

Detailed Description

Real functions.