Boost logo

Boost :

Subject: Re: [boost] Google Summer of Code 2013 - Boost.org - Boost.Multiprecision
From: Saurav (online.saurav_at_[hidden])
Date: 2013-04-14 06:41:41


Thanks for your reply Paul.

I have attached the zip file containing the assignment. I haven't yet
written the Boost.Test. It is because I am still learning how to use
Boost.Test. I will try to do that soon and send that too.

The attached code contains a template for sinc (x) = sin(x) / (x). The
template looks this:

template<typename T>
inline T sinc(T r)
{
    T temp = sin(r)/r;
    if (temp > std::numeric_limits<T>::epsilon())
        return temp;
    else
        return 1;
}

   - the angle *r* has generic type *T*, and so is the output *sinc(r)*
   - *T *can be *float*, *double*, *long double* or *cpp_dec_float_50*
   - Results are checked against precision of corresponding data type used
   and sinc(x) is returned as *1* for precisions exceeding that which is
   permissible for the given data type
   - For negative arguments, sinc(-r), r>0 is equivalent to sin(-r) / (-r)
   which is equivalent to - sin(r) / (-r) = sinc(r). This is because sinc(r)
   is an even function

I am currently going through the two documents and *cpp_dec_float.hpp*.
Please also suggest further pointers that you may find appropriate.

Best regards,
Saurav

On Fri, Apr 12, 2013 at 3:45 AM, Paul A. Bristow <pbristow_at_[hidden]>wrote:

> > -----Original Message-----
> > From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Saurav
> > Sent: Friday, April 12, 2013 9:20 AM
> > To: boost_at_[hidden]
> > Subject: [boost] Google Summer of Code 2013 - Boost.org -
> Boost.Multiprecision
> >
> > Hi!
> >
> > I am a CS undergraduate student and I really want to work on
> > Boost.Multiprecision<
> https://svn.boost.org/trac/boost/wiki/SoC2013#Boost.Multiprecision>.
> > C++ has been my favorite programming language and I find GSoC 2013 a
> > wonderful opportunity to create something valuable with it, while
> getting some 'value' out of it
> for myself.
>
> > That's all from my side. I wish to get through to Christopher Kormanyo,
> the mentor for the project
> I am
> > interested in, to discuss more specifically about the further steps.
> >
> I hope you are studying
>
> https://svn.boost.org/trac/boost/wiki/SoC2013#Boost.Multiprecision
>
>
> http://www.boost.org/doc/libs/1_53_0/libs/multiprecision/doc/html/index.html
>
> and especially
>
> http://www.loria.fr/~zimmerma/mca/mca-cup-0.5.1.pdf
>
> If you study the existing decimal (radix = 10) implementation, you will
> see that multiprecision
> makes it rather complicated, even if the underlying algorithms are not.
>
> It must be specific for radix = 2 to be fast.
>
> Ask again if you are still interested after studying these documents, and
> some of the code.
>
> It would be useful to see if you can build some of the examples using
> Boost.Multiprecision decimal,
> perhaps using a Boost.Math function or two. Extra marks for devising and
> running a Boost.Test for
> what you compute.
>
> You could send or post a zip of your files and output.
>
> And/or you might also try out this example:
>
> ------------------------------------------------------------
>
> Consider the sinc function known from fields such
> as optics, scattering, and radiation theory.
>
> sinc(x) = sin(x) / x
>
> Write a C++ program with a single template for
> the sinc function that handles float, double, long double,
> and the cpp_dec_float_50 type from Boost.Multiprecision.
>
> Please handle negative arguments elegantly using
> simple reflection.
>
> For arguments very close to zero, use
> std::numeric_limits<T>::epsilon() to find the
> cutoff where the function should return 1.
>
> Describe in a few sentences how your solution uses
> templates to create a generic numerical program for
> the sinc function.
>
> Verify your numerical results for all four
> data types, for example, with data from
> Wolfram's Alpha.
>
> The command:
>
> Table[N[Sin[x]/x, 60], {x, Pi/32, Pi/2, Pi/32}]
>
> will create a nice data table with 60 decimal digits
> of precision. The value at x = 0 is, of course, 1.
>
> Have fun!
>
> Paul
>
> ---
> Paul A. Bristow,
> Prizet Farmhouse, Kendal LA8 8AB UK
> +44 1539 561830 07714330204
> pbristow_at_[hidden]
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk