From cd64856ff5e3004dadec5e59e8cb04f0cd811c8f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 27 Jan 2010 13:16:14 +0000 Subject: [PATCH] Improve the performance of the Bessel functions, and update docs. [SVN r59274] --- doc/sf_and_dist/html/index.html | 12 +- .../html/math_toolkit/backgrounders.html | 6 +- .../backgrounders/implementation.html | 36 +- .../math_toolkit/backgrounders/lanczos.html | 20 +- .../html/math_toolkit/backgrounders/refs.html | 12 +- .../backgrounders/relative_error.html | 8 +- .../math_toolkit/backgrounders/remez.html | 22 +- doc/sf_and_dist/html/math_toolkit/dist.html | 6 +- .../html/math_toolkit/dist/dist_ref.html | 6 +- .../dist/dist_ref/dist_algorithms.html | 12 +- .../math_toolkit/dist/dist_ref/dists.html | 6 +- .../dist/dist_ref/dists/bernoulli_dist.html | 16 +- .../dist/dist_ref/dists/beta_dist.html | 26 +- .../dist/dist_ref/dists/binomial_dist.html | 32 +- .../dist/dist_ref/dists/cauchy_dist.html | 18 +- .../dist/dist_ref/dists/chi_squared_dist.html | 18 +- .../dist/dist_ref/dists/exp_dist.html | 16 +- .../dist/dist_ref/dists/extreme_dist.html | 14 +- .../dist/dist_ref/dists/f_dist.html | 16 +- .../dist/dist_ref/dists/gamma_dist.html | 14 +- .../dist_ref/dists/hypergeometric_dist.html | 16 +- .../dist/dist_ref/dists/laplace_dist.html | 16 +- .../dist/dist_ref/dists/logistic_dist.html | 14 +- .../dist/dist_ref/dists/lognormal_dist.html | 14 +- .../dist/dist_ref/dists/nc_beta_dist.html | 18 +- .../dist_ref/dists/nc_chi_squared_dist.html | 20 +- .../dist/dist_ref/dists/nc_f_dist.html | 16 +- .../dist/dist_ref/dists/nc_t_dist.html | 18 +- .../dists/negative_binomial_dist.html | 30 +- .../dist/dist_ref/dists/normal_dist.html | 14 +- .../dist/dist_ref/dists/pareto.html | 18 +- .../dist/dist_ref/dists/poisson_dist.html | 16 +- .../dist/dist_ref/dists/rayleigh.html | 18 +- .../dist/dist_ref/dists/students_t_dist.html | 16 +- .../dist/dist_ref/dists/triangular_dist.html | 16 +- .../dist/dist_ref/dists/uniform_dist.html | 16 +- .../dist/dist_ref/dists/weibull.html | 18 +- .../html/math_toolkit/dist/dist_ref/nmp.html | 60 ++-- .../html/math_toolkit/dist/future.html | 14 +- .../html/math_toolkit/dist/stat_tut.html | 6 +- .../dist/stat_tut/dist_params.html | 6 +- .../math_toolkit/dist/stat_tut/overview.html | 6 +- .../dist/stat_tut/overview/complements.html | 6 +- .../dist/stat_tut/overview/generic.html | 6 +- .../dist/stat_tut/overview/headers.html | 6 +- .../dist/stat_tut/overview/objects.html | 6 +- .../dist/stat_tut/overview/parameters.html | 6 +- .../dist/stat_tut/overview/summary.html | 6 +- .../math_toolkit/dist/stat_tut/variates.html | 6 +- .../html/math_toolkit/dist/stat_tut/weg.html | 6 +- .../dist/stat_tut/weg/binom_eg.html | 6 +- .../stat_tut/weg/binom_eg/binom_conf.html | 6 +- .../stat_tut/weg/binom_eg/binom_size_eg.html | 6 +- .../binom_eg/binomial_coinflip_example.html | 6 +- .../weg/binom_eg/binomial_quiz_example.html | 10 +- .../dist/stat_tut/weg/c_sharp.html | 6 +- .../math_toolkit/dist/stat_tut/weg/cs_eg.html | 6 +- .../stat_tut/weg/cs_eg/chi_sq_intervals.html | 8 +- .../dist/stat_tut/weg/cs_eg/chi_sq_size.html | 6 +- .../dist/stat_tut/weg/cs_eg/chi_sq_test.html | 6 +- .../dist/stat_tut/weg/dist_construct_eg.html | 8 +- .../dist/stat_tut/weg/error_eg.html | 6 +- .../math_toolkit/dist/stat_tut/weg/f_eg.html | 6 +- .../dist/stat_tut/weg/find_eg.html | 6 +- .../weg/find_eg/find_location_eg.html | 8 +- .../weg/find_eg/find_mean_and_sd_eg.html | 12 +- .../stat_tut/weg/find_eg/find_scale_eg.html | 8 +- .../dist/stat_tut/weg/nag_library.html | 6 +- .../dist/stat_tut/weg/nccs_eg.html | 6 +- .../stat_tut/weg/nccs_eg/nccs_power_eg.html | 6 +- .../dist/stat_tut/weg/neg_binom_eg.html | 6 +- .../weg/neg_binom_eg/neg_binom_conf.html | 6 +- .../weg/neg_binom_eg/neg_binom_size_eg.html | 6 +- .../negative_binomial_example1.html | 6 +- .../negative_binomial_example2.html | 6 +- .../dist/stat_tut/weg/normal_example.html | 6 +- .../weg/normal_example/normal_misc.html | 20 +- .../math_toolkit/dist/stat_tut/weg/st_eg.html | 6 +- .../dist/stat_tut/weg/st_eg/paired_st.html | 6 +- .../weg/st_eg/tut_mean_intervals.html | 6 +- .../stat_tut/weg/st_eg/tut_mean_size.html | 6 +- .../stat_tut/weg/st_eg/tut_mean_test.html | 6 +- .../weg/st_eg/two_sample_students_t.html | 6 +- .../html/math_toolkit/extern_c.html | 6 +- .../html/math_toolkit/extern_c/c99.html | 10 +- .../html/math_toolkit/extern_c/tr1.html | 16 +- .../html/math_toolkit/extern_c/tr1_ref.html | 12 +- .../html/math_toolkit/main_overview.html | 6 +- .../math_toolkit/main_overview/building.html | 12 +- .../main_overview/compilers_overview.html | 10 +- .../math_toolkit/main_overview/contact.html | 6 +- .../main_overview/directories.html | 10 +- .../main_overview/error_handling.html | 46 +-- .../math_toolkit/main_overview/history1.html | 28 +- .../math_toolkit/main_overview/intro.html | 12 +- .../main_overview/namespaces.html | 6 +- .../main_overview/navigation.html | 8 +- .../math_toolkit/main_overview/perf_over.html | 6 +- .../main_overview/pol_overview.html | 6 +- .../main_overview/result_type.html | 6 +- .../math_toolkit/main_overview/threads.html | 6 +- .../html/math_toolkit/main_overview/tr1.html | 16 +- doc/sf_and_dist/html/math_toolkit/perf.html | 6 +- .../math_toolkit/perf/comp_compilers.html | 16 +- .../html/math_toolkit/perf/comparisons.html | 339 ++++++++++++++++-- .../html/math_toolkit/perf/getting_best.html | 12 +- .../html/math_toolkit/perf/interp.html | 6 +- .../html/math_toolkit/perf/perf_over.html | 6 +- .../html/math_toolkit/perf/perf_test_app.html | 6 +- .../html/math_toolkit/perf/tuning.html | 10 +- doc/sf_and_dist/html/math_toolkit/policy.html | 6 +- .../math_toolkit/policy/pol_overview.html | 6 +- .../html/math_toolkit/policy/pol_ref.html | 6 +- .../policy/pol_ref/assert_undefined.html | 6 +- .../policy/pol_ref/discrete_quant_ref.html | 18 +- .../pol_ref/error_handling_policies.html | 20 +- .../policy/pol_ref/internal_promotion.html | 8 +- .../policy/pol_ref/iteration_pol.html | 6 +- .../policy/pol_ref/namespace_pol.html | 6 +- .../policy/pol_ref/pol_ref_ref.html | 6 +- .../policy/pol_ref/policy_defaults.html | 38 +- .../policy/pol_ref/precision_pol.html | 6 +- .../math_toolkit/policy/pol_tutorial.html | 6 +- .../pol_tutorial/ad_hoc_dist_policies.html | 6 +- .../pol_tutorial/ad_hoc_sf_policies.html | 6 +- .../changing_policy_defaults.html | 6 +- .../pol_tutorial/namespace_policies.html | 6 +- .../pol_tutorial/policy_tut_defaults.html | 6 +- .../policy/pol_tutorial/policy_usage.html | 6 +- .../pol_tutorial/understand_dis_quant.html | 8 +- .../policy/pol_tutorial/user_def_err_pol.html | 6 +- .../policy/pol_tutorial/what_is_a_policy.html | 6 +- .../html/math_toolkit/special.html | 6 +- .../html/math_toolkit/special/bessel.html | 6 +- .../math_toolkit/special/bessel/bessel.html | 20 +- .../special/bessel/bessel_over.html | 12 +- .../math_toolkit/special/bessel/mbessel.html | 20 +- .../special/bessel/sph_bessel.html | 16 +- .../html/math_toolkit/special/ellint.html | 6 +- .../math_toolkit/special/ellint/ellint_1.html | 18 +- .../math_toolkit/special/ellint/ellint_2.html | 18 +- .../math_toolkit/special/ellint/ellint_3.html | 22 +- .../special/ellint/ellint_carlson.html | 18 +- .../special/ellint/ellint_intro.html | 18 +- .../html/math_toolkit/special/expint.html | 6 +- .../math_toolkit/special/expint/expint_i.html | 22 +- .../math_toolkit/special/expint/expint_n.html | 18 +- .../html/math_toolkit/special/factorials.html | 6 +- .../special/factorials/sf_binomial.html | 12 +- .../factorials/sf_double_factorial.html | 12 +- .../special/factorials/sf_factorial.html | 16 +- .../factorials/sf_falling_factorial.html | 12 +- .../factorials/sf_rising_factorial.html | 12 +- .../html/math_toolkit/special/inv_hyper.html | 6 +- .../math_toolkit/special/inv_hyper/acosh.html | 12 +- .../math_toolkit/special/inv_hyper/asinh.html | 12 +- .../math_toolkit/special/inv_hyper/atanh.html | 12 +- .../special/inv_hyper/inv_hyper_over.html | 6 +- .../html/math_toolkit/special/powers.html | 6 +- .../math_toolkit/special/powers/cbrt.html | 10 +- .../math_toolkit/special/powers/ct_pow.html | 22 +- .../math_toolkit/special/powers/expm1.html | 10 +- .../math_toolkit/special/powers/hypot.html | 8 +- .../math_toolkit/special/powers/log1p.html | 10 +- .../math_toolkit/special/powers/powm1.html | 10 +- .../math_toolkit/special/powers/sqrt1pm1.html | 10 +- .../html/math_toolkit/special/sf_beta.html | 6 +- .../special/sf_beta/beta_derivative.html | 14 +- .../special/sf_beta/beta_function.html | 18 +- .../special/sf_beta/ibeta_function.html | 24 +- .../special/sf_beta/ibeta_inv_function.html | 16 +- .../html/math_toolkit/special/sf_erf.html | 6 +- .../special/sf_erf/error_function.html | 20 +- .../special/sf_erf/error_inv.html | 16 +- .../html/math_toolkit/special/sf_gamma.html | 6 +- .../special/sf_gamma/digamma.html | 16 +- .../special/sf_gamma/gamma_derivatives.html | 14 +- .../special/sf_gamma/gamma_ratios.html | 18 +- .../math_toolkit/special/sf_gamma/igamma.html | 26 +- .../special/sf_gamma/igamma_inv.html | 16 +- .../math_toolkit/special/sf_gamma/lgamma.html | 16 +- .../math_toolkit/special/sf_gamma/tgamma.html | 16 +- .../html/math_toolkit/special/sf_poly.html | 6 +- .../math_toolkit/special/sf_poly/hermite.html | 18 +- .../special/sf_poly/laguerre.html | 20 +- .../special/sf_poly/legendre.html | 22 +- .../special/sf_poly/sph_harm.html | 18 +- .../html/math_toolkit/special/sinc.html | 6 +- .../special/sinc/sinc_overview.html | 6 +- .../math_toolkit/special/sinc/sinc_pi.html | 6 +- .../math_toolkit/special/sinc/sinhc_pi.html | 6 +- .../html/math_toolkit/special/zetas.html | 6 +- .../html/math_toolkit/special/zetas/zeta.html | 18 +- doc/sf_and_dist/html/math_toolkit/status.html | 6 +- .../html/math_toolkit/status/compilers.html | 10 +- .../html/math_toolkit/status/credits.html | 8 +- .../html/math_toolkit/status/history1.html | 28 +- .../html/math_toolkit/status/issues.html | 22 +- .../html/math_toolkit/toolkit.html | 6 +- .../html/math_toolkit/toolkit/internals1.html | 6 +- .../math_toolkit/toolkit/internals1/cf.html | 14 +- .../toolkit/internals1/constants.html | 10 +- .../toolkit/internals1/minima.html | 12 +- .../toolkit/internals1/rational.html | 12 +- .../toolkit/internals1/roots.html | 18 +- .../toolkit/internals1/roots2.html | 12 +- .../toolkit/internals1/series_evaluation.html | 12 +- .../html/math_toolkit/toolkit/internals2.html | 6 +- .../toolkit/internals2/error_test.html | 12 +- .../toolkit/internals2/minimax.html | 6 +- .../toolkit/internals2/polynomials.html | 10 +- .../toolkit/internals2/test_data.html | 18 +- .../toolkit/internals_overview.html | 6 +- .../html/math_toolkit/using_udt.html | 6 +- .../math_toolkit/using_udt/archetypes.html | 6 +- .../html/math_toolkit/using_udt/concepts.html | 10 +- .../math_toolkit/using_udt/dist_concept.html | 6 +- .../html/math_toolkit/using_udt/use_mpfr.html | 6 +- .../html/math_toolkit/using_udt/use_ntl.html | 6 +- doc/sf_and_dist/html/math_toolkit/utils.html | 6 +- .../html/math_toolkit/utils/fpclass.html | 10 +- .../html/math_toolkit/utils/next_float.html | 6 +- .../utils/next_float/float_advance.html | 10 +- .../utils/next_float/float_distance.html | 10 +- .../utils/next_float/float_next.html | 10 +- .../utils/next_float/float_prior.html | 10 +- .../utils/next_float/nextafter.html | 12 +- .../html/math_toolkit/utils/rounding.html | 6 +- .../math_toolkit/utils/rounding/modf.html | 6 +- .../math_toolkit/utils/rounding/round.html | 6 +- .../math_toolkit/utils/rounding/trunc.html | 6 +- .../math_toolkit/utils/sign_functions.html | 10 +- doc/sf_and_dist/performance.qbk | 75 +++- .../boost/math/special_functions/bessel.hpp | 28 +- .../special_functions/detail/bessel_jn.hpp | 5 + .../special_functions/detail/bessel_jy.hpp | 181 +++++++--- .../math/special_functions/detail/iconv.hpp | 41 +++ .../detail/simple_complex.hpp | 172 --------- performance/test_bessel.cpp | 313 ++++++++++++++++ performance/test_erf.cpp | 18 +- performance/test_expm1_log1p.cpp | 84 +++++ 241 files changed, 2296 insertions(+), 1616 deletions(-) create mode 100644 include/boost/math/special_functions/detail/iconv.hpp delete mode 100644 include/boost/math/special_functions/detail/simple_complex.hpp create mode 100644 performance/test_bessel.cpp diff --git a/doc/sf_and_dist/html/index.html b/doc/sf_and_dist/html/index.html index 8ad0bfd5f..a6057022a 100644 --- a/doc/sf_and_dist/html/index.html +++ b/doc/sf_and_dist/html/index.html @@ -1,6 +1,6 @@ - + Math Toolkit @@ -40,7 +40,7 @@ Bruno Lalande

-Johan Råde +Johan Råde

Gautam Sewani @@ -49,11 +49,11 @@ Thijs van den Berg

-
-

+

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)

@@ -488,7 +488,7 @@

- +

Last revised: October 21, 2009 at 14:25:43 GMT

Last revised: January 27, 2010 at 12:23:42 GMT


diff --git a/doc/sf_and_dist/html/math_toolkit/backgrounders.html b/doc/sf_and_dist/html/math_toolkit/backgrounders.html index 4c401eb83..a1eef1c96 100644 --- a/doc/sf_and_dist/html/math_toolkit/backgrounders.html +++ b/doc/sf_and_dist/html/math_toolkit/backgrounders.html @@ -1,6 +1,6 @@ - + Backgrounders @@ -38,8 +38,8 @@
-
- + 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
@@ -737,7 +737,7 @@ done HTML: this needs further investigation.

- + Producing Graphs
@@ -754,8 +754,8 @@ done -
- + 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 53. 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 54. 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
    @@ -561,8 +561,8 @@
-
- + 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

@@ -161,8 +161,8 @@ -
-
- + 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

@@ -527,8 +527,8 @@ -
-
-
- + 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
@@ -130,8 +130,8 @@ -
-
- + References
    @@ -339,8 +339,8 @@
-
- + References

@@ -615,8 +615,8 @@ from presumed-known mean and variance. -

- + 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 11. 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
    @@ -907,8 +907,8 @@
-
- + References
    @@ -291,8 +291,8 @@
-
- + References
    @@ -394,8 +394,8 @@ independent, normally distributed random
-
- + references
    @@ -310,8 +310,8 @@
-
-
-
-
- + Accuracy

@@ -211,7 +211,7 @@ meaningless for N >= 1015.

- + Testing

@@ -223,7 +223,7 @@ this implementation and NTL::RR.

- + Implementation

@@ -328,8 +328,8 @@ -

- + References
    @@ -354,8 +354,8 @@
-