diff --git a/doc/html/index.html b/doc/html/index.html index 2dbab34ab..aeb0573b8 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -25,7 +25,7 @@
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

diff --git a/doc/sf_and_dist/error_handling.qbk b/doc/sf_and_dist/error_handling.qbk index 0efe0de59..7ac906b71 100644 --- a/doc/sf_and_dist/error_handling.qbk +++ b/doc/sf_and_dist/error_handling.qbk @@ -32,6 +32,8 @@ The kinds of errors that can be raised are: [[Evaluation Error][Occurs when an internal error occured that prevented the result from being evaluated: this should never occur, but if it does, then it's likely to be due to an iterative method not converging fast enough.]] +[[Indeterminate Result Error][Occurs when the result of a function is not + defined for the values that were passed to it.]] ] The action undertaken by each error condition is determined by the current @@ -116,13 +118,23 @@ with the default action for each error shown in bold: [table Possible Actions for Internal Evaluation Errors [[Action] [Behaviour]] [[throw_on_error][[*Throws `boost::math::evaluation_error`]]] -[[errno_on_error][Sets `::errno` to `EDOM` and returns `std::numeric_limits::infinity()`.]] -[[ignore_error][Returns `std::numeric_limits::infinity()`.]] +[[errno_on_error][Sets `::errno` to `EDOM` and returns the closest approximation found.]] +[[ignore_error][Returns the closest approximation found.]] [[user_error][Returns the result of `boost::math::policies::user_evaluation_error`: [link math_toolkit.policy.pol_tutorial.user_def_err_pol this function must be defined by the user].]] ] +[table Possible Actions for Indeterminate Result Errors +[[Action] [Behaviour]] +[[throw_on_error][Throws `std::domain_error`]] +[[errno_on_error][Sets `::errno` to `EDOM` and returns the same value as `ignore_error`.]] +[[ignore_error][[*Returns a default result that depends on the function where the error occurred.]]] +[[user_error][Returns the result of `boost::math::policies::user_indeterminate_result_error`: + [link math_toolkit.policy.pol_tutorial.user_def_err_pol + this function must be defined by the user].]] +] + [heading Rationale] The flexibility of the current implementation should be reasonably obvious, the @@ -304,6 +316,27 @@ For example if `Message` contains a "%1%" then it is replaced by the value of `val` to the full precision of T, where as "%.3g" would contain the value of `val` to 3 digits. See the __format documentation for more details. +[heading [#indeterminate_result_error]Indeterminate Result Errors] + +When the result of a special function is indeterminate for the value that was +passed to it, then the function returns the result of: + + boost::math::policies::raise_overflow_error(FunctionName, Message, Val, Default, __Policy); + +Where +`T` is the floating-point type passed to the function, `FunctionName` is the +name of the function, `Message` is an error message describing the problem, +Val is the value for which the result is indeterminate, Default is an +alternative default result that must be returned for ignore_error and +errno_on_error policies, and __Policy is the current policy in use for the +function that was called. + +The default policy for this function is `ignore_error`: note that this error +type is reserved for situations where the result is mathematically +undefined or indeterminate, but there is none the less a convention for what +the result should be: for example the C99 standard specifies that the result +of 0[super 0] is 1, even though the result is actually mathematically indeterminate. + [heading [#rounding_error]Rounding Errors] When one of the rounding functions __round, __trunc or __modf is diff --git a/doc/sf_and_dist/html/index.html b/doc/sf_and_dist/html/index.html index 437c51f79..5721d5085 100644 --- a/doc/sf_and_dist/html/index.html +++ b/doc/sf_and_dist/html/index.html @@ -43,7 +43,7 @@
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -446,7 +446,7 @@

- +

Last revised: June 29, 2008 at 08:43:26 GMT

Last revised: July 04, 2008 at 08:33:37 GMT


diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders/implementation.html b/doc/sf_and_dist/html/math_toolkit/backgrounders/implementation.html index da9025d7e..a4d1e56f9 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders/implementation.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders/implementation.html @@ -33,7 +33,7 @@ and reflect more the general implementation philosophy used.

- + Implemention philosophy
@@ -85,7 +85,7 @@ These could still provide sufficient accuracy for some speed-critical applications.

- + Accuracy and Representation of Test Values
@@ -130,7 +130,7 @@ binary value).

- + Tolerance of Tests
@@ -156,7 +156,7 @@ first that the suffix L is present, and then that the tolerance is big enough.

- + Handling Unsuitable Arguments
@@ -242,7 +242,7 @@

- + Handling of Functions that are Not Mathematically defined
@@ -276,7 +276,7 @@

- + Median of distributions
@@ -309,7 +309,7 @@ Basic Statistics. give more detail, in particular for discrete distributions.

- + Handling of Floating-Point Infinity
@@ -353,7 +353,7 @@ handling policies.

- + Scale, Shape and Location
@@ -380,7 +380,7 @@ functions, they can be added if required.

- + Notes on Implementation of Specific Functions & Distributions
@@ -392,7 +392,7 @@ 0 and upper = 1 would be more suitable.
- + Rational Approximations Used
@@ -435,7 +435,7 @@ to the "true" minimax solution.

- + Representation of Mathematical Constants
@@ -496,7 +496,7 @@ double p = boost::math::constants::pi(); // Context does not allow for disambiguation of overloaded function
- + Thread safety
@@ -521,7 +521,7 @@ the right thing here at some point.

- + Sources of Test Data
@@ -565,7 +565,7 @@ the underlying special function is known to be difficult to implement.

- + Creating and Managing the Equations
@@ -726,7 +726,7 @@ done HTML: this needs further investigation.

- + Producing Graphs
diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders/lanczos.html b/doc/sf_and_dist/html/math_toolkit/backgrounders/lanczos.html index 66727fe85..1893cc753 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders/lanczos.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders/lanczos.html @@ -27,7 +27,7 @@ The Lanczos Approximation
- + Motivation

@@ -98,7 +98,7 @@ functions divided by large powers into single (simpler) expressions.

- + The Approximation
@@ -160,7 +160,7 @@

- + Computing the Coefficients
@@ -204,7 +204,7 @@ multiplied by F as the last step.

- + Choosing the Right Parameters
@@ -228,7 +228,7 @@ computing to float precision with double precision arithmetic.

-

Table 52. Optimal choices for N and g when computing with +

Table 53. Optimal choices for N and g when computing with guard digits (source: Pugh)

@@ -371,7 +371,7 @@ exactly matches the machine epsilon for the type in question.

-

Table 53. Optimum value for N and g when computing at fixed +

Table 54. Optimum value for N and g when computing at fixed precision

@@ -536,7 +536,7 @@ is exact, and so isn't used for the gamma function.

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders/refs.html b/doc/sf_and_dist/html/math_toolkit/backgrounders/refs.html index 9455666ac..c5cf37aad 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders/refs.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders/refs.html @@ -27,7 +27,7 @@ References
- + General references
@@ -91,7 +91,7 @@ Library (version 2), Walter E. Brown

- + Calculators* that we found (and used to cross-check - as far as their widely-varying accuracy allowed). @@ -101,7 +101,7 @@ Binomial Probability Distribution Calculator.

- + Other Libraries

diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders/relative_error.html b/doc/sf_and_dist/html/math_toolkit/backgrounders/relative_error.html index c1689a5f7..a19aaf2ba 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders/relative_error.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders/relative_error.html @@ -81,7 +81,7 @@

- + The Impossibility of Zero Error
diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html b/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html index 3941caddf..600968304 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html @@ -94,7 +94,7 @@ are located!

- + The Remez Method
@@ -174,7 +174,7 @@
- + Remez Step 1
@@ -205,7 +205,7 @@ to 5.6x10-4.

- + Remez Step 2
@@ -234,7 +234,7 @@ In our example we perform multi-point exchange.

- + Iteration

@@ -250,7 +250,7 @@ remez-4

- + Rational Approximations
@@ -299,7 +299,7 @@ number of terms overall.

- + Practical Considerations
@@ -407,7 +407,7 @@ desired minimax solution (5x10-4).

- + Remez Method Checklist
@@ -461,7 +461,7 @@
- + References

diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dist_algorithms.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dist_algorithms.html index f4580c9ef..37c04c52c 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dist_algorithms.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dist_algorithms.html @@ -28,7 +28,7 @@ Algorithms

- + Finding the Location and Scale for Normal and similar distributions
@@ -50,7 +50,7 @@ using boost::math::complement; // Will be needed by users who want to use complements.
- + find_location function
@@ -80,7 +80,7 @@ }} // namespaces
- + find_scale function
diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/bernoulli_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/bernoulli_dist.html index 35f1fbfd4..2f2ca7276 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/bernoulli_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/bernoulli_dist.html @@ -87,7 +87,7 @@

- + Member Functions
@@ -103,7 +103,7 @@ Returns the success_fraction parameter of this distribution.

- + Non-member Accessors
@@ -128,7 +128,7 @@ exception and make an error message available.

- + Accuracy

@@ -136,7 +136,7 @@ and so should have errors within an epsilon or two.

- + Implementation

@@ -327,7 +327,7 @@

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/beta_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/beta_dist.html index 678ada52a..ba287b5c1 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/beta_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/beta_dist.html @@ -133,12 +133,12 @@ from the centre (where x = half).

    - + Member Functions
    - + Constructor
    beta_distribution(RealType alpha, RealType beta);
    @@ -165,7 +165,7 @@
                 yellow in the graph above).
               

    - + Parameter Accessors
    @@ -189,7 +189,7 @@ assert(mybeta.beta() == 5.); // mybeta.beta() returns 5
    - + Parameter Estimators
    @@ -242,7 +242,7 @@ from presumed-known mean and variance. Returns the value of β that gives: cdf(beta_distribution<RealType>(alpha, beta), x) == probability.

    - + Non-member Accessor Functions
    @@ -264,7 +264,7 @@ from presumed-known mean and variance. Mathworld.

    - + Applications

    @@ -277,7 +277,7 @@ from presumed-known mean and variance. statistical inference.

    - + Related distributions
    @@ -303,7 +303,7 @@ from presumed-known mean and variance. Distribution with its p parameter set to x.

    - + Accuracy

    @@ -315,7 +315,7 @@ from presumed-known mean and variance. please refer to these functions for information on accuracy.

    - + Implementation

    @@ -597,7 +597,7 @@ from presumed-known mean and variance.

- + References

diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/binomial_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/binomial_dist.html index 5c158a86b..0551d76c8 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/binomial_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/binomial_dist.html @@ -167,12 +167,12 @@

- + Member Functions
- + Construct
binomial_distribution(RealType n, RealType p);
@@ -189,7 +189,7 @@
             otherwise calls domain_error.
           

- + Accessors
RealType success_fraction() const;
@@ -205,7 +205,7 @@
             was constructed.
           

- + Lower Bound on the Success Fraction
@@ -311,7 +311,7 @@ limits illustrated in the case of the binomial. Biometrika 26 404-413.

- + Upper Bound on the Success Fraction
@@ -389,7 +389,7 @@
- + Estimating the Number of Trials Required for a Certain Number of Successes
@@ -431,7 +431,7 @@ of seeing 10 events that occur with frequency one half.

- + Estimating the Maximum Number of Trials to Ensure no more than a Certain Number of Successes @@ -479,7 +479,7 @@ Worked Example.

- + Non-member Accessors
@@ -504,7 +504,7 @@ in the context of this distribution:

-

Table 10. Meaning of the non-member accessors

+

Table 11. Meaning of the non-member accessors

@@ -627,7 +627,7 @@

- + Examples

@@ -635,7 +635,7 @@ examples are available illustrating the use of the binomial distribution.

- + Accuracy

@@ -645,7 +645,7 @@ please refer to these functions for information on accuracy.

- + Implementation

@@ -886,7 +886,7 @@

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/cauchy_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/cauchy_dist.html index c0ddab817..76f60bada 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/cauchy_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/cauchy_dist.html @@ -88,7 +88,7 @@

    - + Member Functions
    @@ -114,7 +114,7 @@ Returns the scale parameter of the distribution.

    - + Non-member Accessors
    @@ -151,7 +151,7 @@ The domain of the random variable is [-[max_value], +[min_value]].

    - + Accuracy

    @@ -160,7 +160,7 @@ have very low error rates.

    - + Implementation

    @@ -276,7 +276,7 @@

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/chi_squared_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/chi_squared_dist.html index 720214c52..be7b04797 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/chi_squared_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/chi_squared_dist.html @@ -87,7 +87,7 @@ independent, normally distributed random

    - + Member Functions
    @@ -170,7 +170,7 @@ independent, normally distributed random NIST Engineering Statistics Handbook, Section 7.2.3.2.

    - + Non-member Accessors
    @@ -196,7 +196,7 @@ independent, normally distributed random The domain of the random variable is [0, +∞].

    - + Examples

    @@ -204,7 +204,7 @@ independent, normally distributed random are available illustrating the use of the Chi Squared Distribution.

    - + Accuracy

    @@ -212,7 +212,7 @@ independent, normally distributed random gamma functions: please refer to the accuracy data for those functions.

    - + Implementation

    @@ -379,7 +379,7 @@ independent, normally distributed random

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/exp_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/exp_dist.html index 2f12fc11e..7d0991f7a 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/exp_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/exp_dist.html @@ -71,7 +71,7 @@

    - + Member Functions
    @@ -91,7 +91,7 @@ Accessor function returns the lambda parameter of the distribution.

    - + Non-member Accessors
    @@ -111,7 +111,7 @@ The domain of the random variable is [0, +∞].

    - + Accuracy

    @@ -122,7 +122,7 @@ should have very low error rates.

    - + Implementation

    @@ -283,7 +283,7 @@

- + references
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/extreme_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/extreme_dist.html index d448b1da0..cb022ce4f 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/extreme_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/extreme_dist.html @@ -100,7 +100,7 @@

    - + Member Functions
    @@ -125,7 +125,7 @@ Returns the scale parameter of the distribution.

    - + Non-member Accessors
    @@ -145,7 +145,7 @@ The domain of the random parameter is [-∞, +∞].

    - + Accuracy

    @@ -154,7 +154,7 @@ very low error rates.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/f_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/f_dist.html index 2c2527e57..cd59d4ff0 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/f_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/f_dist.html @@ -80,7 +80,7 @@

    - + Member Functions
    @@ -106,7 +106,7 @@ Returns the denominator degrees of freedom parameter of the distribution.

    - + Non-member Accessors
    @@ -126,7 +126,7 @@ The domain of the random variable is [0, +∞].

    - + Examples

    @@ -134,7 +134,7 @@ are available illustrating the use of the F Distribution.

    - + Accuracy

    @@ -143,7 +143,7 @@ refer to those functions for accuracy data.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html index d173a28a1..4dfee436c 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html @@ -137,7 +137,7 @@ than a dedicated Erlang Distribution.

    - + Member Functions
    @@ -162,7 +162,7 @@ Returns the scale parameter of this distribution.

    - + Non-member Accessors
    @@ -182,7 +182,7 @@ The domain of the random variable is [0,+∞].

    - + Accuracy

    @@ -194,7 +194,7 @@ refer to the accuracy data for those functions for more information.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/lognormal_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/lognormal_dist.html index fefddcc05..3e7bd4697 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/lognormal_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/lognormal_dist.html @@ -88,7 +88,7 @@

    - + Member Functions
    @@ -121,7 +121,7 @@ Returns the scale parameter of this distribution.

    - + Non-member Accessors
    @@ -141,7 +141,7 @@ The domain of the random variable is [0,+∞].

    - + Accuracy

    @@ -150,7 +150,7 @@ function, and as such should have very low error rates.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_beta_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_beta_dist.html index a55e6e744..7ef64d035 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_beta_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_beta_dist.html @@ -96,7 +96,7 @@ is a central χ2 random variable with

    - + Member Functions
    @@ -128,7 +128,7 @@ is a central χ2 random variable with was constructed.

    - + Non-member Accessors
    @@ -152,7 +152,7 @@ is a central χ2 random variable with The domain of the random variable is [0, 1].

    - + Accuracy

    @@ -168,7 +168,7 @@ is a central χ2 random variable with zero error.

    -

    Table 12. Errors In CDF of the Noncentral Beta

    +

    Table 13. Errors In CDF of the Noncentral Beta

    @@ -295,7 +295,7 @@ is a central χ2 random variable with functions are broadly similar.

    - + Tests

    @@ -307,7 +307,7 @@ is a central χ2 random variable with tests.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html index dbe2b81ed..3bbae13f2 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html @@ -110,7 +110,7 @@

    - + Member Functions
    @@ -183,7 +183,7 @@ == q.

    - + Non-member Accessors
    @@ -203,7 +203,7 @@ The domain of the random variable is [0, +∞].

    - + Examples

    @@ -211,7 +211,7 @@ example for the noncentral chi-squared distribution.

    - + Accuracy

    @@ -223,7 +223,7 @@ zero error.

    -

    Table 13. Errors In CDF of the Noncentral Chi-Squared

    +

    Table 14. Errors In CDF of the Noncentral Chi-Squared

    @@ -359,7 +359,7 @@ produce an accuracy greater than the square root of the machine epsilon.

    - + Tests

    @@ -373,7 +373,7 @@ to at least 50 decimal digits - and is the used for our accuracy tests.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_f_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_f_dist.html index c125a1620..9ac44f953 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_f_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_f_dist.html @@ -95,7 +95,7 @@ random variable with v1

    - + Member Functions
    @@ -127,7 +127,7 @@ random variable with v1 which this object was constructed.

    - + Non-member Accessors
    @@ -147,7 +147,7 @@ random variable with v1 The domain of the random variable is [0, +∞].

    - + Accuracy

    @@ -155,7 +155,7 @@ random variable with v1 Beta Distribution: refer to that distribution for accuracy data.

    - + Tests

    @@ -164,7 +164,7 @@ random variable with v1 Math library statistical package and its pbeta and dbeta functions.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_t_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_t_dist.html index d0f562bf4..7851bebe3 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_t_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_t_dist.html @@ -85,7 +85,7 @@

    - + Member Functions
    @@ -111,7 +111,7 @@ which this object was constructed.

    - + Non-member Accessors
    @@ -131,7 +131,7 @@ The domain of the random variable is [-∞, +∞].

    - + Accuracy

    @@ -141,7 +141,7 @@ one shown will have effectively zero error.

    -

    Table 14. Errors In CDF of the Noncentral T Distribution

    +

    Table 15. Errors In CDF of the Noncentral T Distribution

    @@ -255,7 +255,7 @@ epsilon.

    - + Tests

    @@ -270,7 +270,7 @@ least 50 decimal places.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html index 21d5370e6..310658c84 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html @@ -123,7 +123,7 @@

    - + Related Distributions
    @@ -200,12 +200,12 @@

    - + Member Functions
    - + Construct
    negative_binomial_distribution(RealType r, RealType p);
    @@ -221,7 +221,7 @@
                 <= 1.
               

    - + Accessors
    RealType success_fraction() const; // successes / trials (0 <= p <= 1)
    @@ -237,7 +237,7 @@
                 was constructed.
               

    - + Lower Bound on Parameter p
    @@ -298,7 +298,7 @@ vol. 48, no3, 605-621.

    - + Upper Bound on Parameter p
    @@ -358,7 +358,7 @@ vol. 48, no3, 605-621.

    - + Estimating Number of Trials to Ensure at Least a Certain Number of Failures
    @@ -409,7 +409,7 @@ probability of observing k failures or fewer.

    - + Estimating Number of Trials to Ensure a Maximum Number of Failures or Less
    @@ -457,7 +457,7 @@ probability of observing more than k failures.

    - + Non-member Accessors
    @@ -478,7 +478,7 @@ in the context of this distribution:

    -

    Table 11. Meaning of the non-member accessors.

    +

    Table 12. Meaning of the non-member accessors.

    @@ -603,7 +603,7 @@

    - + Accuracy

    @@ -613,7 +613,7 @@ please refer to these functions for information on accuracy.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/normal_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/normal_dist.html index 1f50a1f1a..5463c53b2 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/normal_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/normal_dist.html @@ -79,7 +79,7 @@

    - + Member Functions
    @@ -109,7 +109,7 @@ be used generically).

    - + Non-member Accessors
    @@ -131,7 +131,7 @@ and complement cdf -∞ = 1 and +∞ = 0, if RealType permits.

    - + Accuracy

    @@ -139,7 +139,7 @@ function, and as such should have very low error rates.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/pareto.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/pareto.html index 787196fd0..343f8c8dc 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/pareto.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/pareto.html @@ -86,12 +86,12 @@

    - + Related distributions
    - + Member Functions
    @@ -117,7 +117,7 @@ Returns the shape parameter of this distribution.

    - + Non-member Accessors
    @@ -137,7 +137,7 @@ The supported domain of the random variable is [location, ∞].

    - + Accuracy

    @@ -147,7 +147,7 @@ to unity.

    - + Implementation

    @@ -315,7 +315,7 @@

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/poisson_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/poisson_dist.html index 892d9e332..df37f784b 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/poisson_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/poisson_dist.html @@ -122,7 +122,7 @@

    - + Member Functions
    @@ -137,7 +137,7 @@ Returns the mean of this distribution.

    - + Non-member Accessors
    @@ -157,7 +157,7 @@ The domain of the random variable is [0, ∞].

    - + Accuracy

    @@ -171,7 +171,7 @@ using an iterative method with a lower tolerance to avoid excessive computation.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/rayleigh.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/rayleigh.html index def0439ed..3f111cce8 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/rayleigh.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/rayleigh.html @@ -86,7 +86,7 @@

    - + Related distributions
    @@ -102,7 +102,7 @@ distribution.

    - + Member Functions
    @@ -121,7 +121,7 @@ Returns the sigma parameter of this distribution.

    - + Non-member Accessors
    @@ -141,7 +141,7 @@ The domain of the random variable is [0, max_value].

    - + Accuracy

    @@ -151,7 +151,7 @@ using NTL RR type with 150-bit accuracy, about 50 decimal digits.

    - + Implementation

    @@ -320,7 +320,7 @@

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/students_t_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/students_t_dist.html index a59493f1a..d1977f95d 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/students_t_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/students_t_dist.html @@ -97,7 +97,7 @@

    - + Member Functions
    @@ -174,7 +174,7 @@ Engineering Statistics Handbook.

    - + Non-member Accessors
    @@ -194,7 +194,7 @@ The domain of the random variable is [-∞, +∞].

    - + Examples

    @@ -202,7 +202,7 @@ are available illustrating the use of the Student's t distribution.

    - + Accuracy

    @@ -211,7 +211,7 @@ inverses, refer to accuracy data on those functions for more information.

    - + Implementation

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/triangular_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/triangular_dist.html index 65d3e51f3..9dee5c2b4 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/triangular_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/triangular_dist.html @@ -128,7 +128,7 @@

    - + Member Functions
    @@ -163,7 +163,7 @@ (default+1).

    - + Non-member Accessors
    @@ -184,7 +184,7 @@ range is lower <= x <= upper.

    - + Accuracy

    @@ -193,7 +193,7 @@ with arguments nearing the extremes of zero and unity.

    - + Implementation

    @@ -378,7 +378,7 @@ Calculate and plot probability distributions

    - + References
      diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/uniform_dist.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/uniform_dist.html index dd89ced07..cb5598b88 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/uniform_dist.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/uniform_dist.html @@ -117,7 +117,7 @@

      - + Member Functions
      @@ -144,7 +144,7 @@ Returns the upper parameter of this distribution.

      - + Non-member Accessors
      @@ -165,7 +165,7 @@ range is only lower <= x <= upper.

      - + Accuracy

      @@ -173,7 +173,7 @@ and so should have errors within an epsilon or two.

      - + Implementation

      @@ -337,7 +337,7 @@

    - + References
      diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/weibull.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/weibull.html index 7a887e374..ffb6f9678 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/weibull.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/weibull.html @@ -100,7 +100,7 @@

      - + Related distributions
      @@ -114,7 +114,7 @@ Distributions, Theory and Applications Samuel Kotz & Saralees Nadarajah.

      - + Member Functions
      @@ -140,7 +140,7 @@ Returns the scale parameter of this distribution.

      - + Non-member Accessors
      @@ -160,7 +160,7 @@ The domain of the random variable is [0, ∞].

      - + Accuracy

      @@ -170,7 +170,7 @@ as such should have very low error rates.

      - + Implementation

      @@ -337,7 +337,7 @@

    - + References
      diff --git a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/nmp.html b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/nmp.html index a413affa7..4f2ba972c 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/nmp.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/nmp.html @@ -37,7 +37,7 @@ the function you want if you already know its name.

      - + Function Index
      @@ -93,7 +93,7 @@
    - + Conceptual Index
    @@ -174,7 +174,7 @@
- + Cumulative Distribution Function
@@ -198,7 +198,7 @@ cdf

- + Complement of the Cumulative Distribution Function
@@ -239,7 +239,7 @@ complement is useful and when it should be used.

- + Hazard Function
template <class RealType, class Policy>
@@ -267,7 +267,7 @@
           

- + Cumulative Hazard Function
@@ -295,7 +295,7 @@

- + mean
template<class RealType, class Policy>
@@ -310,7 +310,7 @@
           distribution).
         

- + median
template<class RealType, class Policy>
@@ -320,7 +320,7 @@
           Returns the median of the distribution dist.
         

- + mode
template<class RealType, Policy>
@@ -334,7 +334,7 @@
           if the distribution does not have a defined mode.
         

- + Probability Density Function
@@ -363,7 +363,7 @@ pdf

- + range
template<class RealType, class Policy>
@@ -373,7 +373,7 @@
           Returns the valid range of the random variable over distribution dist.
         

- + Quantile
template <class RealType, class Policy>
@@ -402,7 +402,7 @@
           quantile
         

- + Quantile from the complement of the probability.
@@ -448,7 +448,7 @@ survival_inv

- + Standard Deviation
@@ -463,7 +463,7 @@ if the distribution does not have a defined standard deviation.

- + support
template<class RealType, class Policy>
@@ -480,7 +480,7 @@
           where the pdf is zero, and the cdf zero or unity.
         

- + Variance
template <class RealType, class Policy>
@@ -494,7 +494,7 @@
           if the distribution does not have a defined variance.
         

- + Skewness
template <class RealType, class Policy>
@@ -508,7 +508,7 @@
           if the distribution does not have a defined skewness.
         

- + Kurtosis
template <class RealType, class Policy>
@@ -550,7 +550,7 @@
           'Proper' kurtosis can have a value from zero to + infinity.
         

- + Kurtosis excess
@@ -585,7 +585,7 @@ The kurtosis excess of a normal distribution is zero.

- + P and Q

@@ -595,7 +595,7 @@ returned by these functions.

- + Percent Point Function
@@ -604,7 +604,7 @@ the Quantile.

- + Inverse CDF Function.
@@ -613,7 +613,7 @@ Quantile.

- + Inverse Survival Function.
@@ -621,7 +621,7 @@ The inverse of the survival function, is the same as computing the quantile from the complement of the probability.

- + Probability Mass Function
@@ -635,7 +635,7 @@ applies to continuous distributions.

- + Lower Critical Value.
@@ -645,7 +645,7 @@ the Quantile.

- + Upper Critical Value.
@@ -656,7 +656,7 @@ complement of the probability.

- + Survival Function
diff --git a/doc/sf_and_dist/html/math_toolkit/dist/future.html b/doc/sf_and_dist/html/math_toolkit/dist/future.html index 5b003cf54..b44ee4c15 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/future.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/future.html @@ -27,7 +27,7 @@ Extras/Future Directions
- + Adding Additional Location and Scale Parameters
@@ -55,7 +55,7 @@ functions.

- + An "any_distribution" class
@@ -84,7 +84,7 @@ use case: this needs more investigation.

- + Higher Level Hypothesis Tests
@@ -104,7 +104,7 @@ expected_mean.

- + Integration With Statistical Accumulators
diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview.html index 15c54482d..8deabf8ec 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview.html @@ -27,7 +27,7 @@ Overview
- + Headers and Namespaces
@@ -44,7 +44,7 @@ or <boost/math/distributions.hpp>

- + Distributions are Objects
@@ -131,7 +131,7 @@ and quantiles etc for these distributions.

- + Generic operations common to all distributions are non-member functions
@@ -326,7 +326,7 @@

- + Complements are supported too
@@ -461,7 +461,7 @@
- + Parameters can be calculated
@@ -492,7 +492,7 @@ sample size.

- + Summary
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html index 747dbf89a..7bca5c03e 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html @@ -497,7 +497,7 @@ Probability of getting between 4 and 4 answers right by guessing is 0.2252

    - + Using Binomial distribution moments
    @@ -534,7 +534,7 @@ Skewness is 0.2887

    - + Quantiles

    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/cs_eg/chi_sq_intervals.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/cs_eg/chi_sq_intervals.html index fab587033..b492480e5 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/cs_eg/chi_sq_intervals.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/cs_eg/chi_sq_intervals.html @@ -139,7 +139,7 @@ _____________________________________________ is between 0.00551 and 0.00729.

    - + Confidence intervals as a function of the number of observations
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html index 72ca97d6e..68599c3c6 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html @@ -332,7 +332,7 @@ error C3861: 'mybetad0': identifier not found

    - + Default arguments to distribution constructors.
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html index 87815edb5..b0796867a 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html @@ -175,7 +175,7 @@ Normal distribution with mean = 1.09023 has fraction > -2, p = 0.999

    - + Controlling Error Handling from find_location
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html index 19d62291c..6a67f39b8 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html @@ -62,7 +62,7 @@

    - + Using find_location and find_scale to meet dispensing and measurement specifications
    @@ -246,7 +246,7 @@

    - + Using Cauchy-Lorentz instead of normal distribution
    @@ -397,7 +397,7 @@

    - + Changing the scale or standard deviation
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html index 4748498d5..9d076ba3f 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html @@ -179,7 +179,7 @@ Normal distribution with mean = 0 has fraction > -2, p = 0.999

    - + Controlling how Errors from find_scale are handled
    diff --git a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html index 237a86114..294d786a7 100644 --- a/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html +++ b/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html @@ -32,7 +32,7 @@ illustrates their use.

    - + Traditional Tables
    @@ -278,7 +278,7 @@

    - + Standard deviations either side of the Mean
    @@ -346,12 +346,12 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740

    - + Some simple examples
    - + Life of light bulbs
    @@ -435,7 +435,7 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740

    - + How many onions?
    @@ -494,7 +494,7 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740

    - + Packing beef
    @@ -703,7 +703,7 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740

    - + Length of bolts
    diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/compilers_overview.html b/doc/sf_and_dist/html/math_toolkit/main_overview/compilers_overview.html index de6fa460b..9578753a8 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/compilers_overview.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/compilers_overview.html @@ -37,7 +37,7 @@

    -

    Table 8. Supported/Tested Compilers

    +

    Table 9. Supported/Tested Compilers

    @@ -540,7 +540,7 @@


    -

    Table 9. Unsupported Compilers

    +

    Table 10. Unsupported Compilers

    diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/directories.html b/doc/sf_and_dist/html/math_toolkit/main_overview/directories.html index 9618d0b57..28483d704 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/directories.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/directories.html @@ -28,7 +28,7 @@ File Structure
    - + boost/math
    @@ -73,7 +73,7 @@
    - + boost/libs
    diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/error_handling.html b/doc/sf_and_dist/html/math_toolkit/main_overview/error_handling.html index a83d031ce..4e74afa44 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/error_handling.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/error_handling.html @@ -27,7 +27,7 @@ Error Handling
    - + Quick Reference
    @@ -89,6 +89,11 @@ being evaluated: this should never occur, but if it does, then it's likely to be due to an iterative method not converging fast enough.

    +
    Indeterminate Result Error
    +

    + Occurs when the result of a function is not defined for the values that + were passed to it. +

    @@ -129,7 +134,7 @@ the default action for each error shown in bold:

    -

    Table 1. Possible Actions for Domain Errors

    +

    Table 1. Possible Actions for Domain Errors

    @@ -204,7 +209,7 @@

    -

    Table 2. Possible Actions for Pole Errors

    +

    Table 2. Possible Actions for Pole Errors

    @@ -279,7 +284,7 @@

    -

    Table 3. Possible Actions for Overflow Errors

    +

    Table 3. Possible Actions for Overflow Errors

    @@ -354,7 +359,7 @@

    -

    Table 4. Possible Actions for Underflow Errors

    +

    Table 4. Possible Actions for Underflow Errors

    @@ -429,7 +434,7 @@

    -

    Table 5. Possible Actions for Denorm Errors

    +

    Table 5. Possible Actions for Denorm Errors

    @@ -504,7 +509,7 @@

    -

    Table 6. Possible Actions for Rounding Errors

    +

    Table 6. Possible Actions for Rounding Errors

    @@ -579,7 +584,7 @@

    -

    Table 7. Possible Actions for Internal Evaluation +

    Table 7. Possible Actions for Internal Evaluation Errors

    @@ -622,7 +627,7 @@

    Sets ::errno to EDOM and returns - std::numeric_limits<T>::infinity(). + the closest approximation found.

    @@ -634,7 +639,7 @@ @@ -655,8 +660,86 @@

    - Returns std::numeric_limits<T>::infinity(). + Returns the closest approximation found.

    +
    +

    Table 8. Possible Actions for Indeterminate Result + Errors

    +
    ++++ + + + + + + + + + + + + + + + + + + + + + + +
    +

    + Action +

    +
    +

    + Behaviour +

    +
    +

    + throw_on_error +

    +
    +

    + Throws std::domain_error +

    +
    +

    + errno_on_error +

    +
    +

    + Sets ::errno + to EDOM and returns + the same value as ignore_error. +

    +
    +

    + ignore_error +

    +
    +

    + Returns a default result that depends on the + function where the error occurred. +

    +
    +

    + user_error +

    +
    +

    + Returns the result of boost::math::policies::user_indeterminate_result_error: + this + function must be defined by the user. +

    +
    +

    - + Rationale

    @@ -675,7 +758,7 @@

- + Finding More Information
@@ -697,7 +780,7 @@ The various kind of errors are described in more detail below.

- + Domain Errors
@@ -790,7 +873,7 @@ for more details.

- + Evaluation at a pole
@@ -829,7 +912,7 @@ for more details.

- + Numeric Overflow
@@ -854,7 +937,7 @@ doesn't support infinities, the maximum value for the type is returned.

- + Numeric Underflow
@@ -877,7 +960,7 @@ an std::underflow_error C++ exception.

- + Denormalisation Errors
@@ -900,7 +983,7 @@ throws an std::underflow_error C++ exception.

- + Evaluation Errors
@@ -936,8 +1019,35 @@ Boost.Format documentation for more details.

+
+ + Indeterminate + Result Errors +
+

+ When the result of a special function is indeterminate for the value that + was passed to it, then the function returns the result of: +

+
boost::math::policies::raise_overflow_error<T>(FunctionName, Message, Val, Default, Policy);
+
+

+ Where T is the floating-point + type passed to the function, FunctionName + is the name of the function, Message + is an error message describing the problem, Val is the value for which the + result is indeterminate, Default is an alternative default result that must + be returned for ignore_error and errno_on_error policies, and Policy + is the current policy in use for the function that was called. +

+

+ The default policy for this function is ignore_error: + note that this error type is reserved for situations where the result is + mathematically undefined or indeterminate, but there is none the less a convention + for what the result should be: for example the C99 standard specifies that + the result of 00 is 1, even though the result is actually mathematically indeterminate. +

- + Rounding Errors
@@ -976,7 +1086,7 @@ for more details.

- + Errors from typecasts
diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html b/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html index cb1f1c55f..9a1e30972 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html @@ -31,57 +31,42 @@

- + Boost-1.36.0

- + Boost-1.35.0: Post Review First Official Release
@@ -118,7 +103,7 @@

- + Milestone 4: Second Review Candidate (1st March 2007)
@@ -137,7 +122,7 @@

- + Milestone 3: First Review Candidate (31st Dec 2006)
@@ -170,7 +155,7 @@

- + Milestone 2: Released September 10th 2006
@@ -211,7 +196,7 @@

- + Milestone 1: Released March 31st 2006
@@ -246,7 +231,7 @@

- Sandbox and trunk last synchonised at revision: 45483. + Sandbox and trunk last synchonised at revision: 45484.

diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/intro.html b/doc/sf_and_dist/html/math_toolkit/main_overview/intro.html index d2a463af4..3f8884516 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/intro.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/intro.html @@ -30,7 +30,7 @@ This library is divided into three interconnected parts:

- + Statistical Distributions
@@ -56,7 +56,7 @@ tests.

- + Mathematical Special Functions
@@ -83,7 +83,7 @@ double.

- + Implementation Toolkit
diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/navigation.html b/doc/sf_and_dist/html/math_toolkit/main_overview/navigation.html index f382bb831..f4e7b8b5f 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/navigation.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/navigation.html @@ -31,7 +31,7 @@ as handy shortcuts for common navigation tasks.

- + Shortcuts
diff --git a/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html b/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html index 96fa8947b..eb6fc36d0 100644 --- a/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html +++ b/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html @@ -284,7 +284,7 @@

- + Usage Recomendations
@@ -336,7 +336,7 @@

- + Supported C99 Functions
@@ -440,7 +440,7 @@

- + Supported TR1 Functions
@@ -579,7 +579,7 @@

- + Currently Unsupported C99 Functions
@@ -650,7 +650,7 @@

- + Currently Unsupported TR1 Functions
diff --git a/doc/sf_and_dist/html/math_toolkit/perf/comp_compilers.html b/doc/sf_and_dist/html/math_toolkit/perf/comp_compilers.html index 5e52fbe17..22f49754d 100644 --- a/doc/sf_and_dist/html/math_toolkit/perf/comp_compilers.html +++ b/doc/sf_and_dist/html/math_toolkit/perf/comp_compilers.html @@ -35,7 +35,7 @@ in this respect).

-

Table 47. Performance Comparison of Various Windows Compilers

+

Table 48. Performance Comparison of Various Windows Compilers

diff --git a/doc/sf_and_dist/html/math_toolkit/perf/comparisons.html b/doc/sf_and_dist/html/math_toolkit/perf/comparisons.html index b60ab4bb8..30a2442e2 100644 --- a/doc/sf_and_dist/html/math_toolkit/perf/comparisons.html +++ b/doc/sf_and_dist/html/math_toolkit/perf/comparisons.html @@ -46,7 +46,7 @@

- + Comparison to GSL-1.9 and Cephes
@@ -213,7 +213,7 @@

+INF - [1] + [1]

@@ -284,13 +284,13 @@ -

[1] +

[1] Cephes gets stuck in an infinite loop while trying to execute our test cases.

- + Comparison to the R Statistical Library on Windows
@@ -301,7 +301,7 @@ appears not to be buildable with Visual C++).

-

Table 50. A Comparison to the R Statistical Library on Windows +

Table 51. A Comparison to the R Statistical Library on Windows XP

@@ -374,7 +374,7 @@

74.66 - [1] + [1]

(4.905e-004s)

@@ -792,7 +792,7 @@

53.59 - [2] + [2]

(5.145e-004s)

@@ -1010,12 +1010,12 @@
-

[1] +

[1] There are a small number of our test cases where the R library fails to converge on a result: these tend to dominate the performance result.

-

[2] +

[2] The R library appears to use a linear-search strategy, that can perform very badly in a small number of pathological cases, but may or may not be more efficient in "typical" cases @@ -1024,7 +1024,7 @@


- + Comparison to the R Statistical Library on Linux
@@ -1033,7 +1033,7 @@ Linux machine, with the test program and R-2.5.0 compiled with GNU G++ 4.2.0.

-

Table 51. A Comparison to the R Statistical Library on Linux

+

Table 52. A Comparison to the R Statistical Library on Linux

@@ -1104,7 +1104,7 @@

44.06 - [1] + [1]

(5.701e-004s)

@@ -1522,7 +1522,7 @@

30.07 - [2] + [2]

(5.490e-004s)

@@ -1740,12 +1740,12 @@ + + + +
-

[1] +

[1] There are a small number of our test cases where the R library fails to converge on a result: these tend to dominate the performance result.

-

[2] +

[2] The R library appears to use a linear-search strategy, that can perform very badly in a small number of pathological cases, but may or may not be more efficient in "typical" cases diff --git a/doc/sf_and_dist/html/math_toolkit/perf/getting_best.html b/doc/sf_and_dist/html/math_toolkit/perf/getting_best.html index 592fda151..3b3f94f3b 100644 --- a/doc/sf_and_dist/html/math_toolkit/perf/getting_best.html +++ b/doc/sf_and_dist/html/math_toolkit/perf/getting_best.html @@ -33,7 +33,7 @@ penalty for using the library in debug mode can be quite large.

-

Table 46. Performance Comparison of Release and Debug Settings

+

Table 47. Performance Comparison of Release and Debug Settings

diff --git a/doc/sf_and_dist/html/math_toolkit/perf/tuning.html b/doc/sf_and_dist/html/math_toolkit/perf/tuning.html index 558591a6b..8300e4215 100644 --- a/doc/sf_and_dist/html/math_toolkit/perf/tuning.html +++ b/doc/sf_and_dist/html/math_toolkit/perf/tuning.html @@ -234,7 +234,7 @@ highly vectorisable processors in the future.

-

Table 48. A Comparison of Polynomial Evaluation Methods

+

Table 49. A Comparison of Polynomial Evaluation Methods

@@ -634,7 +634,7 @@ tutorial.

-

Table 49. Performance Comparison with and Without Internal +

Table 50. Performance Comparison with and Without Internal Promotion to long double

diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html index 90f36e1aa..fa6780d9d 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html @@ -55,7 +55,7 @@ can take have the following meanings:

- + real

@@ -93,7 +93,7 @@ = 68.1584.

- + integer_round_outwards

@@ -151,7 +151,7 @@ in each tail.

- + integer_round_inwards

@@ -214,7 +214,7 @@ in each tail.

- + integer_round_down

@@ -222,7 +222,7 @@ or a lower quantile.

- + integer_round_up

@@ -230,7 +230,7 @@ a lower quantile.

- + integer_round_nearest

diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html index cc1c7a54b..9d2e98d81 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html @@ -39,7 +39,7 @@

- + Available Actions When an Error is Raised
@@ -62,7 +62,7 @@ The various enumerated values have the following meanings:

- + throw_on_error

@@ -159,10 +159,22 @@

+
+ + +
+

+ Indeterminate Result Error +

+
+

+ std::domain_error +

+
- + errno_on_error

@@ -260,14 +272,26 @@

+

+ Indeterminate Result Error +

+
+

+ EDOM +

+
- + ignore_error

- Will return a one of the values below depending on the error type (::errno + Will return one of the values below depending on the error type (::errno is NOT changed)::

@@ -361,10 +385,22 @@

+ + + +
+

+ Indeterminate Result Error +

+
+

+ Depends on the function where the error occurred +

+
- + user_error

@@ -394,6 +430,9 @@ template <class T> T user_evaluation_error(const char* function, const char* message, const T& val); +template <class T> +T user_indeterminate_result_error(const char* function, const char* message, const T& val); + }}} // namespaces

@@ -410,12 +449,12 @@ here.

- + Kinds of Error Raised

- There are five kinds of error reported by this library, which are summarised + There are six kinds of error reported by this library, which are summarised in the following table:

@@ -621,10 +660,35 @@

+ + + + +
+

+ Indeterminate Result Error +

+
+

+ boost::math::policies::indeterminate_result_error<action> +

+
+

+ Raised when the result of a function is not defined for the values + that were passed to it. +

+

+ Defaults to boost::math::policies::indeterminate_result_error<ignore_error> +

+

+ When the action is throw_on_error then throws + std::domain_error +

+
- + Examples

diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html index 219f783f3..31731b2b1 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html @@ -84,7 +84,7 @@

- + Examples

diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/pol_ref_ref.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/pol_ref_ref.html index 732fc74aa..fe5c273de 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/pol_ref_ref.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/pol_ref_ref.html @@ -51,7 +51,9 @@ class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct policy { public: @@ -62,6 +64,7 @@ typedef computed-from-template-arguments denorm_error_type; typedef computed-from-template-arguments rounding_error_type; typedef computed-from-template-arguments evaluation_error_type; + typedef computed-from-template-arguments indeterminate_result_error_type; typedef computed-from-template-arguments precision_type; typedef computed-from-template-arguments promote_float_type; typedef computed-from-template-arguments promote_double_type; @@ -83,7 +86,9 @@ class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct normalise { typedef computed-from-template-arguments type; @@ -150,6 +155,15 @@ one of the error_policy_type enumerated values.

+
policy<...>::indeterminate_error_type
+
+

+ Specifies how indeterminate result errors are handled, will be an instance + of boost::math::policies::indeterminate_result_error<> + with the template argument to indeterminate_result_error + one of the error_policy_type + enumerated values. +

policy<...>::precision_type
 

@@ -204,7 +218,9 @@ class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct normalise { typedef computed-from-template-arguments type; diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/policy_defaults.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/policy_defaults.html index 65713113b..f37fd1d78 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/policy_defaults.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/policy_defaults.html @@ -61,7 +61,7 @@ then you can do so by defining various macros in boost/math/tools/user.hpp.

- + BOOST_MATH_DOMAIN_ERROR_POLICY

@@ -71,7 +71,7 @@ ignore_error or user_error.

- + BOOST_MATH_POLE_ERROR_POLICY

@@ -81,7 +81,7 @@ ignore_error or user_error.

- + BOOST_MATH_OVERFLOW_ERROR_POLICY

@@ -91,7 +91,7 @@ ignore_error or user_error.

- + BOOST_MATH_ROUNDING_ERROR_POLICY

@@ -101,7 +101,7 @@ ignore_error or user_error.

- + BOOST_MATH_EVALUATION_ERROR_POLICY

@@ -111,7 +111,7 @@ ignore_error or user_error.

- + BOOST_MATH_UNDERFLOW_ERROR_POLICY

@@ -121,7 +121,7 @@ ignore_error or user_error.

- + BOOST_MATH_DENORM_ERROR_POLICY

@@ -130,8 +130,19 @@ but can be set to any of the enumerated actions for error handing: throw_on_error, errno_on_error, ignore_error or user_error.

+
+ + BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY +
+

+ Defines what happens when the result is indeterminate, but where there + is none the less a convention for the result. If not defined then defaults + to ignore_error, but can + be set to any of the enumerated actions for error handing: throw_on_error, errno_on_error, + ignore_error or user_error. +

- + BOOST_MATH_DIGITS10_POLICY

@@ -142,7 +153,7 @@ recommended that you change this from the default.

- + BOOST_MATH_PROMOTE_FLOAT_POLICY

@@ -154,7 +165,7 @@ off.

- + BOOST_MATH_PROMOTE_DOUBLE_POLICY

@@ -166,7 +177,7 @@ off.

- + BOOST_MATH_DISCRETE_QUANTILE_POLICY

@@ -177,7 +188,7 @@ Defaults to integer_round_outwards.

- + BOOST_MATH_ASSERT_UNDEFINED_POLICY

@@ -190,7 +201,7 @@ whether or not a particular property is well defined.

- + BOOST_MATH_MAX_SERIES_ITERATION_POLICY

@@ -199,7 +210,7 @@ Defaults to 1000000.

- + BOOST_MATH_MAX_ROOT_ITERATION_POLICY

@@ -208,7 +219,7 @@ Defaults to 200.

- + Example

diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/policy_tut_defaults.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/policy_tut_defaults.html index da1737f6b..6c59d16f7 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/policy_tut_defaults.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/policy_tut_defaults.html @@ -63,6 +63,10 @@

Throws a boost::math::evaluation_error exception.

+
Indeterminate Result Error
+

+ Returns a result that depends on the function where the error occurred. +

Promotion of float to double

Does occur by default - gives full float precision results. diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html index 529e2ebc7..99284af5f 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html @@ -177,7 +177,7 @@ base your comparisons on CDF's instead.

- + Other Rounding Policies are Available
diff --git a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html index 3c5635052..cc7db6207 100644 --- a/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html +++ b/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html @@ -54,6 +54,8 @@ T user_denorm_error(const char* function, const char* message, const T& val); template <class T> T user_evaluation_error(const char* function, const char* message, const T& val); +template <class T> +T user_indeterminate_result_error(const char* function, const char* message, const T& val); }}} // namespaces
diff --git a/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel.html b/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel.html index 0be874d02..84b589685 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel.html +++ b/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel.html @@ -28,7 +28,7 @@ of the First and Second Kinds
- + Synopsis
template <class T1, class T2>
@@ -44,7 +44,7 @@
 calculated-result-type cyl_neumann(T1 v, T2 x, const Policy&);
 
- + Description

@@ -110,7 +110,7 @@

- + Testing

@@ -119,7 +119,7 @@ (with all the special case handling removed).

- + Accuracy

@@ -135,7 +135,7 @@ zero error. All values are relative errors in units of epsilon.

-

Table 35. Errors Rates in cyl_bessel_j

+

Table 36. Errors Rates in cyl_bessel_j

@@ -304,7 +304,7 @@

-

Table 36. Errors Rates in cyl_neumann

+

Table 37. Errors Rates in cyl_neumann

@@ -494,7 +494,7 @@ were found.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html b/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html index 5d1c079e4..cbf8f762a 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html +++ b/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html @@ -28,7 +28,7 @@ Overview

- + Ordinary Bessel Functions
@@ -103,7 +103,7 @@ and is known as either a Bessel

- + Modified Bessel Functions
@@ -167,7 +167,7 @@ respectively:

- + Spherical Bessel Functions
diff --git a/doc/sf_and_dist/html/math_toolkit/special/bessel/mbessel.html b/doc/sf_and_dist/html/math_toolkit/special/bessel/mbessel.html index 916cd64ec..3f5dfda94 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/bessel/mbessel.html +++ b/doc/sf_and_dist/html/math_toolkit/special/bessel/mbessel.html @@ -28,7 +28,7 @@ Functions of the First and Second Kinds
- + Synopsis
template <class T1, class T2>
@@ -44,7 +44,7 @@
 calculated-result-type cyl_bessel_k(T1 v, T2 x, const Policy&);
 
- + Description

@@ -109,7 +109,7 @@

- + Testing

@@ -118,7 +118,7 @@ (with all the special case handling removed).

- + Accuracy

@@ -129,7 +129,7 @@ zero error. All values are relative errors in units of epsilon.

-

Table 37. Errors Rates in cyl_bessel_i

+

Table 38. Errors Rates in cyl_bessel_i

@@ -226,7 +226,7 @@

-

Table 38. Errors Rates in cyl_bessel_k

+

Table 39. Errors Rates in cyl_bessel_k

@@ -326,7 +326,7 @@

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/bessel/sph_bessel.html b/doc/sf_and_dist/html/math_toolkit/special/bessel/sph_bessel.html index 5d2027313..cc61df202 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/bessel/sph_bessel.html +++ b/doc/sf_and_dist/html/math_toolkit/special/bessel/sph_bessel.html @@ -28,7 +28,7 @@ Bessel Functions of the First and Second Kinds

- + Synopsis
template <class T1, class T2>
@@ -44,7 +44,7 @@
 calculated-result-type sph_neumann(unsigned v, T2 x, const Policy&);
 
- + Description

@@ -97,7 +97,7 @@ for small x:

- + Testing

@@ -106,7 +106,7 @@ for small x: implementation (with all the special case handling removed).

- + Accuracy

@@ -116,7 +116,7 @@ for small x: refer to these functions for accuracy data.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_1.html b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_1.html index d99c116f1..f685ac200 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_1.html +++ b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_1.html @@ -28,7 +28,7 @@ of the First Kind - Legendre Form

- + Synopsis

@@ -55,7 +55,7 @@ }} // namespaces

- + Description

@@ -123,7 +123,7 @@

- + Accuracy

@@ -134,7 +134,7 @@ All values are relative errors in units of epsilon.

-

Table 40. Errors Rates in the Elliptic Integrals of the +

Table 41. Errors Rates in the Elliptic Integrals of the First Kind

@@ -237,7 +237,7 @@

- + Testing

@@ -247,7 +247,7 @@ this implementation.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_2.html b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_2.html index 48857cf5e..bfc46099c 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_2.html +++ b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_2.html @@ -28,7 +28,7 @@ of the Second Kind - Legendre Form

- + Synopsis

@@ -55,7 +55,7 @@ }} // namespaces

- + Description

@@ -123,7 +123,7 @@

- + Accuracy

@@ -134,7 +134,7 @@ All values are relative errors in units of epsilon.

-

Table 41. Errors Rates in the Elliptic Integrals of the +

Table 42. Errors Rates in the Elliptic Integrals of the Second Kind

@@ -237,7 +237,7 @@

- + Testing

@@ -247,7 +247,7 @@ this implementation.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_3.html b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_3.html index 6812f0466..cca8550a3 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_3.html +++ b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_3.html @@ -28,7 +28,7 @@ of the Third Kind - Legendre Form

- + Synopsis

@@ -55,7 +55,7 @@ }} // namespaces

- + Description

@@ -135,7 +135,7 @@ [opitonal_policy]

- + Accuracy

@@ -146,7 +146,7 @@ All values are relative errors in units of epsilon.

-

Table 42. Errors Rates in the Elliptic Integrals of the +

Table 43. Errors Rates in the Elliptic Integrals of the Third Kind

@@ -249,7 +249,7 @@

- + Testing

@@ -259,7 +259,7 @@ this implementation.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_carlson.html b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_carlson.html index 01cbb66cb..243003519 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_carlson.html +++ b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_carlson.html @@ -28,7 +28,7 @@ Integrals - Carlson Form

- + Synopsis

@@ -100,7 +100,7 @@ }} // namespaces

- + Description

@@ -236,7 +236,7 @@

- + Testing

@@ -265,7 +265,7 @@ to verify their correctness: see the above Carlson paper for details.

- + Accuracy

@@ -276,7 +276,7 @@ All values are relative errors in units of epsilon.

-

Table 39. Errors Rates in the Carlson Elliptic Integrals

+

Table 40. Errors Rates in the Carlson Elliptic Integrals

@@ -419,7 +419,7 @@

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_intro.html b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_intro.html index 64c7515c5..615673db0 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_intro.html +++ b/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_intro.html @@ -61,14 +61,14 @@ Elliptic integral.

- + Notation

All variables are real numbers unless otherwise noted.

- + Definition

@@ -257,7 +257,7 @@

- + Duplication Theorem
@@ -269,7 +269,7 @@

- + Carlson's Formulas
@@ -287,7 +287,7 @@

- + Numerical Algorithms
@@ -301,7 +301,7 @@ integrals with satisfactory precisions.

- + References

diff --git a/doc/sf_and_dist/html/math_toolkit/special/expint/expint_i.html b/doc/sf_and_dist/html/math_toolkit/special/expint/expint_i.html index e531237f8..2c1026595 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/expint/expint_i.html +++ b/doc/sf_and_dist/html/math_toolkit/special/expint/expint_i.html @@ -28,7 +28,7 @@ Integral Ei

- + Synopsis

@@ -63,7 +63,7 @@

- + Description
template <class T>
@@ -83,7 +83,7 @@
           
         

- + Accuracy

@@ -95,7 +95,7 @@ error.

-

Table 45. Errors In the Function expint(z)

+

Table 46. Errors In the Function expint(z)

@@ -207,7 +207,7 @@ slightly over the range [4,6].

- + Testing

@@ -222,7 +222,7 @@ check.

- + Implementation

@@ -253,7 +253,7 @@ [-1,1]. Note that while the rational approximation over [0,6] converges rapidly to the minimax solution it is rather ill-conditioned in practice. Cody and Thacher - [1] + [1] experienced the same issue and converted the polynomials into Chebeshev form to ensure stable computation. By experiment we found that the polynomials are just as stable in polynomial as Chebyshev form, provided @@ -284,7 +284,7 @@



-

[1] +

[1] W. J. Cody and H. C. Thacher, Jr., Rational Chebyshev approximations for the exponential integral E1(x), Math. Comp. 22 (1968), 641-649, and W. J. Cody and H. C. Thacher, Jr., Chebyshev approximations for diff --git a/doc/sf_and_dist/html/math_toolkit/special/expint/expint_n.html b/doc/sf_and_dist/html/math_toolkit/special/expint/expint_n.html index 0deee9046..c438fcc0a 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/expint/expint_n.html +++ b/doc/sf_and_dist/html/math_toolkit/special/expint/expint_n.html @@ -28,7 +28,7 @@ Integral En

- + Synopsis

@@ -63,7 +63,7 @@

- + Description
template <class T>
@@ -83,7 +83,7 @@
           
         

- + Accuracy

@@ -94,7 +94,7 @@ the one shown will have effectively zero error.

-

Table 44. Errors In the Function expint(n, z)

+

Table 45. Errors In the Function expint(n, z)

@@ -225,7 +225,7 @@

- + Testing

@@ -240,7 +240,7 @@ check.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/extern_c/c99.html b/doc/sf_and_dist/html/math_toolkit/special/extern_c/c99.html index 0f271bc1b..4a2cd8ab7 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/extern_c/c99.html +++ b/doc/sf_and_dist/html/math_toolkit/special/extern_c/c99.html @@ -27,7 +27,7 @@ C99 C Functions

- + Supported C99 Functions
@@ -138,7 +138,7 @@ acosh(2); // integer argument is treated as a double, returns double.
- + Quick Reference
diff --git a/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1.html b/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1.html index 30d557176..c78d23dc5 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1.html +++ b/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1.html @@ -288,7 +288,7 @@

- + Usage Recomendations
@@ -341,7 +341,7 @@

- + Supported C99 Functions
@@ -445,7 +445,7 @@

- + Supported TR1 Functions
@@ -584,7 +584,7 @@

- + Currently Unsupported C99 Functions
@@ -655,7 +655,7 @@

- + Currently Unsupported TR1 Functions
diff --git a/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1_ref.html b/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1_ref.html index 277247aae..b0fc7b30c 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1_ref.html +++ b/doc/sf_and_dist/html/math_toolkit/special/extern_c/tr1_ref.html @@ -28,7 +28,7 @@ Quick Reference
- + Supported TR1 Functions
@@ -163,7 +163,7 @@ expint(2); // integer argument is treated as a double, returns double.
- + Quick Reference
@@ -495,7 +495,7 @@ for the full template (header only) version of this function.

- + Currently Unsupported TR1 Functions
diff --git a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_binomial.html b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_binomial.html index 711ed8f7f..5b74f5e3a 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_binomial.html +++ b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_binomial.html @@ -65,7 +65,7 @@ if the result is too large to represent in type T.

- + Accuracy

@@ -74,14 +74,14 @@ function for larger arguments.

- + Testing

The spot tests for the binomial coefficients use data generated by functions.wolfram.com.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_double_factorial.html b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_double_factorial.html index d34227f54..440298847 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_double_factorial.html +++ b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_double_factorial.html @@ -64,7 +64,7 @@ of i! is possible.

- + Accuracy

@@ -72,14 +72,14 @@ so error rates should be no more than a couple of epsilon higher.

- + Testing

The spot tests for the double factorial use data generated by functions.wolfram.com.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_factorial.html b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_factorial.html index 273fa6e4b..fe3a83153 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_factorial.html +++ b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_factorial.html @@ -27,7 +27,7 @@ Factorial

- + Synopsis

@@ -54,7 +54,7 @@ }} // namespaces

- + Description
template <class T>
@@ -112,7 +112,7 @@
           the size of further tables that depend on the factorials.
         

- + Accuracy

@@ -121,7 +121,7 @@ will be the same as for tgamma.

- + Testing

@@ -130,7 +130,7 @@ function handle those cases already.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_falling_factorial.html b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_falling_factorial.html index 2cc456183..08863f5f8 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_falling_factorial.html +++ b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_falling_factorial.html @@ -76,7 +76,7 @@ the type of the result is T.

- + Accuracy

@@ -84,14 +84,14 @@ function.

- + Testing

The spot tests for the falling factorials use data generated by functions.wolfram.com.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_rising_factorial.html b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_rising_factorial.html index f821e9d7f..13688b278 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_rising_factorial.html +++ b/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_rising_factorial.html @@ -80,7 +80,7 @@ the type of the result is T.

- + Accuracy

@@ -88,14 +88,14 @@ function.

- + Testing

The spot tests for the rising factorials use data generated by functions.wolfram.com.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/fpclass.html b/doc/sf_and_dist/html/math_toolkit/special/fpclass.html index ff1e70e37..59b40fa62 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/fpclass.html +++ b/doc/sf_and_dist/html/math_toolkit/special/fpclass.html @@ -28,7 +28,7 @@ Infinities and NaN's

- + Synopsis
#define FP_ZERO        /* implementation specific value */
@@ -58,7 +58,7 @@
         to use these functions.
       

- + Description

diff --git a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_advance.html b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_advance.html index 18a0c62f2..fdadd0749 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_advance.html +++ b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_advance.html @@ -32,7 +32,7 @@ number of ULP.

- + Synopsis

@@ -50,7 +50,7 @@ }} // namespaces

- + Description - float_advance
diff --git a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_distance.html b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_distance.html index b54984cfa..ca9f9f700 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_distance.html +++ b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_distance.html @@ -34,7 +34,7 @@ different.

- + Synopsis

@@ -52,7 +52,7 @@ }} // namespaces

- + Description - float_distance
diff --git a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_next.html b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_next.html index d63c0767a..8609357a5 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_next.html +++ b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_next.html @@ -28,7 +28,7 @@ the Next Greater Representable Value (float_next)
- + Synopsis

@@ -46,7 +46,7 @@ }} // namespaces

- + Description - float_next
diff --git a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_prior.html b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_prior.html index 30e6b7c11..968440173 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/next_float/float_prior.html +++ b/doc/sf_and_dist/html/math_toolkit/special/next_float/float_prior.html @@ -28,7 +28,7 @@ the Next Smaller Representable Value (float_prior)
- + Synopsis

@@ -46,7 +46,7 @@ }} // namespaces

- + Description - float_prior
diff --git a/doc/sf_and_dist/html/math_toolkit/special/next_float/nextafter.html b/doc/sf_and_dist/html/math_toolkit/special/next_float/nextafter.html index 9f84fdbb1..87a1078c2 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/next_float/nextafter.html +++ b/doc/sf_and_dist/html/math_toolkit/special/next_float/nextafter.html @@ -28,7 +28,7 @@ the Next Representable Value in a Specific Direction (nextafter)
- + Synopsis

@@ -46,7 +46,7 @@ }} // namespaces

- + Description - nextafter
@@ -76,7 +76,7 @@ returns an overflow_error.

- + Examples - nextafter
diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/cbrt.html b/doc/sf_and_dist/html/math_toolkit/special/powers/cbrt.html index ef7fe7e6d..6dcdc5f3e 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/cbrt.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/cbrt.html @@ -71,7 +71,7 @@

- + Accuracy

@@ -79,7 +79,7 @@ should have approximately 2 epsilon accuracy.

- + Testing

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/ct_pow.html b/doc/sf_and_dist/html/math_toolkit/special/powers/ct_pow.html index 6fe6167fa..daaa79c18 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/ct_pow.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/ct_pow.html @@ -32,7 +32,7 @@ computes the compile-time integral power of a run-time base.

- + Synopsis

@@ -49,7 +49,7 @@ }}

- + Rationale and Usage
@@ -91,13 +91,12 @@ Only 3 different products were actually computed.

- + Return Type

The return type of these functions is computed using the result - type calculation rules when T1 and T2 are different types. - For example: + type calculation rules. For example:

  • @@ -113,7 +112,7 @@
- + Policies

@@ -127,18 +126,25 @@

- + Error Handling

- In the case where pow is - called with a null base and a negative exponent, an error occurs since - this operation is a division by 0 (it equals to 1/0). The error raised - is an overflow_error following the - general policies - of error handling in Boost.Math. + Two cases of errors can occur when using pow:

+

The default overflow error policy is throw_on_error. A call like pow<-2>(0) will thus throw a std::overflow_error @@ -162,6 +168,27 @@ must be defined by the user. +

+ The default indeterminate result error policy is ignore_error, + which for this function returns 1 since it's the most commonly chosen result + for a power of 0. Here again, other error handling policies can be used: +

+
    +
  • +throw_on_error: Throws + std::domain_error +
  • +
  • +errno_on_error: Sets + ::errno + to EDOM and returns 1. +
  • +
  • +user_error: Returns the + result of boost::math::policies::user_indeterminate_result_error: this + function must be defined by the user. +
  • +

Here is an example of error handling customization where we want to specify the result that has to be returned in case of error. We will thus use the @@ -204,7 +231,7 @@ double result = pow<-5>(base);

- + Acknowledgements

@@ -215,7 +242,7 @@ improving the implementation.

- + References

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/expm1.html b/doc/sf_and_dist/html/math_toolkit/special/powers/expm1.html index 96302f55f..3d9e4058a 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/expm1.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/expm1.html @@ -80,7 +80,7 @@

- + Accuracy

@@ -88,7 +88,7 @@ should have approximately 1 epsilon accuracy.

- + Testing

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/hypot.html b/doc/sf_and_dist/html/math_toolkit/special/powers/hypot.html index 1a6268c93..aaf72ce1e 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/hypot.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/hypot.html @@ -58,7 +58,7 @@ in such a representable.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/log1p.html b/doc/sf_and_dist/html/math_toolkit/special/powers/log1p.html index 3255400c7..c8901c350 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/log1p.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/log1p.html @@ -93,7 +93,7 @@

- + Accuracy

@@ -101,7 +101,7 @@ should have approximately 1 epsilon accuracy.

- + Testing

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/powm1.html b/doc/sf_and_dist/html/math_toolkit/special/powers/powm1.html index 2bbb6d9bf..37b863e24 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/powm1.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/powm1.html @@ -74,14 +74,14 @@

- + Accuracy

Should have approximately 2-3 epsilon accuracy.

- + Testing

diff --git a/doc/sf_and_dist/html/math_toolkit/special/powers/sqrt1pm1.html b/doc/sf_and_dist/html/math_toolkit/special/powers/sqrt1pm1.html index f9a9ec274..c06f68b31 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/powers/sqrt1pm1.html +++ b/doc/sf_and_dist/html/math_toolkit/special/powers/sqrt1pm1.html @@ -76,7 +76,7 @@

- + Accuracy

@@ -84,7 +84,7 @@ should have approximately 3 epsilon accuracy.

- + Testing

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_derivative.html b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_derivative.html index 76fa7fb53..ad5eb3295 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_derivative.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_derivative.html @@ -28,7 +28,7 @@ of the Incomplete Beta Function

- + Synopsis

@@ -49,7 +49,7 @@ }} // namespaces

- + Description

@@ -76,14 +76,14 @@

- + Accuracy

Almost identical to the incomplete beta function ibeta.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_function.html b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_function.html index c575dad70..3f414332f 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_function.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/beta_function.html @@ -27,7 +27,7 @@ Beta

- + Synopsis

@@ -48,7 +48,7 @@ }} // namespaces

- + Description

@@ -86,7 +86,7 @@ type calculation rules when T1 and T2 are different types.

- + Accuracy

@@ -98,7 +98,7 @@ zero error.

-

Table 21. Peak Errors In the Beta Function

+

Table 22. Peak Errors In the Beta Function

@@ -244,7 +244,7 @@ very small.

- + Testing

@@ -253,7 +253,7 @@ at 1000-bit precision.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html index d758cd2aa..c2442624a 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html @@ -28,7 +28,7 @@ Beta Functions

- + Synopsis

@@ -67,7 +67,7 @@ }} // namespaces

- + Description

@@ -153,7 +153,7 @@

- + Accuracy

@@ -172,7 +172,7 @@ with the wider exponent range of the long double types.

-

Table 22. Errors In the Function ibeta(a,b,x)

+

Table 23. Errors In the Function ibeta(a,b,x)

@@ -359,7 +359,7 @@

-

Table 23. Errors In the Function ibetac(a,b,x)

+

Table 24. Errors In the Function ibetac(a,b,x)

@@ -526,7 +526,7 @@

-

Table 24. Errors In the Function beta(a, b, x)

+

Table 25. Errors In the Function beta(a, b, x)

@@ -693,7 +693,7 @@

-

Table 25. Errors In the Function betac(a,b,x)

+

Table 26. Errors In the Function betac(a,b,x)

@@ -860,7 +860,7 @@

- + Testing

@@ -878,7 +878,7 @@ have test data that is fully independent of the code.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_inv_function.html b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_inv_function.html index 03680c6d4..951effa08 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_inv_function.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_inv_function.html @@ -87,7 +87,7 @@ }} // namespaces

- + Description

@@ -323,7 +323,7 @@

- + Accuracy

@@ -335,7 +335,7 @@ or 1.

- + Testing

@@ -359,7 +359,7 @@

- + Implementation of ibeta_inv and ibetac_inv
@@ -527,7 +527,7 @@ rapidly converges on the true value.

- + Implementation of inverses on the a and b parameters
diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_function.html b/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_function.html index bf1503f4e..e3050b252 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_function.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_function.html @@ -28,7 +28,7 @@ Functions
- + Synopsis

@@ -69,7 +69,7 @@

- + Description
template <class T>
@@ -106,7 +106,7 @@
           
         

- + Accuracy

@@ -119,7 +119,7 @@ the one shown will have effectively zero error.

-

Table 26. Errors In the Function erf(z)

+

Table 27. Errors In the Function erf(z)

@@ -325,7 +325,7 @@

-

Table 27. Errors In the Function erfc(z)

+

Table 28. Errors In the Function erfc(z)

@@ -531,7 +531,7 @@

- + Testing

@@ -546,7 +546,7 @@ check.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html b/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html index c0d9b0993..b4ae356b2 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html @@ -28,7 +28,7 @@ Inverses

- + Synopsis

@@ -69,7 +69,7 @@

- + Description
template <class T>
@@ -103,7 +103,7 @@
           
         

- + Accuracy

@@ -113,7 +113,7 @@ error functions.

- + Testing

@@ -135,7 +135,7 @@

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/digamma.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/digamma.html index 819b34f5b..831c342a1 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/digamma.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/digamma.html @@ -27,7 +27,7 @@ Digamma

- + Synopsis

@@ -48,7 +48,7 @@ }} // namespaces

- + Description

@@ -82,7 +82,7 @@ T otherwise.

- + Accuracy

@@ -270,7 +270,7 @@ absolute error will remain very low.

- + Testing

@@ -280,7 +280,7 @@ see below).

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_derivatives.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_derivatives.html index c86b32624..5b3a3259d 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_derivatives.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_derivatives.html @@ -28,7 +28,7 @@ of the Incomplete Gamma Function

- + Synopsis

@@ -49,7 +49,7 @@ }} // namespaces

- + Description

@@ -80,7 +80,7 @@ otherwise the return type is simply T1.

- + Accuracy

@@ -88,7 +88,7 @@ refer to the documentation for that function for more information.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_ratios.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_ratios.html index 2692a062e..fff288330 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_ratios.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/gamma_ratios.html @@ -51,7 +51,7 @@ }} // namespaces

- + Description
template <class T1, class T2> 
@@ -117,7 +117,7 @@
           
         

- + Accuracy

@@ -127,7 +127,7 @@ effectively zero error.

-

Table 15. Errors In the Function tgamma_delta_ratio(a, delta)

+

Table 16. Errors In the Function tgamma_delta_ratio(a, delta)

@@ -230,7 +230,7 @@

-

Table 16. Errors In the Function tgamma_ratio(a, +

Table 17. Errors In the Function tgamma_ratio(a, b)

@@ -329,7 +329,7 @@

- + Testing

@@ -338,7 +338,7 @@ a deliberately naive calculation of Γ(x)/Γ(y).

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma.html index 98ab96e3f..349f791bb 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma.html @@ -28,7 +28,7 @@ Functions

- + Synopsis

@@ -67,7 +67,7 @@ }} // namespaces

- + Description

@@ -160,7 +160,7 @@

- + Accuracy

@@ -185,7 +185,7 @@ All values are in units of epsilon.

-

Table 17. Errors In the Function gamma_p(a,z)

+

Table 18. Errors In the Function gamma_p(a,z)

@@ -372,7 +372,7 @@

-

Table 18. Errors In the Function gamma_q(a,z)

+

Table 19. Errors In the Function gamma_q(a,z)

@@ -558,7 +558,7 @@

-

Table 19. Errors In the Function tgamma_lower(a,z)

+

Table 20. Errors In the Function tgamma_lower(a,z)

@@ -693,7 +693,7 @@

-

Table 20. Errors In the Function tgamma(a,z)

+

Table 21. Errors In the Function tgamma(a,z)

@@ -828,7 +828,7 @@

- + Testing

@@ -844,7 +844,7 @@ fraction (see below) is unstable for small a and z.

- + Implementation

@@ -1013,7 +1013,7 @@ by Temme (see references below).

- + References
    diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma_inv.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma_inv.html index 0a4107f2e..623c93234 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma_inv.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/igamma_inv.html @@ -28,7 +28,7 @@ Gamma Function Inverses
- + Synopsis

@@ -67,7 +67,7 @@ }} // namespaces

- + Description

@@ -173,7 +173,7 @@ 0.

- + Accuracy

@@ -187,7 +187,7 @@ functions.

- + Testing

@@ -210,7 +210,7 @@

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html index d42ac0c70..40afd2e8f 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/lgamma.html @@ -27,7 +27,7 @@ Log Gamma

- + Synopsis

@@ -54,7 +54,7 @@ }} // namespaces

- + Description

@@ -98,7 +98,7 @@ T otherwise.

- + Accuracy

@@ -349,7 +349,7 @@

- + Testing

@@ -360,7 +360,7 @@ Random tests in key problem areas are also used.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/tgamma.html b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/tgamma.html index d1b8ed5bd..a6ed0590e 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/tgamma.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_gamma/tgamma.html @@ -27,7 +27,7 @@ Gamma

- + Synopsis

@@ -54,7 +54,7 @@ }} // namespaces

- + Description
template <class T>
@@ -129,7 +129,7 @@
 

- + Accuracy

@@ -384,7 +384,7 @@

- + Testing

@@ -399,7 +399,7 @@ a lanczos approximation accurate to around 100 decimal digits.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html index 5dda5c5e6..839dc70da 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html @@ -27,7 +27,7 @@ Hermite Polynomials

- + Synopsis

@@ -51,7 +51,7 @@ }} // namespaces

- + Description

@@ -136,7 +136,7 @@

- + Accuracy

@@ -146,7 +146,7 @@ zero error.

-

Table 33. Peak Errors In the Hermite Polynomial

+

Table 34. Peak Errors In the Hermite Polynomial

@@ -253,7 +253,7 @@ is very close to a root.

- + Testing

@@ -263,7 +263,7 @@ precision.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/laguerre.html b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/laguerre.html index c9ba66815..184dcd21e 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/laguerre.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/laguerre.html @@ -28,7 +28,7 @@ Associated) Polynomials

- + Synopsis

@@ -62,7 +62,7 @@ }} // namespaces

- + Description

@@ -210,7 +210,7 @@

- + Accuracy

@@ -220,7 +220,7 @@ zero error.

-

Table 31. Peak Errors In the Laguerre Polynomial

+

Table 32. Peak Errors In the Laguerre Polynomial

@@ -320,7 +320,7 @@

-

Table 32. Peak Errors In the Associated Laguerre +

Table 33. Peak Errors In the Associated Laguerre Polynomial

@@ -429,7 +429,7 @@ is very close to a root.

- + Testing

@@ -439,7 +439,7 @@ precision.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html index a193abc9a..3221964ea 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html @@ -28,7 +28,7 @@ Associated) Polynomials

- + Synopsis

@@ -84,7 +84,7 @@

- + Description
template <class T>
@@ -292,7 +292,7 @@
 
 
 
- + Accuracy

@@ -302,7 +302,7 @@ zero error.

-

Table 28. Peak Errors In the Legendre P Function

+

Table 29. Peak Errors In the Legendre P Function

@@ -431,7 +431,7 @@

-

Table 29. Peak Errors In the Associated Legendre +

Table 30. Peak Errors In the Associated Legendre P Function

@@ -533,7 +533,7 @@

-

Table 30. Peak Errors In the Legendre Q Function

+

Table 31. Peak Errors In the Legendre Q Function

@@ -675,7 +675,7 @@ given here.

- + Testing

@@ -685,7 +685,7 @@ precision.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/sph_harm.html b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/sph_harm.html index bd2a202b6..287ed9780 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/sf_poly/sph_harm.html +++ b/doc/sf_and_dist/html/math_toolkit/special/sf_poly/sph_harm.html @@ -27,7 +27,7 @@ Spherical Harmonics

- + Synopsis

@@ -60,7 +60,7 @@ }} // namespaces

- + Description

@@ -155,7 +155,7 @@

- + Accuracy

@@ -170,7 +170,7 @@ All values are in units of epsilon.

-

Table 34. Peak Errors In the Sperical Harmonic Functions

+

Table 35. Peak Errors In the Sperical Harmonic Functions

@@ -276,7 +276,7 @@ arbitrarily large when the function is very close to a root.

- + Testing

@@ -286,7 +286,7 @@ precision.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/special/zetas/zeta.html b/doc/sf_and_dist/html/math_toolkit/special/zetas/zeta.html index 3ef3deb67..3d26e7465 100644 --- a/doc/sf_and_dist/html/math_toolkit/special/zetas/zeta.html +++ b/doc/sf_and_dist/html/math_toolkit/special/zetas/zeta.html @@ -27,7 +27,7 @@ Riemann Zeta Function

- + Synopsis

@@ -62,7 +62,7 @@

- + Description
template <class T>
@@ -85,7 +85,7 @@
           
         

- + Accuracy

@@ -97,7 +97,7 @@ shown will have effectively zero error.

-

Table 43. Errors In the Function zeta(z)

+

Table 44. Errors In the Function zeta(z)

@@ -234,7 +234,7 @@

- + Testing

@@ -249,7 +249,7 @@ check.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/status/compilers.html b/doc/sf_and_dist/html/math_toolkit/status/compilers.html index 512889ba0..47826af0f 100644 --- a/doc/sf_and_dist/html/math_toolkit/status/compilers.html +++ b/doc/sf_and_dist/html/math_toolkit/status/compilers.html @@ -37,7 +37,7 @@

-

Table 54. Supported/Tested Compilers

+

Table 55. Supported/Tested Compilers

@@ -540,7 +540,7 @@


-

Table 55. Unsupported Compilers

+

Table 56. Unsupported Compilers

diff --git a/doc/sf_and_dist/html/math_toolkit/status/history1.html b/doc/sf_and_dist/html/math_toolkit/status/history1.html index 89ba92daa..6efe6646d 100644 --- a/doc/sf_and_dist/html/math_toolkit/status/history1.html +++ b/doc/sf_and_dist/html/math_toolkit/status/history1.html @@ -30,57 +30,42 @@

- + Boost-1.36.0

- + Boost-1.35.0: Post Review First Official Release
@@ -117,7 +102,7 @@

- + Milestone 4: Second Review Candidate (1st March 2007)
@@ -136,7 +121,7 @@

- + Milestone 3: First Review Candidate (31st Dec 2006)
@@ -169,7 +154,7 @@

- + Milestone 2: Released September 10th 2006
@@ -210,7 +195,7 @@

- + Milestone 1: Released March 31st 2006
@@ -245,7 +230,7 @@

- Sandbox and trunk last synchonised at revision: 45483. + Sandbox and trunk last synchonised at revision: 45484.

diff --git a/doc/sf_and_dist/html/math_toolkit/status/issues.html b/doc/sf_and_dist/html/math_toolkit/status/issues.html index e1870c22a..596a3e529 100644 --- a/doc/sf_and_dist/html/math_toolkit/status/issues.html +++ b/doc/sf_and_dist/html/math_toolkit/status/issues.html @@ -43,7 +43,7 @@ with it.

- + tgamma
  • @@ -51,7 +51,7 @@ be optimized any further? (low priority)
- + Incomplete Beta
  • @@ -59,7 +59,7 @@ (medium priority).
- + Inverse Gamma
  • @@ -67,7 +67,7 @@ is good enough (Medium Priority).
- + Polynomials
  • @@ -77,7 +77,7 @@ not (Low Priority).
- + Elliptic Integrals
    @@ -127,7 +127,7 @@
- + Inverse Hyperbolic Functions
@@ -137,7 +137,7 @@ is probably only an issue for very high precision types (Low Priority).
- + Statistical distributions
@@ -146,7 +146,7 @@ for very large degrees of freedom?
- + Feature Requests

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/cf.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/cf.html index 4c333af7b..78d09ccaf 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/cf.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/cf.html @@ -28,7 +28,7 @@ Evaluation

- + Synopsis

@@ -59,7 +59,7 @@ }}} // namespaces

- + Description

@@ -157,7 +157,7 @@ a continued fraction for convergence.

- + Implementation

@@ -167,7 +167,7 @@ Lentz, W.J. 1976, Applied Optics, vol. 15, pp. 668-671.

- + Examples

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/minima.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/minima.html index f31659073..4bef65aff 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/minima.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/minima.html @@ -28,7 +28,7 @@ Minima

- + synopsis

@@ -45,7 +45,7 @@ std::pair<T, T> brent_find_minima(F f, T min, T max, int bits, boost::uintmax_t& max_iter);

- + Description

@@ -88,7 +88,7 @@ the abscissa at the minima and the value of f(x) at the minima.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/rational.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/rational.html index 03d93b5b9..82083f40a 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/rational.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/rational.html @@ -28,7 +28,7 @@ and Rational Function Evaluation

- + synopsis

@@ -79,7 +79,7 @@ V evaluate_rational(const T* num, const U* denom, V z, unsigned count);

- + Description

@@ -193,7 +193,7 @@ evaluation with compile-time array sizes may offer slightly better performance.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots.html index 53298c78e..1a30b5c1c 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots.html @@ -28,7 +28,7 @@ With Derivatives

- + Synopsis

@@ -61,7 +61,7 @@ }}} // namespaces

- + Description

@@ -176,7 +176,7 @@

- + Newton Raphson Method
@@ -196,7 +196,7 @@

- + Halley's Method
@@ -220,7 +220,7 @@

- + Schroeder's Method
@@ -244,7 +244,7 @@ iteration.

- + Example

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots2.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots2.html index 887236645..25422fc7e 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots2.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/roots2.html @@ -28,7 +28,7 @@ Without Derivatives

- + Synopsis

@@ -141,7 +141,7 @@ }}} // namespaces

- + Description

@@ -559,7 +559,7 @@ as soon as both ends of the interval round to the same nearest integer.

- + Implementation

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/series_evaluation.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/series_evaluation.html index 9555d541b..fb2b6a731 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/series_evaluation.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals1/series_evaluation.html @@ -28,7 +28,7 @@ Series Evaluation

- + Synopsis

@@ -61,7 +61,7 @@ }}} // namespaces

- + Description

@@ -117,7 +117,7 @@ summation in this way.

- + Example

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/error_test.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/error_test.html index f92ea4496..8d1ad875c 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/error_test.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/error_test.html @@ -28,7 +28,7 @@ Error and Testing

- + Synopsis

@@ -45,7 +45,7 @@ test_result<see-below> test(const A& a, F1 test_func, F2 expect_func);

- + Description
template <class T>
@@ -165,7 +165,7 @@
           is mainly a debugging/development aid (and a good place for a breakpoint).
         

- + Example

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/polynomials.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/polynomials.html index 71528917d..345a772c3 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/polynomials.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/polynomials.html @@ -27,7 +27,7 @@ Polynomials

- + Synopsis

@@ -103,7 +103,7 @@ }}} // namespaces

- + Description

diff --git a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/test_data.html b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/test_data.html index 4f78959e3..0b8e40ae9 100644 --- a/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/test_data.html +++ b/doc/sf_and_dist/html/math_toolkit/toolkit/internals2/test_data.html @@ -46,7 +46,7 @@

- + Synopsis
namespace boost{ namespace math{ namespace tools{
@@ -147,7 +147,7 @@
 }}} // namespaces
 
- + Description

@@ -177,7 +177,7 @@

- + Example 1: Output Data for Graph Plotting
@@ -211,7 +211,7 @@

- + Example 2: Creating Test Data
@@ -375,7 +375,7 @@ used by default as it's rather hard on the compiler when the table is large.

- + Example 3: Profiling a Continued Fraction for Convergence and Accuracy
@@ -481,7 +481,7 @@ of a and z.

- + reference

diff --git a/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html b/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html index 5eb0fb91d..e59b67051 100644 --- a/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html +++ b/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html @@ -42,7 +42,7 @@ behaves just like a built in floating point type.

- + Basic Arithmetic Requirements
@@ -1034,7 +1034,7 @@
- + Standard Library Support Requirements
diff --git a/doc/sf_and_dist/math.qbk b/doc/sf_and_dist/math.qbk index e579969da..9b688b814 100644 --- a/doc/sf_and_dist/math.qbk +++ b/doc/sf_and_dist/math.qbk @@ -76,6 +76,7 @@ [def __denorm_error [link denorm_error denorm_error]] [def __evaluation_error [link evaluation_error evaluation_error]] [def __rounding_error [link rounding_error rounding_error]] +[def __indeterminate_result_error [link indeterminate_result_error indeterminate_result_error]] [def __checked_narrowing_cast [link checked_narrowing_cast checked_narrowing_cast]] [def __arg_pomotion_rules [link math_toolkit.main_overview.result_type ['result type calculation rules]]] diff --git a/doc/sf_and_dist/policy.qbk b/doc/sf_and_dist/policy.qbk index 17df239e7..db11495e5 100644 --- a/doc/sf_and_dist/policy.qbk +++ b/doc/sf_and_dist/policy.qbk @@ -45,6 +45,7 @@ Will throw one of the following exceptions, depending upon the [[Underflow Error][std::underflow_error]] [[Denorm Error][std::underflow_error]] [[Evaluation Error][boost::math::evaluation_error]] + [[Indeterminate Result Error][std::domain_error]] ] [h5 errno_on_error] @@ -60,11 +61,12 @@ had been ignored: [[Underflow Error][ERANGE]] [[Denorm Error][ERANGE]] [[Evaluation Error][EDOM]] + [[Indeterminate Result Error][EDOM]] ] [h5 ignore_error] -Will return a one of the values below depending on the error type (`::errno` is NOT changed):: +Will return one of the values below depending on the error type (`::errno` is NOT changed):: [table [[Error Type][Returned Value]] [[Domain Error][std::numeric_limits::quiet_NaN()]] @@ -74,6 +76,7 @@ Will return a one of the values below depending on the error type (`::errno` is [[Denorm Error][The denormalised value.]] [[Evaluation Error][The best guess as to the result: which may be significantly in error.]] + [[Indeterminate Result Error][Depends on the function where the error occurred]] ] [h5 user_error] @@ -83,28 +86,31 @@ in boost/math/policies/error_handling.hpp, but the actual definitions must be provided by the user: namespace boost{ namespace math{ namespace policies{ - + template T user_domain_error(const char* function, const char* message, const T& val); - + template T user_pole_error(const char* function, const char* message, const T& val); - + template T user_overflow_error(const char* function, const char* message, const T& val); - + template T user_underflow_error(const char* function, const char* message, const T& val); - + template T user_denorm_error(const char* function, const char* message, const T& val); - + template T user_rounding_error(const char* function, const char* message, const T& val); - + template T user_evaluation_error(const char* function, const char* message, const T& val); - + + template + T user_indeterminate_result_error(const char* function, const char* message, const T& val); + }}} // namespaces Note that the strings ['function] and ['message] may contain "%1%" format specifiers @@ -121,7 +127,7 @@ tutorial here]. [h4 Kinds of Error Raised] -There are five kinds of error reported by this library, +There are six kinds of error reported by this library, which are summarised in the following table: [table @@ -191,6 +197,14 @@ which are summarised in the following table: Defaults to `boost::math::policies::evaluation_error` When the action is ['throw_on_error] then throws `boost::math::evaluation_error`]] +[[Indeterminate Result Error] + [boost::math::policies::indeterminate_result_error<['action]>] + [Raised when the result of a function is not defined for the values that + were passed to it. + + Defaults to `boost::math::policies::indeterminate_result_error` + + When the action is ['throw_on_error] then throws `std::domain_error`]] ] [h4 Examples] @@ -537,6 +551,14 @@ defaults to `ignore_error`, but can be set to any of the enumerated actions for error handing: `throw_on_error`, `errno_on_error`, `ignore_error` or `user_error`. +[h5 BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY] + +Defines what happens when the result is indeterminate, but where there +is none the less a convention for the result. If not defined then +defaults to `ignore_error`, but can be set to any of the enumerated +actions for error handing: `throw_on_error`, `errno_on_error`, +`ignore_error` or `user_error`. + [h5 BOOST_MATH_DIGITS10_POLICY] Defines how many decimal digits to use in internal computations: @@ -684,7 +706,9 @@ compile-time container for a collection of policies: class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct policy { public: @@ -695,6 +719,7 @@ compile-time container for a collection of policies: typedef ``['computed-from-template-arguments]`` denorm_error_type; typedef ``['computed-from-template-arguments]`` rounding_error_type; typedef ``['computed-from-template-arguments]`` evaluation_error_type; + typedef ``['computed-from-template-arguments]`` indeterminate_result_error_type; typedef ``['computed-from-template-arguments]`` precision_type; typedef ``['computed-from-template-arguments]`` promote_float_type; typedef ``['computed-from-template-arguments]`` promote_double_type; @@ -716,7 +741,9 @@ compile-time container for a collection of policies: class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct normalise { typedef ``computed-from-template-arguments`` type; @@ -767,6 +794,13 @@ Specifies how evaluation errors are handled, will be an instance of `boost::math::policies::evaluation_error<>` with the template argument to `evaluation_error` one of the `error_policy_type` enumerated values. + policy<...>::indeterminate_error_type + +Specifies how indeterminate result errors are handled, will be an instance of +`boost::math::policies::indeterminate_result_error<>` with the template argument +to `indeterminate_result_error` one of the `error_policy_type` enumerated +values. + policy<...>::precision_type Specifies the internal precision to use in binary digits (uses zero @@ -817,7 +851,9 @@ a normalised `policy` class. class A8 = default_policy, class A9 = default_policy, class A10 = default_policy, - class A11 = default_policy> + class A11 = default_policy, + class A12 = default_policy, + class A13 = default_policy> struct normalise { typedef ``computed-from-template-arguments`` type; diff --git a/doc/sf_and_dist/policy_tutorial.qbk b/doc/sf_and_dist/policy_tutorial.qbk index 1fc7d1757..8ab3256f4 100644 --- a/doc/sf_and_dist/policy_tutorial.qbk +++ b/doc/sf_and_dist/policy_tutorial.qbk @@ -46,6 +46,7 @@ stop reading now! [[Denormalised Result][Ignores the fact that the result is denormalised, and returns it.]] [[Rounding Error][Throws a `boost::math::rounding_error` exception.]] [[Internal Evaluation Error][Throws a `boost::math::evaluation_error` exception.]] +[[Indeterminate Result Error][Returns a result that depends on the function where the error occurred.]] [[Promotion of float to double][Does occur by default - gives full float precision results.]] [[Promotion of double to long double][Does occur by default if long double offers more precision than double.]] diff --git a/doc/sf_and_dist/pow.qbk b/doc/sf_and_dist/pow.qbk index b3369ee9d..3135a9d1b 100644 --- a/doc/sf_and_dist/pow.qbk +++ b/doc/sf_and_dist/pow.qbk @@ -53,8 +53,8 @@ Only 3 different products were actually computed. [h4 Return Type] -The return type of these functions is computed using the __arg_pomotion_rules -when T1 and T2 are different types. For example: +The return type of these functions is computed using the __arg_pomotion_rules. +For example: * If T is a `float`, the return type is a `float`. * If T is a `long double`, the return type is a `long double`. @@ -66,9 +66,13 @@ when T1 and T2 are different types. For example: [h4 Error Handling] -In the case where `pow` is called with a null base and a negative exponent, -an error occurs since this operation is a division by 0 (it equals to 1/0). -The error raised is an __overflow_error following the +Two cases of errors can occur when using `pow`: + +* In case of null base and negative exponent, an __overflow_error occurs since +this operation is a division by 0 (it equals to 1/0). +* In case of null exponent, an __indeterminate_result_error occurs since the +result of a null power is indeterminate. +Those errors follow the [link math_toolkit.main_overview.error_handling general policies of error handling in Boost.Math]. @@ -81,6 +85,15 @@ link given above, other error handling policies can be used: * `user_error`: Returns the result of `boost::math::policies::user_overflow_error`: this function must be defined by the user. +The default indeterminate result error policy is `ignore_error`, which for this +function returns 1 since it's the most commonly chosen result for a power of 0. +Here again, other error handling policies can be used: + +* `throw_on_error`: Throws `std::domain_error` +* `errno_on_error`: Sets `::errno` to `EDOM` and returns 1. +* `user_error`: Returns the result of `boost::math::policies::user_indeterminate_result_error`: + this function must be defined by the user. + Here is an example of error handling customization where we want to specify the result that has to be returned in case of error. We will thus use the `user_error` policy, by passing as second argument an diff --git a/doc/sf_and_dist/roadmap.qbk b/doc/sf_and_dist/roadmap.qbk index 9c2408612..252b91ba6 100644 --- a/doc/sf_and_dist/roadmap.qbk +++ b/doc/sf_and_dist/roadmap.qbk @@ -2,16 +2,14 @@ [h4 Boost-1.36.0] -* Added __non_central_chi_squared_distrib. -* Added __non_central_beta_distrib. -* Added __non_central_F_distrib. -* Added __non_central_T_distrib. -* Added [link math_toolkit.special.expint Exponential Integral Functions]. -* Added __zeta Function. -* Added [link math_toolkit.special.rounding Rounding and Truncation functions]. -* Added [link math_toolkit.special.powers.ct_pow Compile time powers of runtime bases]. -* Added [link math_toolkit.special.next_float nextafter and related functions]. -* Added separate [link math_toolkit.special.extern_c TR1 and C99 "C" language bindings]. +* Added Noncentral Chi Squared Distribution. +* Added Noncentral Beta Distribution. +* Added Noncentral F Distribution. +* Added Noncentral T Distribution. +* Added Exponential Integral Functions. +* Added Zeta Function. +* Added Rounding and Truncation functions. +* Added Compile time powers of runtime bases. [h4 Boost-1.35.0: Post Review First Official Release] @@ -73,7 +71,7 @@ on error rates. SVN Revisions: -Sandbox and trunk last synchonised at revision: 45483. +Sandbox and trunk last synchonised at revision: 45484. ] [/ diff --git a/example/policy_eg_8.cpp b/example/policy_eg_8.cpp index c535dcdd5..50935c1fb 100644 --- a/example/policy_eg_8.cpp +++ b/example/policy_eg_8.cpp @@ -39,6 +39,8 @@ boost/math/policies/error_handling.hpp like this: T user_denorm_error(const char* function, const char* message, const T& val); template T user_evaluation_error(const char* function, const char* message, const T& val); + template + T user_indeterminate_result_error(const char* function, const char* message, const T& val); }}} // namespaces diff --git a/include/boost/math/policies/error_handling.hpp b/include/boost/math/policies/error_handling.hpp index b0e562d6a..95f650525 100644 --- a/include/boost/math/policies/error_handling.hpp +++ b/include/boost/math/policies/error_handling.hpp @@ -62,6 +62,8 @@ template T user_evaluation_error(const char* function, const char* message, const T& val); template T user_rounding_error(const char* function, const char* message, const T& val); +template +T user_indeterminate_result_error(const char* function, const char* message, const T& val); namespace detail { @@ -426,6 +428,57 @@ inline T raise_rounding_error( return user_rounding_error(function, message, val); } +template +inline T raise_indeterminate_result_error( + const char* function, + const char* message, + const T& val, + const R& , + const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::throw_on_error>&) +{ + raise_error(function, message, val); + // we never get here: + return std::numeric_limits::quiet_NaN(); +} + +template +inline T raise_indeterminate_result_error( + const char* , + const char* , + const T& , + const R& result, + const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::ignore_error>&) +{ + // This may or may not do the right thing, but the user asked for the error + // to be ignored so here we go anyway: + return result; +} + +template +inline T raise_indeterminate_result_error( + const char* , + const char* , + const T& , + const R& result, + const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::errno_on_error>&) +{ + errno = EDOM; + // This may or may not do the right thing, but the user asked for the error + // to be silent so here we go anyway: + return result; +} + +template +inline T raise_indeterminate_result_error( + const char* function, + const char* message, + const T& val, + const R& , + const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::user_error>&) +{ + return user_indeterminate_result_error(function, message, val); +} + } // namespace detail template @@ -492,6 +545,15 @@ inline T raise_rounding_error(const char* function, const char* message, const T val, policy_type()); } +template +inline T raise_indeterminate_result_error(const char* function, const char* message, const T& val, const R& result, const Policy&) +{ + typedef typename Policy::indeterminate_result_error_type policy_type; + return detail::raise_indeterminate_result_error( + function, message ? message : "Indeterminate result with value %1%", + val, result, policy_type()); +} + // // checked_narrowing_cast: // diff --git a/include/boost/math/policies/policy.hpp b/include/boost/math/policies/policy.hpp index 662b3850d..590c0520b 100644 --- a/include/boost/math/policies/policy.hpp +++ b/include/boost/math/policies/policy.hpp @@ -63,6 +63,9 @@ namespace policies{ #ifndef BOOST_MATH_DENORM_ERROR_POLICY #define BOOST_MATH_DENORM_ERROR_POLICY ignore_error #endif +#ifndef BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY +#define BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY ignore_error +#endif #ifndef BOOST_MATH_DIGITS10_POLICY #define BOOST_MATH_DIGITS10_POLICY 0 #endif @@ -182,6 +185,7 @@ BOOST_MATH_META_INT(error_policy_type, underflow_error, BOOST_MATH_UNDERFLOW_ERR BOOST_MATH_META_INT(error_policy_type, denorm_error, BOOST_MATH_DENORM_ERROR_POLICY) BOOST_MATH_META_INT(error_policy_type, evaluation_error, BOOST_MATH_EVALUATION_ERROR_POLICY) BOOST_MATH_META_INT(error_policy_type, rounding_error, BOOST_MATH_ROUNDING_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, indeterminate_result_error, BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY) // // Policy types for internal promotion: @@ -403,6 +407,7 @@ public: typedef typename detail::find_arg, denorm_error<> >::type denorm_error_type; typedef typename detail::find_arg, evaluation_error<> >::type evaluation_error_type; typedef typename detail::find_arg, rounding_error<> >::type rounding_error_type; + typedef typename detail::find_arg, indeterminate_result_error<> >::type indeterminate_result_error_type; private: // // Now work out the precision: @@ -446,6 +451,7 @@ public: typedef denorm_error<> denorm_error_type; typedef evaluation_error<> evaluation_error_type; typedef rounding_error<> rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; #if BOOST_MATH_DIGITS10_POLICY == 0 typedef digits2<> precision_type; #else @@ -470,6 +476,7 @@ public: typedef denorm_error<> denorm_error_type; typedef evaluation_error<> evaluation_error_type; typedef rounding_error<> rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; #if BOOST_MATH_DIGITS10_POLICY == 0 typedef digits2<> precision_type; #else @@ -508,6 +515,7 @@ private: typedef typename detail::find_arg, typename Policy::denorm_error_type >::type denorm_error_type; typedef typename detail::find_arg, typename Policy::evaluation_error_type >::type evaluation_error_type; typedef typename detail::find_arg, typename Policy::rounding_error_type >::type rounding_error_type; + typedef typename detail::find_arg, typename Policy::indeterminate_result_error_type >::type indeterminate_result_error_type; // // Now work out the precision: // @@ -543,6 +551,7 @@ private: denorm_error_type, evaluation_error_type, rounding_error_type, + indeterminate_result_error_type, precision_type, promote_float_type, promote_double_type, @@ -667,6 +676,13 @@ inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::ty return result_type(); } +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&, const A11&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type result_type; + return result_type(); +} + // // Traits class to handle internal promotion: // diff --git a/include/boost/math/special_functions/detail/lanczos_sse2.hpp b/include/boost/math/special_functions/detail/lanczos_sse2.hpp new file mode 100644 index 000000000..a8e9f1909 --- /dev/null +++ b/include/boost/math/special_functions/detail/lanczos_sse2.hpp @@ -0,0 +1,201 @@ +// (C) Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS_SSE2 +#define BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS_SSE2 + +#ifdef _MSC_VER +#pragma once +#endif + +#include + +#ifdef __GNUC__ +#define ALIGN16 __attribute__((aligned(16))) +#else +#define ALIGN16 __declspec(align(16)) +#endif + +namespace boost{ namespace math{ namespace lanczos{ + +template <> +inline double lanczos13m53::lanczos_sum(const double& x) +{ + static const ALIGN16 double coeff[26] = { + static_cast(2.506628274631000270164908177133837338626L), + static_cast(1u), + static_cast(210.8242777515793458725097339207133627117L), + static_cast(66u), + static_cast(8071.672002365816210638002902272250613822L), + static_cast(1925u), + static_cast(186056.2653952234950402949897160456992822L), + static_cast(32670u), + static_cast(2876370.628935372441225409051620849613599L), + static_cast(357423u), + static_cast(31426415.58540019438061423162831820536287L), + static_cast(2637558u), + static_cast(248874557.8620541565114603864132294232163L), + static_cast(13339535u), + static_cast(1439720407.311721673663223072794912393972L), + static_cast(45995730u), + static_cast(6039542586.35202800506429164430729792107L), + static_cast(105258076u), + static_cast(17921034426.03720969991975575445893111267L), + static_cast(150917976u), + static_cast(35711959237.35566804944018545154716670596L), + static_cast(120543840u), + static_cast(42919803642.64909876895789904700198885093L), + static_cast(39916800u), + static_cast(23531376880.41075968857200767445163675473L), + static_cast(0u) + }; + register __m128d vx = _mm_load1_pd(&x); + register __m128d sum_even = _mm_load_pd(coeff); + register __m128d sum_odd = _mm_load_pd(coeff+2); + register __m128d nc_odd, nc_even; + register __m128d vx2 = _mm_mul_pd(vx, vx); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 4); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 6); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 8); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 10); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 12); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 14); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 16); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 18); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 20); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 22); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 24); + sum_odd = _mm_mul_pd(sum_odd, vx); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_even = _mm_add_pd(sum_even, sum_odd); + + + double ALIGN16 t[2]; + _mm_store_pd(t, sum_even); + + return t[0] / t[1]; +} + +template <> +inline double lanczos13m53::lanczos_sum_expG_scaled(const double& x) +{ + static const ALIGN16 double coeff[26] = { + static_cast(0.006061842346248906525783753964555936883222L), + static_cast(1u), + static_cast(0.5098416655656676188125178644804694509993L), + static_cast(66u), + static_cast(19.51992788247617482847860966235652136208L), + static_cast(1925u), + static_cast(449.9445569063168119446858607650988409623L), + static_cast(32670u), + static_cast(6955.999602515376140356310115515198987526L), + static_cast(357423u), + static_cast(75999.29304014542649875303443598909137092L), + static_cast(2637558u), + static_cast(601859.6171681098786670226533699352302507L), + static_cast(13339535u), + static_cast(3481712.15498064590882071018964774556468L), + static_cast(45995730u), + static_cast(14605578.08768506808414169982791359218571L), + static_cast(105258076u), + static_cast(43338889.32467613834773723740590533316085L), + static_cast(150917976u), + static_cast(86363131.28813859145546927288977868422342L), + static_cast(120543840u), + static_cast(103794043.1163445451906271053616070238554L), + static_cast(39916800u), + static_cast(56906521.91347156388090791033559122686859L), + static_cast(0u) + }; + register __m128d vx = _mm_load1_pd(&x); + register __m128d sum_even = _mm_load_pd(coeff); + register __m128d sum_odd = _mm_load_pd(coeff+2); + register __m128d nc_odd, nc_even; + register __m128d vx2 = _mm_mul_pd(vx, vx); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 4); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 6); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 8); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 10); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 12); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 14); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 16); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 18); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 20); + sum_odd = _mm_mul_pd(sum_odd, vx2); + nc_odd = _mm_load_pd(coeff + 22); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_odd = _mm_add_pd(sum_odd, nc_odd); + + sum_even = _mm_mul_pd(sum_even, vx2); + nc_even = _mm_load_pd(coeff + 24); + sum_odd = _mm_mul_pd(sum_odd, vx); + sum_even = _mm_add_pd(sum_even, nc_even); + sum_even = _mm_add_pd(sum_even, sum_odd); + + + double ALIGN16 t[2]; + _mm_store_pd(t, sum_even); + + return t[0] / t[1]; +} + +} // namespace lanczos +} // namespace math +} // namespace boost + +#endif // BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS + + + + diff --git a/include/boost/math/special_functions/gamma.hpp b/include/boost/math/special_functions/gamma.hpp index 1d02a3ddb..6caeb660f 100644 --- a/include/boost/math/special_functions/gamma.hpp +++ b/include/boost/math/special_functions/gamma.hpp @@ -142,26 +142,29 @@ T gamma_imp(T z, const Policy& pol, const L& l) #endif static const char* function = "boost::math::tgamma<%1%>(%1%)"; - if((z <= 0) && (floor(z) == z)) - return policies::raise_pole_error(function, "Evaluation of tgamma at a negative integer %1%.", z, pol); - if(z <= -20) + if(z <= 0) { - result = gamma_imp(-z, pol, l) * sinpx(z); - if((fabs(result) < 1) && (tools::max_value() * fabs(result) < boost::math::constants::pi())) - return policies::raise_overflow_error(function, "Result of tgamma is too large to represent.", pol); - result = -boost::math::constants::pi() / result; - if(result == 0) - return policies::raise_underflow_error(function, "Result of tgamma is too small to represent.", pol); - if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL) - return policies::raise_denorm_error(function, "Result of tgamma is denormalized.", result, pol); - return result; - } + if(floor(z) == z) + return policies::raise_pole_error(function, "Evaluation of tgamma at a negative integer %1%.", z, pol); + if(z <= -20) + { + result = gamma_imp(-z, pol, l) * sinpx(z); + if((fabs(result) < 1) && (tools::max_value() * fabs(result) < boost::math::constants::pi())) + return policies::raise_overflow_error(function, "Result of tgamma is too large to represent.", pol); + result = -boost::math::constants::pi() / result; + if(result == 0) + return policies::raise_underflow_error(function, "Result of tgamma is too small to represent.", pol); + if((boost::math::fpclassify)(result) == (int)FP_SUBNORMAL) + return policies::raise_denorm_error(function, "Result of tgamma is denormalized.", result, pol); + return result; + } - // shift z to > 1: - while(z < 1) - { - result /= z; - z += 1; + // shift z to > 1: + while(z < 0) + { + result /= z; + z += 1; + } } if((floor(z) == z) && (z < max_factorial::value)) { diff --git a/include/boost/math/special_functions/lanczos.hpp b/include/boost/math/special_functions/lanczos.hpp index 730bb0bc0..d852ee390 100644 --- a/include/boost/math/special_functions/lanczos.hpp +++ b/include/boost/math/special_functions/lanczos.hpp @@ -1229,6 +1229,10 @@ struct lanczos } // namespace math } // namespace boost +#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(__SSE2__) +#include +#endif + #endif // BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS diff --git a/include/boost/math/special_functions/log1p.hpp b/include/boost/math/special_functions/log1p.hpp index 0e093a618..0122a35d7 100644 --- a/include/boost/math/special_functions/log1p.hpp +++ b/include/boost/math/special_functions/log1p.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -59,8 +60,6 @@ namespace detail log1p_series& operator=(const log1p_series&); }; -} // namespace detail - // Algorithm log1p is part of C99, but is not yet provided by many compilers. // // This version uses a Taylor series expansion for 0.5 > x > epsilon, which may @@ -71,9 +70,8 @@ namespace detail // it performs no better than log(1+x): which is to say not very well at all. // template -typename tools::promote_args::type log1p(T x, const Policy& pol) +T log1p_imp(T const & x, const Policy& pol, const mpl::int_<0>&) { // The function returns the natural logarithm of 1 + x. - // A domain error occurs if x < -1. TODO should there be a check? typedef typename tools::promote_args::type result_type; BOOST_MATH_STD_USING using std::abs; @@ -106,6 +104,192 @@ typename tools::promote_args::type log1p(T x, const Policy& pol) return result; } +template +T log1p_imp(T const& x, const Policy& pol, const mpl::int_<53>&) +{ // The function returns the natural logarithm of 1 + x. + BOOST_MATH_STD_USING + + static const char* function = "boost::math::log1p<%1%>(%1%)"; + + if(x < -1) + return policies::raise_domain_error( + function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); + if(x == -1) + return -policies::raise_overflow_error( + function, 0, pol); + + T a = fabs(x); + if(a > 0.5f) + return log(1 + x); + // Note that without numeric_limits specialisation support, + // epsilon just returns zero, and our "optimisation" will always fail: + if(a < tools::epsilon()) + return x; + + // Maximum Deviation Found: 1.846e-017 + // Expected Error Term: 1.843e-017 + // Maximum Relative Change in Control Points: 8.138e-004 + // Max Error found at double precision = 3.250766e-016 + static const T P[] = { + 0.15141069795941984e-16L, + 0.35495104378055055e-15L, + 0.33333333333332835L, + 0.99249063543365859L, + 1.1143969784156509L, + 0.58052937949269651L, + 0.13703234928513215L, + 0.011294864812099712L + }; + static const T Q[] = { + 1L, + 3.7274719063011499L, + 5.5387948649720334L, + 4.159201143419005L, + 1.6423855110312755L, + 0.31706251443180914L, + 0.022665554431410243L, + -0.29252538135177773e-5L + }; + + T result = 1 - x / 2 + tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + result *= x; + + return result; +} + +template +T log1p_imp(T const& x, const Policy& pol, const mpl::int_<64>&) +{ // The function returns the natural logarithm of 1 + x. + BOOST_MATH_STD_USING + + static const char* function = "boost::math::log1p<%1%>(%1%)"; + + if(x < -1) + return policies::raise_domain_error( + function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); + if(x == -1) + return -policies::raise_overflow_error( + function, 0, pol); + + T a = fabs(x); + if(a > 0.5f) + return log(1 + x); + // Note that without numeric_limits specialisation support, + // epsilon just returns zero, and our "optimisation" will always fail: + if(a < tools::epsilon()) + return x; + + // Maximum Deviation Found: 8.089e-20 + // Expected Error Term: 8.088e-20 + // Maximum Relative Change in Control Points: 9.648e-05 + // Max Error found at long double precision = 2.242324e-19 + static const T P[] = { + -0.807533446680736736712e-19L, + -0.490881544804798926426e-18L, + 0.333333333333333373941L, + 1.17141290782087994162L, + 1.62790522814926264694L, + 1.13156411870766876113L, + 0.408087379932853785336L, + 0.0706537026422828914622L, + 0.00441709903782239229447L + }; + static const T Q[] = { + 1L, + 4.26423872346263928361L, + 7.48189472704477708962L, + 6.94757016732904280913L, + 3.6493508622280767304L, + 1.06884863623790638317L, + 0.158292216998514145947L, + 0.00885295524069924328658L, + -0.560026216133415663808e-6L + }; + + T result = 1 - x / 2 + tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + result *= x; + + return result; +} + +template +T log1p_imp(T const& x, const Policy& pol, const mpl::int_<24>&) +{ // The function returns the natural logarithm of 1 + x. + BOOST_MATH_STD_USING + + static const char* function = "boost::math::log1p<%1%>(%1%)"; + + if(x < -1) + return policies::raise_domain_error( + function, "log1p(x) requires x > -1, but got x = %1%.", x, pol); + if(x == -1) + return -policies::raise_overflow_error( + function, 0, pol); + + T a = fabs(x); + if(a > 0.5f) + return log(1 + x); + // Note that without numeric_limits specialisation support, + // epsilon just returns zero, and our "optimisation" will always fail: + if(a < tools::epsilon()) + return x; + + // Maximum Deviation Found: 6.910e-08 + // Expected Error Term: 6.910e-08 + // Maximum Relative Change in Control Points: 2.509e-04 + // Max Error found at double precision = 6.910422e-08 + // Max Error found at float precision = 8.357242e-08 + static const T P[] = { + -0.671192866803148236519e-7L, + 0.119670999140731844725e-6L, + 0.333339469182083148598L, + 0.237827183019664122066L + }; + static const T Q[] = { + 1L, + 1.46348272586988539733L, + 0.497859871350117338894L, + -0.00471666268910169651936L + }; + + T result = 1 - x / 2 + tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + result *= x; + + return result; +} + +} // namespace detail + +template +inline typename tools::promote_args::type log1p(T x, const Policy&) +{ + typedef typename tools::promote_args::type result_type; + typedef typename policies::evaluation::type value_type; + typedef typename policies::precision::type precision_type; + typedef typename policies::normalise< + Policy, + policies::promote_float, + policies::promote_double, + policies::discrete_quantile<>, + policies::assert_undefined<> >::type forwarding_policy; + + typedef typename mpl::if_< + mpl::less_equal >, + mpl::int_<0>, + typename mpl::if_< + mpl::less_equal >, + mpl::int_<53>, // double + typename mpl::if_< + mpl::less_equal >, + mpl::int_<64>, // 80-bit long double + mpl::int_<0> // too many bits, use generic version. + >::type + >::type + >::type tag_type; + return policies::checked_narrowing_cast( + detail::log1p_imp(static_cast(x), forwarding_policy(), tag_type()), "boost::math::log1p<%1%>(%1%)"); +} + #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // These overloads work around a type deduction bug: inline float log1p(float z) diff --git a/include/boost/math/special_functions/pow.hpp b/include/boost/math/special_functions/pow.hpp index ce0c1b904..1de94d4b0 100644 --- a/include/boost/math/special_functions/pow.hpp +++ b/include/boost/math/special_functions/pow.hpp @@ -26,60 +26,45 @@ namespace math { namespace detail { -template -struct positive_power; - -template <> -struct positive_power<0, false> -{ - template - static typename tools::promote_args::type result(T) - { return 1; } -}; - -template <> -struct positive_power<1, true> -{ - template - static typename tools::promote_args::type result(T x) - { return x; } -}; - -template <> -struct positive_power<2, false> -{ - template - static typename tools::promote_args::type result(T base) - { return base*base; } -}; - -template +template struct positive_power { template static typename tools::promote_args::type result(T base) { - return base*positive_power::result(base); + typename tools::promote_args::type power = + positive_power::result(base); + return power * power; } }; template -struct positive_power +struct positive_power { template static typename tools::promote_args::type result(T base) { - return positive_power<2, false>::result( - positive_power::result(base)); + typename tools::promote_args::type power = + positive_power::result(base); + return base * power * power; } }; +template <> +struct positive_power<1, 1> +{ + template + static typename tools::promote_args::type result(T base) + { return base; } +}; + + template struct power_if_positive { template static typename tools::promote_args::type result(T base, const Policy&) - { return positive_power::result(base); } + { return positive_power::result(base); } }; template @@ -98,7 +83,29 @@ struct power_if_positive ); } - return T(1) / positive_power<-N, (-N)%2>::result(base); + return T(1) / positive_power<-N>::result(base); + } +}; + +template <> +struct power_if_positive<0, true> +{ + template + static typename tools::promote_args::type + result(T base, const Policy& policy) + { + if (base == 0) + { + return policies::raise_indeterminate_result_error( + "boost::math::pow(%1%)", + "The result of pow<0>(%1%) is undetermined", + base, + T(1), + policy + ); + } + + return T(1); } }; diff --git a/minimax/f.cpp b/minimax/f.cpp index 0508b2253..28338fa94 100644 --- a/minimax/f.cpp +++ b/minimax/f.cpp @@ -310,6 +310,14 @@ boost::math::ntl::RR f(const boost::math::ntl::RR& x, int variant) y = sqrt(y); return boost::math::erf_inv(y) / (y); } + case 28: + { + // log1p over [-0.5,0.5] + boost::math::ntl::RR y = x; + if(fabs(y) < 1e-100) + y = (y == 0) ? 1e-100 : boost::math::sign(y) * 1e-100; + return (boost::math::log1p(y) - y + y * y / 2) / (y); + } } return 0; } diff --git a/performance/performance_measure.hpp b/performance/performance_measure.hpp index 894426798..ce192dee6 100644 --- a/performance/performance_measure.hpp +++ b/performance/performance_measure.hpp @@ -10,11 +10,19 @@ #include #include +#ifdef _WIN32 +#include +#endif + template double performance_measure(F f) { unsigned count = 1; double time, result; +#ifdef _WIN32 + int old_priority = GetThreadPriority(GetCurrentThread()); + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); +#endif // // Begin by figuring out how many times to repeat // the function call in order to get a measureable time: @@ -37,7 +45,7 @@ double performance_measure(F f) // result, generally speaking this gives us // consistent results: // - for(unsigned i = 0; i < 10u;++i) + for(unsigned i = 0; i < 20u;++i) { boost::timer t; for(unsigned i = 0; i < count; ++i) @@ -47,6 +55,9 @@ double performance_measure(F f) result = time; t.restart(); } +#ifdef _WIN32 + SetThreadPriority(GetCurrentThread(), old_priority); +#endif return result / count; } diff --git a/test/pow_test.cpp b/test/pow_test.cpp index 7c037fffc..7630b8be3 100644 --- a/test/pow_test.cpp +++ b/test/pow_test.cpp @@ -111,10 +111,17 @@ void test_return_types() #endif } + namespace boost { namespace math { namespace policies { template T user_overflow_error(const char*, const char*, const T&) -{ return 123.456; } +{ return T(123.45); } +}}} + +namespace boost { namespace math { namespace policies { +template +T user_indeterminate_result_error(const char*, const char*, const T&) +{ return T(456.78); } }}} @@ -126,7 +133,13 @@ void test_error_policy() 0.0, policy< ::boost::math::policies::overflow_error >() ) - == 123.456); + == 123.45); + + BOOST_CHECK(pow<0>( + 0.0, + policy< ::boost::math::policies::indeterminate_result_error >() + ) + == 456.78); } int test_main(int, char* []) @@ -186,5 +199,3 @@ int test_main(int, char* []) return 0; } - - diff --git a/test/test_error_handling.cpp b/test/test_error_handling.cpp index a34678b8d..7419ae2d2 100644 --- a/test/test_error_handling.cpp +++ b/test/test_error_handling.cpp @@ -53,6 +53,12 @@ T user_evaluation_error(const char* , const char* , const T& ) throw user_defined_error(); } +template +T user_indeterminate_result_error(const char* , const char* , const T& ) +{ + throw user_defined_error(); +} + }}} // namespaces #include @@ -69,21 +75,32 @@ policy< overflow_error, underflow_error, denorm_error, - evaluation_error > throw_policy; + evaluation_error, + indeterminate_result_error > throw_policy; policy< domain_error, pole_error, overflow_error, underflow_error, denorm_error, - evaluation_error > errno_policy; + evaluation_error, + indeterminate_result_error > errno_policy; +policy< + domain_error, + pole_error, + overflow_error, + underflow_error, + denorm_error, + evaluation_error, + indeterminate_result_error > ignore_policy; policy< domain_error, pole_error, overflow_error, underflow_error, denorm_error, - evaluation_error > user_policy; + evaluation_error, + indeterminate_result_error > user_policy; policy<> default_policy; #define TEST_EXCEPTION(expression, exception)\ @@ -112,6 +129,8 @@ void test_error(T) TEST_EXCEPTION(boost::math::policies::raise_denorm_error(func, 0, T(0), throw_policy), std::underflow_error); TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), throw_policy), boost::math::evaluation_error); TEST_EXCEPTION(boost::math::policies::raise_evaluation_error(func, 0, T(1.25), throw_policy), boost::math::evaluation_error); + TEST_EXCEPTION(boost::math::policies::raise_indeterminate_result_error(func, msg1, T(1.25), T(12.34), throw_policy), std::domain_error); + TEST_EXCEPTION(boost::math::policies::raise_indeterminate_result_error(func, 0, T(1.25), T(12.34), throw_policy), std::domain_error); // // Now try user error handlers: these should all throw user_error(): // - because by design these are undefined and must be defined by the user ;-) @@ -121,7 +140,39 @@ void test_error(T) BOOST_CHECK_THROW(boost::math::policies::raise_underflow_error(func, msg2, user_policy), user_defined_error); BOOST_CHECK_THROW(boost::math::policies::raise_denorm_error(func, msg2, T(0), user_policy), user_defined_error); BOOST_CHECK_THROW(boost::math::policies::raise_evaluation_error(func, msg1, T(0.0), user_policy), user_defined_error); + BOOST_CHECK_THROW(boost::math::policies::raise_indeterminate_result_error(func, msg1, T(0.0), T(0.0), user_policy), user_defined_error); + // Test with ignore_error + BOOST_CHECK(boost::math::isnan(boost::math::policies::raise_domain_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits::has_quiet_NaN); + BOOST_CHECK(boost::math::isnan(boost::math::policies::raise_pole_error(func, msg1, T(0.0), ignore_policy)) || !std::numeric_limits::has_quiet_NaN); + BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error(func, msg2, ignore_policy), std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value()); + BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error(func, msg2, ignore_policy), T(0)); + BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error(func, msg2, T(1.25), ignore_policy), T(1.25)); + BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), ignore_policy), T(1.25)); + BOOST_CHECK_EQUAL(boost::math::policies::raise_indeterminate_result_error(func, 0, T(0.0), T(12.34), ignore_policy), T(12.34)); + + // Test with errno_on_error + errno = 0; + BOOST_CHECK(boost::math::isnan(boost::math::policies::raise_domain_error(func, msg1, T(0.0), errno_policy)) || !std::numeric_limits::has_quiet_NaN); + BOOST_CHECK(errno == EDOM); + errno = 0; + BOOST_CHECK(boost::math::isnan(boost::math::policies::raise_pole_error(func, msg1, T(0.0), errno_policy)) || !std::numeric_limits::has_quiet_NaN); + BOOST_CHECK(errno == EDOM); + errno = 0; + BOOST_CHECK_EQUAL(boost::math::policies::raise_overflow_error(func, msg2, errno_policy), std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value()); + BOOST_CHECK_EQUAL(errno, ERANGE); + errno = 0; + BOOST_CHECK_EQUAL(boost::math::policies::raise_underflow_error(func, msg2, errno_policy), T(0)); + BOOST_CHECK_EQUAL(errno, ERANGE); + errno = 0; + BOOST_CHECK_EQUAL(boost::math::policies::raise_denorm_error(func, msg2, T(1.25), errno_policy), T(1.25)); + BOOST_CHECK_EQUAL(errno, ERANGE); + errno = 0; + BOOST_CHECK_EQUAL(boost::math::policies::raise_evaluation_error(func, msg1, T(1.25), errno_policy), T(1.25)); + BOOST_CHECK(errno == EDOM); + errno = 0; + BOOST_CHECK(boost::math::policies::raise_indeterminate_result_error(func, 0, T(0.0), T(12.34), errno_policy) == T(12.34)); + BOOST_CHECK_EQUAL(errno, EDOM); } int test_main(int, char* []) @@ -131,7 +182,7 @@ int test_main(int, char* []) test_error(0.0F); // Test float. test_error(0.0); // Test double. test_error(0.0L); // Test long double. - test_error(boost::math::concepts::real_concept(0.0L)); // Test concepts. + test_error(boost::math::concepts::real_concept(0.0L)); // Test concepts. return 0; } // int test_main(int, char* []) diff --git a/test/test_policy.cpp b/test/test_policy.cpp index e0410ea1a..0a6f8a1ed 100644 --- a/test/test_policy.cpp +++ b/test/test_policy.cpp @@ -35,112 +35,134 @@ int test_main(int, char* []) BOOST_CHECK((is_same::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same::evaluation_error_type, evaluation_error >::value)); - + BOOST_CHECK((is_same >::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same >::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same >::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same >::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); BOOST_CHECK((is_same >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, policy<>::indeterminate_result_error_type >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); + BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); + BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); + BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); + BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); + BOOST_CHECK((is_same >::evaluation_error_type, policy<>::evaluation_error_type >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, indeterminate_result_error >::value)); + BOOST_CHECK((is_same >::precision_type, policy<>::precision_type>::value)); + BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); + BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); + BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); BOOST_CHECK((is_same >::evaluation_error_type, policy<>::evaluation_error_type >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, policy<>::indeterminate_result_error_type >::value)); BOOST_CHECK((is_same >::precision_type, digits2<20> >::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); BOOST_CHECK((is_same >::evaluation_error_type, policy<>::evaluation_error_type >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, policy<>::indeterminate_result_error_type >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type >::value)); BOOST_CHECK((is_same >::promote_float_type, promote_float >::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); BOOST_CHECK((is_same >::evaluation_error_type, policy<>::evaluation_error_type >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, policy<>::indeterminate_result_error_type >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type >::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, promote_double >::value)); BOOST_CHECK((is_same >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same >::domain_error_type, policy<>::domain_error_type >::value)); BOOST_CHECK((is_same >::pole_error_type, policy<>::pole_error_type >::value)); BOOST_CHECK((is_same >::overflow_error_type, policy<>::overflow_error_type >::value)); BOOST_CHECK((is_same >::underflow_error_type, policy<>::underflow_error_type >::value)); BOOST_CHECK((is_same >::denorm_error_type, policy<>::denorm_error_type >::value)); BOOST_CHECK((is_same >::evaluation_error_type, policy<>::evaluation_error_type >::value)); + BOOST_CHECK((is_same >::indeterminate_result_error_type, policy<>::indeterminate_result_error_type >::value)); BOOST_CHECK((is_same >::precision_type, policy<>::precision_type >::value)); BOOST_CHECK((is_same >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same >::promote_double_type, policy<>::promote_double_type>::value)); diff --git a/test/test_policy_2.cpp b/test/test_policy_2.cpp index b51a2d4e8..39ef5d2b5 100644 --- a/test/test_policy_2.cpp +++ b/test/test_policy_2.cpp @@ -33,50 +33,55 @@ int test_main(int, char* []) BOOST_CHECK((is_same, overflow_error >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same, overflow_error >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same, overflow_error >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, overflow_error >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same, overflow_error >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same, overflow_error >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same, overflow_error >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same, overflow_error >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same, domain_error >::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same, domain_error >::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same, domain_error >::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same, domain_error >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same, domain_error >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same, domain_error >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, domain_error >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same, domain_error >::precision_type, policy<>::precision_type>::value)); BOOST_CHECK((is_same, domain_error >::promote_float_type, policy<>::promote_float_type>::value)); BOOST_CHECK((is_same, domain_error >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same, domain_error >::discrete_quantile_type, policy<>::discrete_quantile_type>::value)); - + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::precision_type, digits2<20> >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::promote_float_type, promote_float >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error >::discrete_quantile_type, discrete_quantile >::value)); - + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::precision_type, digits2<20> >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::promote_float_type, promote_float >::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::promote_double_type, policy<>::promote_double_type>::value)); BOOST_CHECK((is_same, promote_float, discrete_quantile, denorm_error, domain_error > >::type::discrete_quantile_type, discrete_quantile >::value)); - + BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::domain_error_type, domain_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::pole_error_type, pole_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::overflow_error_type, overflow_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::underflow_error_type, underflow_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::denorm_error_type, denorm_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::evaluation_error_type, evaluation_error >::value)); + BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::indeterminate_result_error_type, indeterminate_result_error >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::precision_type, digits2<20> >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::promote_float_type, promote_float >::value)); BOOST_CHECK((is_same, digits2<20>, promote_float, discrete_quantile, denorm_error, domain_error >::type::promote_double_type, policy<>::promote_double_type>::value)); @@ -88,6 +93,7 @@ int test_main(int, char* []) BOOST_CHECK(check_same(make_policy(promote_float()), normalise > >::type())); BOOST_CHECK(check_same(make_policy(domain_error()), normalise > >::type())); BOOST_CHECK(check_same(make_policy(pole_error()), normalise > >::type())); + BOOST_CHECK(check_same(make_policy(indeterminate_result_error()), normalise > >::type())); BOOST_CHECK(check_same(make_policy(domain_error()), policy >())); BOOST_CHECK(check_same(make_policy(domain_error(), pole_error()), policy, pole_error >())); @@ -95,12 +101,13 @@ int test_main(int, char* []) BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error()), policy, pole_error, overflow_error, underflow_error >())); BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error()), policy, pole_error, overflow_error, underflow_error, denorm_error >())); BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error >())); - BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), digits2<10>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, digits2<10> >())); - BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), digits10<5>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, digits2<19> >())); - BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), digits2<10>(), promote_float()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, digits2<10>, promote_float >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10> >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits10<5>()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<19> >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float >())); #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS - BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), digits2<10>(), promote_float(), promote_double()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, digits2<10>, promote_float, promote_double >())); - BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), digits2<10>(), promote_float(), promote_double(), discrete_quantile()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, digits2<10>, promote_float, promote_double, discrete_quantile >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float(), promote_double()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float, promote_double >())); + BOOST_CHECK(check_same(make_policy(domain_error(), pole_error(), overflow_error(), underflow_error(), denorm_error(), evaluation_error(), indeterminate_result_error(), digits2<10>(), promote_float(), promote_double(), discrete_quantile()), policy, pole_error, overflow_error, underflow_error, denorm_error, evaluation_error, indeterminate_result_error, digits2<10>, promote_float, promote_double, discrete_quantile >())); #endif return 0; } // int test_main(int, char* [])