Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84324 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2013-05-17 07:02:35


Author: pbristow
Date: 2013-05-17 07:02:32 EDT (Fri, 17 May 2013)
New Revision: 84324
URL: http://svn.boost.org/trac/boost/changeset/84324

Log:
Changed links in examples to use def __ style links
Text files modified:
   trunk/libs/math/example/nc_chi_sq_example.cpp | 2
   trunk/libs/math/example/negative_binomial_example1.cpp | 134 +++++++++++++++++++--------------------
   trunk/libs/math/example/nonfinite_facet_simple.cpp | 14 ++-
   trunk/libs/math/example/normal_misc_examples.cpp | 105 +++++++++++++++---------------
   4 files changed, 127 insertions(+), 128 deletions(-)

Modified: trunk/libs/math/example/nc_chi_sq_example.cpp
==============================================================================
--- trunk/libs/math/example/nc_chi_sq_example.cpp (original)
+++ trunk/libs/math/example/nc_chi_sq_example.cpp 2013-05-17 07:02:32 EDT (Fri, 17 May 2013)
@@ -1,5 +1,5 @@
 // Copyright John Maddock 2008
-// Copyright Paul A. Bristow 2010
+// Copyright Paul A. Bristow 2010, 2013
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt

Modified: trunk/libs/math/example/negative_binomial_example1.cpp
==============================================================================
--- trunk/libs/math/example/negative_binomial_example1.cpp (original)
+++ trunk/libs/math/example/negative_binomial_example1.cpp 2013-05-17 07:02:32 EDT (Fri, 17 May 2013)
@@ -63,7 +63,7 @@
   using std::cout; using std::endl;
   using std::noshowpoint; using std::fixed; using std::right; using std::left;
 #include <iomanip>
- using std::setprecision; using std::setw;
+ using std::setprecision; using std::setw;
 
 #include <limits>
   using std::numeric_limits;
@@ -71,13 +71,13 @@
 
 int main()
 {
- cout <<"Selling candy bars - using the negative binomial distribution."
+ cout <<"Selling candy bars - using the negative binomial distribution."
     << "\nby Dr. Diane Evans,"
     "\nProfessor of Mathematics at Rose-Hulman Institute of Technology,"
     << "\nsee http://en.wikipedia.org/wiki/Negative_binomial_distribution\n"
     << endl;
   cout << endl;
- cout.precision(5);
+ cout.precision(5);
   // None of the values calculated have a useful accuracy as great this, but
   // INF shows wrongly with < 5 !
   // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=240227
@@ -122,7 +122,7 @@
 
     int all_houses = 30; // The number of houses on the estate.
 
- cout << "With a success rate of " << nb.success_fraction()
+ cout << "With a success rate of " << nb.success_fraction()
       << ", he might expect, on average,\n"
         "to need to visit about " << success_fraction * all_houses
         << " houses in order to sell all " << nb.successes() << " bars. " << endl;
@@ -131,14 +131,13 @@
 Pat has a sales per house success rate of 0.4.
 Therefore he would, on average, sell 40 bars after trying 100 houses.
 With a success rate of 0.4, he might expect, on average,
-to need to visit about 12 houses in order to sell all 5 bars.
+to need to visit about 12 houses in order to sell all 5 bars.
 ]
 
 The random variable of interest is the number of houses
 that must be visited to sell five candy bars,
 so we substitute k = n - 5 into a negative_binomial(5, 0.4)
-and obtain the [link math_toolkit.dist_ref.nmp.pdf probability mass (density) function (pdf or pmf)]
-of the distribution of houses visited.
+and obtain the __pdf of the distribution of houses visited.
 Obviously, the best possible case is that Pat makes sales on all the first five houses.
 
 We calculate this using the pdf function:
@@ -182,7 +181,7 @@
 ]
 
 Or, usually better, by using the negative binomial *cumulative* distribution function.
-*/
+*/
     cout << "\nProbability of selling his quota of " << sales_quota
       << " bars\non or before the " << 8 << "th house is "
       << cdf(nb, 8 - sales_quota) << endl;
@@ -222,14 +221,14 @@
 ]
 Finally consider the risk of Pat not selling his quota of 5 bars
 even after visiting all the houses.
-Calculate the probability that he /will/ sell on
+Calculate the probability that he /will/ sell on
 or before the last house:
 Calculate the probability that he would sell all his quota on the very last house.
 */
     cout << "Probability that Pat finishes on the " << all_houses
       << " house is " << pdf(nb, all_houses - sales_quota) << endl;
 /*`
-Probability of selling his quota of 5 bars on the 30th house is
+Probability of selling his quota of 5 bars on the 30th house is
 [pre
 Probability that Pat finishes on the 30 house is 0.00069145
 ]
@@ -237,7 +236,7 @@
 
 What is the probability that Pat exhausts all 30 houses in the neighborhood,
 and *still* doesn't sell the required 5 candy bars?
-*/
+*/
     cout << "\nProbability of selling his quota of " << sales_quota
       << " bars\non or before the " << all_houses << "th house is "
       << cdf(nb, all_houses - sales_quota) << endl;
@@ -252,10 +251,9 @@
 But using this expression may cause serious inaccuracy,
 so it would be much better to use the complement of the cdf:
 So the risk of failing even at, or after, the 31th (non-existent) houses is 1 - this probability,
- ``1 - cdf(nb, all_houses - sales_quota)``
-But using this expression may cause serious inaccuracy.
-So it would be much better to use the complement of the cdf.
-[link why_complements Why complements?]
+ ``1 - cdf(nb, all_houses - sales_quota)``
+But using this expression may cause serious inaccuracy.
+So it would be much better to use the __complement of the cdf (see __why_complements).
 */
     cout << "\nProbability of failing to sell his quota of " << sales_quota
       << " bars\neven after visiting all " << all_houses << " houses is "
@@ -268,7 +266,7 @@
 We can also use the quantile (percentile), the inverse of the cdf, to
 predict which house Pat will finish on. So for the 8th house:
 */
- double p = cdf(nb, (8 - sales_quota));
+ double p = cdf(nb, (8 - sales_quota));
  cout << "Probability of meeting sales quota on or before 8th house is "<< p << endl;
 /*`
 [pre
@@ -317,7 +315,7 @@
 If the opposite is true, we don't want to assume any confidence, then this is tantamount
 to assuming that all the first sales_quota trials will be successful sales.
 */
- cout << "If confidence of meeting quota is zero\n(we assume all houses are successful sales)"
+ cout << "If confidence of meeting quota is zero\n(we assume all houses are successful sales)"
       ", then finishing house is " << sales_quota << endl;
 /*`
 [pre
@@ -381,31 +379,31 @@
 /*`
 [pre
 House for 5 th (last) sale. Probability (%)
-5 0.01024
-6 0.04096
+5 0.01024
+6 0.04096
 7 0.096256
-8 0.17367
-9 0.26657
-10 0.3669
-11 0.46723
-12 0.56182
-13 0.64696
-14 0.72074
-15 0.78272
-16 0.83343
-17 0.874
-18 0.90583
-19 0.93039
-20 0.94905
-21 0.96304
-22 0.97342
-23 0.98103
-24 0.98655
-25 0.99053
-26 0.99337
-27 0.99539
-28 0.99681
-29 0.9978
+8 0.17367
+9 0.26657
+10 0.3669
+11 0.46723
+12 0.56182
+13 0.64696
+14 0.72074
+15 0.78272
+16 0.83343
+17 0.874
+18 0.90583
+19 0.93039
+20 0.94905
+21 0.96304
+22 0.97342
+23 0.98103
+24 0.98655
+25 0.99053
+26 0.99337
+27 0.99539
+28 0.99681
+29 0.9978
 30 0.99849
 ]
 
@@ -441,12 +439,12 @@
 Pat has a sales per house success rate of 0.4.
 Therefore he would, on average, sell 40 bars after trying 100 houses.
 With a success rate of 0.4, he might expect, on average,
-to need to visit about 12 houses in order to sell all 5 bars.
+to need to visit about 12 houses in order to sell all 5 bars.
 Probability that Pat finishes on the 5th house is 0.01024
 Probability that Pat finishes on the 6th house is 0.03072
 Probability that Pat finishes on the 7th house is 0.055296
 Probability that Pat finishes on the 8th house is 0.077414
-Probability that Pat finishes on or before the 8th house is sum
+Probability that Pat finishes on or before the 8th house is sum
 pdf(sales_quota) + pdf(6) + pdf(7) + pdf(8) = 0.17367
 Probability of selling his quota of 5 bars
 on or before the 8th house is 0.17367
@@ -485,32 +483,32 @@
 If confidence of meeting quota is 0.999, then finishing house is 31.1
 If confidence of meeting quota is 1, then finishing house is 1.#J
 House for 5th (last) sale. Probability (%)
-5 0.01024
-6 0.04096
+5 0.01024
+6 0.04096
 7 0.096256
-8 0.17367
-9 0.26657
-10 0.3669
-11 0.46723
-12 0.56182
-13 0.64696
-14 0.72074
-15 0.78272
-16 0.83343
-17 0.874
-18 0.90583
-19 0.93039
-20 0.94905
-21 0.96304
-22 0.97342
-23 0.98103
-24 0.98655
-25 0.99053
-26 0.99337
-27 0.99539
-28 0.99681
-29 0.9978
-30 0.99849
+8 0.17367
+9 0.26657
+10 0.3669
+11 0.46723
+12 0.56182
+13 0.64696
+14 0.72074
+15 0.78272
+16 0.83343
+17 0.874
+18 0.90583
+19 0.93039
+20 0.94905
+21 0.96304
+22 0.97342
+23 0.98103
+24 0.98655
+25 0.99053
+26 0.99337
+27 0.99539
+28 0.99681
+29 0.9978
+30 0.99849
 
 */
 

Modified: trunk/libs/math/example/nonfinite_facet_simple.cpp
==============================================================================
--- trunk/libs/math/example/nonfinite_facet_simple.cpp (original)
+++ trunk/libs/math/example/nonfinite_facet_simple.cpp 2013-05-17 07:02:32 EDT (Fri, 17 May 2013)
@@ -24,7 +24,7 @@
 and imbue input and output streams with the non_finite_num put and get facets.
 This allow output and input of infinity and NaN in a Standard portable way,
 This permits 'loop-back' of output back into input (and portably across different system too).
-This is particularly useful when used with Boost.Seralization so that non-finite NaNs and infinity
+This is particularly useful when used with Boost.Serialization so that non-finite NaNs and infinity
 values in text and xml archives can be handled correctly and portably.
 
 */
@@ -89,14 +89,15 @@
 
   // Output the nonfinite values using the current (default C) locale.
   // The default representations differ from system to system,
- // for example, using Microsoft compilers, 1.#INF, -1.#INF, and 1.#QNAN.
+ // for example, using Microsoft compilers, 1.#INF, -1.#INF, and 1.#QNAN,
+ // Linux "inf", "-inf", "nan"
   cout << "Using C locale" << endl;
   cout << "+std::numeric_limits<double>::infinity() = " << plus_infinity << endl;
   cout << "-std::numeric_limits<double>::infinity() = " << minus_infinity << endl;
   cout << "+std::numeric_limits<double>::quiet_NaN () = " << NaN << endl;
 
   // Display negated NaN.
- cout << "negated NaN " << negated_NaN << endl; // "-1.IND"
+ cout << "negated NaN " << negated_NaN << endl; // "-1.IND" or "-nan".
   
   // Create a new output locale, and add the nonfinite_num_put facet
   std::locale C99_out_locale (default_locale, new boost::math::nonfinite_num_put<char>);
@@ -106,14 +107,15 @@
   // Or for the same effect more concisely:
   cout.imbue (locale(locale(), new boost::math::nonfinite_num_put<char>));
 
- // Output using the new locale
+ // Output using the new locale:
   cout << "Using C99_out_locale " << endl;
   cout << "+std::numeric_limits<double>::infinity() = " << plus_infinity << endl;
   cout << "-std::numeric_limits<double>::infinity() = " << minus_infinity << endl;
   cout << "+std::numeric_limits<double>::quiet_NaN () = " << NaN << endl;
+ // Expect "inf", "-inf", "nan".
 
   // Display negated NaN.
- cout << "negated NaN " << negated_NaN << endl; // -nan
+ cout << "negated NaN " << negated_NaN << endl; // Expect "-nan".
 
   // Create a string with the expected C99 representation of plus infinity.
   std::string inf = "inf";
@@ -126,7 +128,7 @@
     // and read "inf" from the stringstream:
     iss >> infinity;
 
- // This will not work on all platforms!
+ // This will not work on all platforms! (Intel-Linux-13.0.1 fails EXIT STATUS: 139)
     if (! iss)
     { // Reading infinity went wrong!
       std::cerr << "C locale input format error!" << std::endl;

Modified: trunk/libs/math/example/normal_misc_examples.cpp
==============================================================================
--- trunk/libs/math/example/normal_misc_examples.cpp (original)
+++ trunk/libs/math/example/normal_misc_examples.cpp 2013-05-17 07:02:32 EDT (Fri, 17 May 2013)
@@ -36,8 +36,8 @@
   {
     { // Traditional tables and values.
 /*`Let's start by printing some traditional tables.
-*/
- double step = 1.; // in z
+*/
+ double step = 1.; // in z
       double range = 4; // min and max z = -range to +range.
       int precision = 17; // traditional tables are only computed to much lower precision.
       // but std::numeric_limits<double>::max_digits10; on new Standard Libraries gives
@@ -57,28 +57,28 @@
       cout.precision(5);
       for (double z = -range; z < range + step; z += step)
       {
- cout << left << setprecision(3) << setw(6) << z << " "
+ cout << left << setprecision(3) << setw(6) << z << " "
           << setprecision(precision) << setw(12) << pdf(s, z) << endl;
       }
       cout.precision(6); // default
       /*`And the area under the normal curve from -[infin] up to z,
       the cumulative distribution function (cdf).
 */
- // For a standard normal distribution
+ // For a standard normal distribution
       cout << "Standard normal mean = "<< s.mean()
         << ", standard deviation = " << s.standard_deviation() << endl;
       cout << "Integral (area under the curve) from - infinity up to z " << endl;
       cout << " z " " cdf " << endl;
       for (double z = -range; z < range + step; z += step)
       {
- cout << left << setprecision(3) << setw(6) << z << " "
+ cout << left << setprecision(3) << setw(6) << z << " "
           << setprecision(precision) << setw(12) << cdf(s, z) << endl;
       }
       cout.precision(6); // default
 
 /*`And all this you can do with a nanoscopic amount of work compared to
 the team of *human computers* toiling with Milton Abramovitz and Irene Stegen
-at the US National Bureau of Standards (now [@http://www.nist.gov NIST]).
+at the US National Bureau of Standards (now [@http://www.nist.gov NIST]).
 Starting in 1938, their "Handbook of Mathematical Functions with Formulas, Graphs and Mathematical Tables",
 was eventually published in 1964, and has been reprinted numerous times since.
 (A major replacement is planned at [@http://dlmf.nist.gov Digital Library of Mathematical Functions]).
@@ -86,7 +86,7 @@
 Pretty-printing a traditional 2-dimensional table is left as an exercise for the student,
 but why bother now that the Math Toolkit lets you write
 */
- double z = 2.;
+ double z = 2.;
     cout << "Area for z = " << z << " is " << cdf(s, z) << endl; // to get the area for z.
 /*`
 Correspondingly, we can obtain the traditional 'critical' values for significance levels.
@@ -111,7 +111,7 @@
 */
     double alpha1 = cdf(s, -1) * 2; // 0.3173105078629142
     cout << setprecision(17) << "Significance level for z == 1 is " << alpha1 << endl;
-/*`
+/*`
     and place in our array of favorite alpha values.
 */
     double alpha[] = {0.3173105078629142, // z for 1 standard deviation.
@@ -127,7 +127,7 @@
     for (int i = 0; i < sizeof(alpha)/sizeof(alpha[0]); ++i)
     {
       cout << setw(15) << alpha[i] << setw(15) << alpha[i] /2 << setw(10) << quantile(complement(s, alpha[i]/2)) << endl;
- // Use quantile(complement(s, alpha[i]/2)) to avoid potential loss of accuracy from quantile(s, 1 - alpha[i]/2)
+ // Use quantile(complement(s, alpha[i]/2)) to avoid potential loss of accuracy from quantile(s, 1 - alpha[i]/2)
     }
     cout << endl;
 
@@ -181,7 +181,7 @@
 [@http://en.wikipedia.org/wiki/Confidence_interval confidence intervals]
 by using cout.precision(15);
 
-[pre
+[pre
 Fraction 1 standard deviation within either side of mean is 0.682689492137086
 Fraction 2 standard deviations within either side of mean is 0.954499736103642
 Fraction 3 standard deviations within either side of mean is 0.997300203936740
@@ -209,7 +209,7 @@
 */
     double mean_life = 1100.;
     double life_standard_deviation = 100.;
- normal bulbs(mean_life, life_standard_deviation);
+ normal bulbs(mean_life, life_standard_deviation);
     double expected_life = 1000.;
 
 /*`The we can use the Cumulative distribution function to predict fractions
@@ -224,7 +224,7 @@
     cout << "Fraction of bulbs that will last between "
       << min_life << " and " << max_life << " is "
       << cdf(bulbs, max_life) // P(X <= 1200)
- - cdf(bulbs, min_life) << endl; // P(X <= 900)
+ - cdf(bulbs, min_life) << endl; // P(X <= 900)
 /*`
 [note Real-life failures are often very ab-normal,
 with a significant number that 'dead-on-arrival' or suffer failure very early in their life:
@@ -232,15 +232,15 @@
 */
 //] [/normal_bulbs_example1 Quickbook end]
   }
- {
+ {
     // K. Krishnamoorthy, Handbook of Statistical Distributions with Applications,
- // ISBN 1 58488 635 8, page 125, Example 10.3.6
+ // ISBN 1 58488 635 8, page 125, Example 10.3.6
 
 //[normal_bulbs_example3
 /*`Weekly demand for 5 lb sacks of onions at a store is normally distributed with mean 140 sacks and standard deviation 10.
 */
   double mean = 140.; // sacks per week.
- double standard_deviation = 10;
+ double standard_deviation = 10;
   normal sacks(mean, standard_deviation);
 
   double stock = 160.; // per week.
@@ -260,13 +260,13 @@
 //] [/normal_bulbs_example3 Quickbook end]
   }
   { // K. Krishnamoorthy, Handbook of Statistical Distributions with Applications,
- // ISBN 1 58488 635 8, page 125, Example 10.3.7
+ // ISBN 1 58488 635 8, page 125, Example 10.3.7
 
 //[normal_bulbs_example4
 
-/*`A machine is set to pack 3 kg of ground beef per pack.
+/*`A machine is set to pack 3 kg of ground beef per pack.
 Over a long period of time it is found that the average packed was 3 kg
-with a standard deviation of 0.1 kg.
+with a standard deviation of 0.1 kg.
 Assuming the packing is normally distributed,
 we can find the fraction (or %) of packages that weigh more than 3.1 kg.
 */
@@ -280,7 +280,7 @@
 << cdf(complement(packs, max_weight)) << endl; // P(X > 3.1)
 
 double under_weight = 2.9;
-cout <<"fraction of packs <= " << under_weight << " with a mean of " << mean
+cout <<"fraction of packs <= " << under_weight << " with a mean of " << mean
   << " is " << cdf(complement(packs, under_weight)) << endl;
 // fraction of packs <= 2.9 with a mean of 3 is 0.841345
 // This is 0.84 - more than the target 0.95
@@ -289,7 +289,7 @@
 double over_mean = 3.0664;
 normal xpacks(over_mean, standard_deviation);
 cout << "fraction of packs >= " << under_weight
-<< " with a mean of " << xpacks.mean()
+<< " with a mean of " << xpacks.mean()
   << " is " << cdf(complement(xpacks, under_weight)) << endl;
 // fraction of packs >= 2.9 with a mean of 3.06449 is 0.950005
 double under_fraction = 0.05; // so 95% are above the minimum weight mean - sd = 2.9
@@ -299,7 +299,7 @@
 
 normal nominal_packs(nominal_mean, standard_deviation);
 cout << "Setting the packer to " << nominal_mean << " will mean that "
- << "fraction of packs >= " << under_weight
+ << "fraction of packs >= " << under_weight
   << " is " << cdf(complement(nominal_packs, under_weight)) << endl;
 
 /*`
@@ -315,7 +315,7 @@
 */
 double p = 0.05; // wanted p th quantile.
 cout << "Quantile of " << p << " = " << quantile(packs, p)
- << ", mean = " << packs.mean() << ", sd = " << packs.standard_deviation() << endl; //
+ << ", mean = " << packs.mean() << ", sd = " << packs.standard_deviation() << endl; //
 /*`
 Quantile of 0.05 = 2.83551, mean = 3, sd = 0.1
 
@@ -325,14 +325,14 @@
 
 Let's start by guessing that it (now 0.1) needs to be halved, to a standard deviation of 0.05
 */
-normal pack05(mean, 0.05);
-cout << "Quantile of " << p << " = " << quantile(pack05, p)
+normal pack05(mean, 0.05);
+cout << "Quantile of " << p << " = " << quantile(pack05, p)
   << ", mean = " << pack05.mean() << ", sd = " << pack05.standard_deviation() << endl;
 
-cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
+cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
   << " and standard deviation of " << pack05.standard_deviation()
   << " is " << cdf(complement(pack05, under_weight)) << endl;
-//
+//
 /*`
 Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.05 is 0.9772
 
@@ -341,11 +341,11 @@
 more guessing to get closer, say by increasing to 0.06
 */
 
-normal pack06(mean, 0.06);
-cout << "Quantile of " << p << " = " << quantile(pack06, p)
+normal pack06(mean, 0.06);
+cout << "Quantile of " << p << " = " << quantile(pack06, p)
   << ", mean = " << pack06.mean() << ", sd = " << pack06.standard_deviation() << endl;
 
-cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
+cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
   << " and standard deviation of " << pack06.standard_deviation()
   << " is " << cdf(complement(pack06, under_weight)) << endl;
 /*`
@@ -353,13 +353,12 @@
 
 Now we are getting really close, but to do the job properly,
 we could use root finding method, for example the tools provided, and used elsewhere,
-in the Math Toolkit, see
-[link math_toolkit.internals1.roots2 Root Finding Without Derivatives].
+in the Math Toolkit, see __root_finding_without_derivatives.
 
 But in this normal distribution case, we could be even smarter and make a direct calculation.
 */
 
-normal s; // For standard normal distribution,
+normal s; // For standard normal distribution,
 double sd = 0.1;
 double x = 2.9; // Our required limit.
 // then probability p = N((x - mean) / sd)
@@ -373,11 +372,11 @@
 // Rearranging, we can directly calculate the required standard deviation:
 double sd95 = abs((x - mean)) / qp;
 
-cout << "If we want the "<< p << " th quantile to be located at "
+cout << "If we want the "<< p << " th quantile to be located at "
   << x << ", would need a standard deviation of " << sd95 << endl;
 
 normal pack95(mean, sd95); // Distribution of the 'ideal better' packer.
-cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
+cout <<"Fraction of packs >= " << under_weight << " with a mean of " << mean
   << " and standard deviation of " << pack95.standard_deviation()
   << " is " << cdf(complement(pack95, under_weight)) << endl;
 
@@ -398,16 +397,16 @@
     // ISBN 1 58488 635 8, page 125, example 10.3.8
 //[normal_bulbs_example5
 /*`A bolt is usable if between 3.9 and 4.1 long.
-From a large batch of bolts, a sample of 50 show a
+From a large batch of bolts, a sample of 50 show a
 mean length of 3.95 with standard deviation 0.1.
 Assuming a normal distribution, what proportion is usable?
-The true sample mean is unknown,
+The true sample mean is unknown,
 but we can use the sample mean and standard deviation to find approximate solutions.
 */
 
     normal bolts(3.95, 0.1);
     double top = 4.1;
- double bottom = 3.9;
+ double bottom = 3.9;
 
 cout << "Fraction long enough [ P(X <= " << top << ") ] is " << cdf(bolts, top) << endl;
 cout << "Fraction too short [ P(X <= " << bottom << ") ] is " << cdf(bolts, bottom) << endl;
@@ -419,13 +418,13 @@
   << cdf(complement(bolts, top)) << endl;
 
 cout << "95% of bolts are shorter than " << quantile(bolts, 0.95) << endl;
-
+
 //] [/normal_bulbs_example5 Quickbook end]
   }
   }
   catch(const std::exception& e)
- { // Always useful to include try & catch blocks because default policies
- // are to throw exceptions on arguments that cause errors like underflow, overflow.
+ { // Always useful to include try & catch blocks because default policies
+ // are to throw exceptions on arguments that cause errors like underflow, overflow.
     // Lacking try & catch blocks, the program will abort without a message below,
     // which may give some helpful clues as to the cause of the exception.
     std::cout <<
@@ -442,7 +441,7 @@
 Autorun "i:\boost-06-05-03-1300\libs\math\test\Math_test\debug\normal_misc_examples.exe"
 Example: Normal distribution, Miscellaneous Applications.Standard normal distribution, mean = 0, standard deviation = 1
 Probability distribution function values
- z pdf
+ z pdf
 -4 0.00013383022576488537
 -3 0.0044318484119380075
 -2 0.053990966513188063
@@ -453,13 +452,13 @@
 3 0.0044318484119380075
 4 0.00013383022576488537
 Standard normal mean = 0, standard deviation = 1
-Integral (area under the curve) from - infinity up to z
- z cdf
+Integral (area under the curve) from - infinity up to z
+ z cdf
 -4 3.1671241833119979e-005
 -3 0.0013498980316300959
 -2 0.022750131948179219
 -1 0.1586552539314571
-0 0.5
+0 0.5
 1 0.84134474606854293
 2 0.97724986805182079
 3 0.9986501019683699
@@ -469,15 +468,15 @@
 95% of area has a z between 1.95996 and -1.95996
 Significance level for z == 1 is 0.3173105078629142
 level of significance (alpha)
-2-sided 1 -sided z(alpha)
-0.3173 0.1587 1
-0.2 0.1 1.282
-0.1 0.05 1.645
-0.05 0.025 1.96
-0.01 0.005 2.576
-0.001 0.0005 3.291
-0.0001 5e-005 3.891
-1e-005 5e-006 4.417
+2-sided 1 -sided z(alpha)
+0.3173 0.1587 1
+0.2 0.1 1.282
+0.1 0.05 1.645
+0.05 0.025 1.96
+0.01 0.005 2.576
+0.001 0.0005 3.291
+0.0001 5e-005 3.891
+1e-005 5e-006 4.417
 cdf(s, s.standard_deviation()) = 0.841
 cdf(complement(s, s.standard_deviation())) = 0.159
 Fraction 1 standard deviation within either side of mean is 0.683


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk