...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

The Special Functions library currently provides five templated special functions, in namespace boost. Two of these (`sinc_pi`

and `sinhc_pi`

) are needed by our implementation of quaternions and octonions.

The functions `acosh`

, `asinh`

and `atanh`

are entirely classical, the function `sinc_pi`

sees heavy use in signal processing tasks, and the function `sinhc_pi`

is an ad'hoc function whose naming is modelled on `sinc_pi`

and hyperbolic functions.

The mathematical text has been typeset with Nisus Writer, and the illustrations have been made with Graphing Calculator. Jens Maurer was the Review Manager for this library. More acknowledgements in the History section. Thank you to all who contributed to the discution about this library.

The interface and implementation for each function (or forms of a function) are both supplied by one header file:

The special_functions_test.cpp test program tests the functions for float, double and long double arguments (sample output, with message output enabled).

If you define the symbol BOOST_SPECIAL_FUNCTIONS_TEST_VERBOSE, you will get additional output (verbose output), which may prove useful for tuning on your platform (the library use "reasonable" tolerances, which may prove to be too strict for your platform); this will only be helpfull if you enable message output at the same time, of course (by uncommenting the relevant line in the test or by adding --log_level=messages to your command line,...).

```
namespace boost
{
namespace math
{
template<typename T> inline T acosh(const T x);
template<typename T> inline T asinh(const T x);
template<typename T> inline T atanh(const T x);
template<typename T> inline T sinc_pi(const T x);
template<typename T, template<typename> class U> inline U<T> sinc_pi(const U<T> x);
template<typename T> inline T sinhc_pi(const T x);
template<typename T, template<typename> class U> inline U<T> sinhc_pi(const U<T> x);
}
}
```

The functions implemented here can throw standard exceptions, but no exception specification has been made.

`template<typename T> inline T `**acosh**(const T x);

Computes the reciprocal of (the restriction to the range of) the hyperbolic cosine function, at

`x`

. Values returned are positive. Generalised Taylor series are used near 1 and Laurent series are used near the infinity to ensure accuracy.If

`x`

is in the range a quiet NaN is returned (if the system allows, otherwise a`domain_error`

exception is generated).

`template<typename T> inline T `**asinh**(const T x);

Computes the reciprocal of the hyperbolic sine function. Taylor series are used at the origin and Laurent series are used near the infinity to ensure accuracy.

`template<typename T> inline T `**atanh**(const T x);

Computes the reciprocal of the hyperbolic tangent function, at

`x`

. Taylor series are used at the origin to ensure accuracy.If

`x`

is in the range or in the range a quiet NaN is returned (if the system allows, otherwise a`domain_error`

exception is generated).If

`x`

is in the range , minus infinity is returned (if the system allows, otherwise an`out_of_range`

exception is generated), with denoting`numeric_limits<T>::epsilon()`

.If

`x`

is in the range , plus infinity is returned (if the system allows, otherwise an`out_of_range`

exception is generated), with denoting`numeric_limits<T>::epsilon()`

.

`template<typename T> inline T `**sinc_pi**(const T x);

`template<typename T, template<typename> class U> inline U<T> `**sinc_pi**(const U<T> x);

Computes the Sinus Cardinal of

`x`

. The second form is for complexes, quaternions, octonions... Taylor series are used at the origin to ensure accuracy.

`template<typename T> inline T `**sinhc_pi**(const T x);

`template<typename T, template<typename> class U> inline U<T> `**sinhc_pi**(const U<T> x);

Computes the Hyperbolic Sinus Cardinal of

`x`

. The second form is for complexes, quaternions, octonions... Taylor series are used at the origin to ensure accuracy.

- 1.4.2 - 03/02/2003: transitionned to the unit test framework; <boost/config.hpp> now included by the library headers (rather than the test files).
- 1.4.1 - 18/09/2002: improved compatibility with Microsoft compilers.
- 1.4.0 - 14/09/2001: added (after rewrite)
`acosh`

and`asinh`

, which were submited by Eric Ford; applied changes for Gcc 2.9.x suggested by John Maddock; improved accuracy; sanity check for test file, related to accuracy. - 1.3.2 - 07/07/2001: introduced
`namespace math`

. - 1.3.1 - 07/06/2001:(end of Boost review) split
`special_functions.hpp`

into`atanh.hpp`

,`sinc.hpp`

and`sinhc.hpp`

; improved efficiency of`atanh`

with compile-time technique (Daryle Walker); improved accuracy of all functions near zero (Peter Schmitteckert). - 1.3.0 - 26/03/2001: support for complexes & all, for cardinal functions.
- 1.2.0 - 31/01/2001: minor modifications for Koenig lookup.
- 1.1.0 - 23/01/2001: boostification.
- 1.0.0 - 10/08/1999: first public version.

- Add more functions.
- Improve test of each function.

Revised 06 Feb 2003

© Copyright Hubert Holin 2001-2003. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.