February 28th, 2014, 09:54 AM  #1 
Senior Member Joined: Dec 2013 From: some subspace Posts: 212 Thanks: 72 Math Focus: real analysis, vector analysis, numerical analysis, discrete mathematics  Computing the error function
My first question here... I was coding an application that involves the computation of error function I'd need an accuracy (absolute error) of at least, preferably . At this point, I've tried Maclaurin serie, asymptotic serie and trapetzoid rule of integration but there were problems in accuracy and convergence in this interval. Currently the best absolute error I can get, is . Any ideas what kind of method to use next? 
February 28th, 2014, 10:04 AM  #2 
Global Moderator Joined: Nov 2006 From: UTC 5 Posts: 16,046 Thanks: 938 Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms  Re: Computing the error function
Well, I suggest PARI/GP (see my .sig below): Code: > 1erfc(.5) %1 = 0.5204998778130465376827466538919645287364515757579637000588057256471935 
February 28th, 2014, 12:02 PM  #3 
Senior Member Joined: Dec 2013 From: some subspace Posts: 212 Thanks: 72 Math Focus: real analysis, vector analysis, numerical analysis, discrete mathematics  Re: Computing the error function
Thank you, but well, I'd believe, that's not allowed since we have to code our own program and prosedures to do things. But the algorithm they are using sounds pretty interesting. 
February 28th, 2014, 01:50 PM  #4 
Global Moderator Joined: Nov 2006 From: UTC 5 Posts: 16,046 Thanks: 938 Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms  Re: Computing the error function
Sorry, that wasn't clear to me. If you'd like, though, you can peek at their source code here: http://pari.math.ubordeaux.fr/cgibin/ ... s3.c#l1122 Note that the function finds erfc(x), which is related to erf(x) by erf(x) = 1  erfc(x). 
March 1st, 2014, 03:55 AM  #5 
Senior Member Joined: Dec 2013 From: some subspace Posts: 212 Thanks: 72 Math Focus: real analysis, vector analysis, numerical analysis, discrete mathematics  Re: Computing the error function
No problem! Thank you for your help. I looked at the PARI/GP code a little bit, but then I just decided to make some kind of composition of different methods (Maclaurin serie, trapetzoid rule and asymptotic serie). The solution is not quite elegant, but anyway I get the good enough accuracy. The speed then... I have to think about it. 
March 1st, 2014, 06:52 AM  #6  
Global Moderator Joined: Nov 2006 From: UTC 5 Posts: 16,046 Thanks: 938 Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms  Re: Computing the error function Quote:
 
March 1st, 2014, 07:18 AM  #7 
Senior Member Joined: Dec 2013 From: some subspace Posts: 212 Thanks: 72 Math Focus: real analysis, vector analysis, numerical analysis, discrete mathematics  Re: Computing the error function
*nods nods* I was just a bit disappointed because of the trapetzoid rule. It took too much time to compute the results. So. I changed the integrator to sinhtanh quadrature and now I'm getting accurate enough results quite fast. ^^

March 1st, 2014, 08:17 AM  #8  
Global Moderator Joined: Nov 2006 From: UTC 5 Posts: 16,046 Thanks: 938 Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms  Re: Computing the error function Quote:
 

Tags 
computing, error, function 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Error function  Sonntag111106  Math Books  1  April 20th, 2013 03:18 AM 
Computing Integration of Bessel Function  sugakusu  Calculus  0  March 26th, 2012 04:19 AM 
Error Function?  Cookie1  Complex Analysis  1  March 11th, 2012 11:29 PM 
error function  GoYu  Calculus  1  November 2nd, 2011 05:47 AM 
Error Function?  Cookie1  Applied Math  0  December 31st, 1969 04:00 PM 