Jordi GutiƩrrez Hermoso wrote:
> On 24 October 2012 23:34, Steven G. Johnson <stev...@alum.mit.edu> wrote:
>> Hi all, in case there is interest I wanted to let you know that I've
>> written a free complex-argument error function in C++ with an Octave
>> wrapper at:
>>
>>         http://ab-initio.mit.edu/wiki/index.php/Faddeeva_w
> 
> Thanks. This belongs in core Octave since that's where the current
> implementation of erf and friends is. I would need to modify your
> source to fit our style. Besides stylistic issues, there's also the
> issue that it should not be a dynamically loaded function, but
> built-in, so your wrapper needs to be rewritten. I am happy to do this
> myself. Do you have a DVCS somewhere, preferrably Mercurial, where we
> could keep your style on one branch and ours in another? Hopefully you
> plan to keep working on this function, so it's worthwhile to version
> your code. If you don't already have a repository set up, I would be
> most pleased to get you started with Mercurial.

I have a private git repository, but I can't make it public because it 
contains a couple of semi-free programs for performance and accuracy 
comparisons.  It wouldn't be hard for me to check in my changes to a 
public Mercurial repository as well, however, if that is much easier for 
you than just grabbing the file from my web site periodically.

I do plan to keep updating my code as needed (e.g. right now I am 
tweaking it to compute Re[w] more accurately in regions close to the 
real-z axis where Re[w] is small), so it would be nice if you could 
track my changes.

> Do you recommend replacing the current implementation of erf for real
> arguments with your implementation? Currently for real arguments we
> rely on the C library's math.h implementation, and for complex
> arguments we error out.

Probably it is better to stick with the libc erf and erfc for real 
arguments.  What my code computes is the scaled error function w(z), 
equivalent to erfcx(x) = exp(x^2) erfc(x) = w(ix) on the real axis. 
This means that my code has to work over a vastly greater domain, even 
on the real axis (where both erf and erfc are trivial except for small 
|x|), with a corresponding sacrifice of performance (a factor of 2-10 on 
my machine).

You might use my code to provide an erfcx function even for real 
arguments, however.  There are also a few other important special 
functions that can be computed from w(z), like the Voigt functions and 
Dawson's integral.

--SGJ


------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to