Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82567 - trunk/boost/math/special_functions/detail
From: john_at_[hidden]
Date: 2013-01-20 12:10:18


Author: johnmaddock
Date: 2013-01-20 12:10:18 EST (Sun, 20 Jan 2013)
New Revision: 82567
URL: http://svn.boost.org/trac/boost/changeset/82567

Log:
Fix comments in code.
Text files modified:
   trunk/boost/math/special_functions/detail/bessel_jy_asym.hpp | 17 +++++++++++------
   1 files changed, 11 insertions(+), 6 deletions(-)

Modified: trunk/boost/math/special_functions/detail/bessel_jy_asym.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/bessel_jy_asym.hpp (original)
+++ trunk/boost/math/special_functions/detail/bessel_jy_asym.hpp 2013-01-20 12:10:18 EST (Sun, 20 Jan 2013)
@@ -99,13 +99,14 @@
    //
    // Calculate the phase of J(v, x) and Y(v, x) for large x.
    // See A&S 9.2.29.
- // Note that the result returned is the phase less x.
+ // Note that the result returned is the phase less (x - PI(v/2 + 1/4))
+ // which we'll factor in later when we calculate the sines/cosines of the result:
    //
    T mu = 4 * v * v;
    T denom = 4 * x;
    T denom_mult = denom * denom;
 
- T s = 0; //-constants::pi<T>() * (v / 2 + 0.25f);
+ T s = 0;
    s += (mu - 1) / (2 * denom);
    denom *= denom_mult;
    s += (mu - 1) * (mu - 25) / (6 * denom);
@@ -127,8 +128,10 @@
    BOOST_MATH_INSTRUMENT_VARIABLE(ampl);
    BOOST_MATH_INSTRUMENT_VARIABLE(phase);
    //
- // Calculate the sine of the phase, using:
- // sin(x+p) = sin(x)cos(p) + cos(x)sin(p)
+ // Calculate the sine of the phase, using
+ // sine/cosine addition rules to factor in
+ // the x - PI(v/2 + 1/4) term not added to the
+ // phase when we calculated it.
    //
    T cx = cos(x);
    T sx = sin(x);
@@ -153,8 +156,10 @@
    BOOST_MATH_INSTRUMENT_VARIABLE(ampl);
    BOOST_MATH_INSTRUMENT_VARIABLE(phase);
    //
- // Calculate the sine of the phase, using:
- // cos(x+p) = cos(x)cos(p) - sin(x)sin(p)
+ // Calculate the sine of the phase, using
+ // sine/cosine addition rules to factor in
+ // the x - PI(v/2 + 1/4) term not added to the
+ // phase when we calculated it.
    //
    BOOST_MATH_INSTRUMENT_CODE(cos(phase));
    BOOST_MATH_INSTRUMENT_CODE(cos(x));


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