WPILibC++ 2023.4.3-108-ge5452e3
exp.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  internal
 

Functions

template<typename T >
constexpr T internal::exp_cf_recur (const T x, const int depth) noexcept
 
template<typename T >
constexpr T internal::exp_cf (const T x) noexcept
 
template<typename T >
constexpr T internal::exp_split (const T x) noexcept
 
template<typename T >
constexpr T internal::exp_check (const T x) noexcept
 
template<typename T >
constexpr return_t< T > exp (const T x) noexcept
 Compile-time exponential function. More...
 

Function Documentation

◆ exp()

template<typename T >
constexpr return_t< T > exp ( const T  x)
constexprnoexcept

Compile-time exponential function.

Parameters
xa real-valued input.
Returns
\( \exp(x) \) using

\[ \exp(x) = \dfrac{1}{1-\dfrac{x}{1+x-\dfrac{\frac{1}{2}x}{1 + \frac{1}{2}x - \dfrac{\frac{1}{3}x}{1 + \frac{1}{3}x - \ddots}}}} \]

The continued fraction argument is split into two parts: \( x = n + r \), where \( n \) is an integer and \( r \in [-0.5,0.5] \).