SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 20th, 2016, 12:37 pm

QuoteOriginally posted by: outrunYes,.. that what's need to be done.I'm using this "casio" site a lot (the one from the 80s digital watches with a calculator in them!), it has all sorts of high precision calculators:http://keisan.casio.com/exec/system/1180573449erf(0.01) = 0.011283415555849616915909523548069210949100954830116erf(0.1) = 0.1124629160182848922032750717439683832216962991597erf(0.2) = 0.22270258921047845414013900680014381638826903843023erf(0.8) = 0.74210096470766048616711058650294587731768957991471erf(2.0) = 0.99532226501895273416206925636725292861089179704006erf(4.0) = 0.99999998458274209971998114784032651311595142785475Why is accuracy important in this case?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 20th, 2016, 1:39 pm

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunYes,.. that what's need to be done.I'm using this "casio" site a lot (the one from the 80s digital watches with a calculator in them!), it has all sorts of high precision calculators:http://keisan.casio.com/exec/system/1180573449erf(0.01) = 0.011283415555849616915909523548069210949100954830116erf(0.1) = 0.1124629160182848922032750717439683832216962991597erf(0.2) = 0.22270258921047845414013900680014381638826903843023erf(0.8) = 0.74210096470766048616711058650294587731768957991471erf(2.0) = 0.99532226501895273416206925636725292861089179704006erf(4.0) = 0.99999998458274209971998114784032651311595142785475Why is accuracy important in this case?It's for some high precision hobby project that I want to work on at some point in the future when I have more time. The idea is to sell it and retire of course.I see. Have you tried "Dragons' Den"?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 20th, 2016, 8:40 pm

QuoteOriginally posted by: CuchulainnQuoteI also want to know this: * is erf slow compared to boost?* does is give valid (accurate, 80 bit) results for "long double"?* does boost multiprecision overload the std::erf for the multiprecision type? Or do I need to use boost:erf?Should be easy to determine. Boost mailing. A statistical regression framework is needed, does such a framework exist? My feeling is NO.So, press a button, let code run for 2 hours and look at report "std erf 20% slower than boost erf" etc.upper estimate possible. As well as accuracy estimate.These tests take about [8,24] manhours?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 21st, 2016, 6:15 am

In 2006, BoostQuoteRewrite erf/erfc as rational approximations (valid to 128-bit precision). ?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 22nd, 2016, 10:43 am

AFAIK, Boost multiprecision does not support erf(x) (but it does support exp(x):)) but if you want high precision you could try1) Convert erf(x) to an initial value problem du/dt = .. exp(-x^2), u(-infinity) = 02) Solve IVP using Boost odeint that supports multiprecision. Have you tried any of these libraries
Last edited by Cuchulainn on January 21st, 2016, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 22nd, 2016, 1:28 pm

QuoteOriginally posted by: outrunThanks. Ik think eg 2) here (pdf) is good. Looks simple.I notices that boost multiprecision has a set of eval_cos() eval_atan2() routines in the detail namespace, it would be nice to add erf to that list.Looks doable.Maybe accelerate the series summation with Shanks transformation?
Last edited by Cuchulainn on January 21st, 2016, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 22nd, 2016, 3:22 pm

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunThanks. Ik think eg 2) here (pdf) is good. Looks simple.I notices that boost multiprecision has a set of eval_cos() eval_atan2() routines in the detail namespace, it would be nice to add erf to that list.Looks doable.Maybe accelerate the series summation with Shanks transformation?That would be a nice innovation!I have a feeling that something like Kahan summation is also needed as well?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

ISO C++11 published

January 22nd, 2016, 3:55 pm

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunThanks. Ik think eg 2) here (pdf) is good. Looks simple.I notices that boost multiprecision has a set of eval_cos() eval_atan2() routines in the detail namespace, it would be nice to add erf to that list.Looks doable.Maybe accelerate the series summation with Shanks transformation?That would be a nice innovation!I have a feeling that something like Kahan summation is also needed as well?Full precision (up to the number of digits of the float) is actually the main topic of that paper.Clear. But can round-off error creep into the computations and hence compromise the accuracy?
Last edited by Cuchulainn on January 21st, 2016, 11:00 pm, edited 1 time in total.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On