Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

c++boost.gif (8819 bytes)Special Functions library

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.

Acknowledgements

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.

Header Files

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

Test Program

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,...).

Synopsis

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);
		

	}

	

}

Functions

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

acosh

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).

asinh

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.

atanh

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().

sinc_pi

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.

sinhc_pi

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.

History

To Do


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.