Google Summer of Code 2013 - Boost.org - Boost.Multiprecision
Hi! I am a CS undergraduate student and I really want to work on Boost.Multiprecisionhttps://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. I like learning new things and trying to find out better ways of doing existing things. I like coding and listening to music (sometimes simultaneously too). Greetings to the entire Boost community. And Thank you! I really appreciate the great work Boost is doing for the rest of us, and I want to be on the other side now, and do something for the rest of them. 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. Thanking you all once again, Best regards, Saurav
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Saurav Sent: Friday, April 12, 2013 9:20 AM To: boost@lists.boost.org 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.Multiprecisionhttps://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@hetp.u-net.com
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
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Saurav Sent: Friday, April 12, 2013 9:20 AM To: boost@lists.boost.org 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@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
I wish to get through to Christopher Kormanyos, the mentor for the project I am interested in, to discuss more specifically about the further steps.
Thanking you all once again, Best regards, Saurav
Hi Sauav, you got through to me. I just had an extremely long day, so we can't get into details today. You should try to look into the book that I linked in the project description and be in a position to describe how you might tackle some of these algorithms. In addition, you should try to get a simple project up and running that simply *uses* and tests Boost.Multiprecision's cpp_dec_float. Try a Gamma function, or Bessel functions. Verify the results with, for example, Wolfram's Alpha. Please try to provide me with some coding and descriptions that give more clear a picture of your qualifications for this project. Best regards, Chris.
Hi Christopher! Thanks for your reply. You should try to look into the book that I linked
in the project description and be in a position to describe how you might tackle some of these algorithms.
Currently I am going through the code, documents and PDF file which contains the algorithms. Please suggest next steps as you find appropriate.
In addition, you should try to get a simple project up and running that simply *uses* and tests Boost.Multiprecision's cpp_dec_float.
Try a Gamma function, or Bessel functions. Verify the results with, for example, Wolfram's Alpha.
I have attached the zip file containing the assignment. It contains 4 files:
- sample_use_boost_float.hpp - [1] - test_sample_use_boost_float.cpp - [2] - output1.txt - [3] - output2.txt - [4] The header only file [1] contains the template class definition for the following: - Bessel functions (1st and 2nd kind) - Gamma function - sinc() function In addition, zip file contains the tests [2] for multiprecision float expressions of the aforementioned functions. The results have been tested against values directly from Wolfram Alpha. [3] is the console output on a successful run of tests. [4] has been also provided for example output of unsuccessful run of tests. Kindly have a look and comment. Best regards, Saurav
participants (3)
-
Christopher Kormanyos
-
Paul A. Bristow
-
Saurav