On Thu, Mar 4, 2010 at 1:05 AM, Søren Hauberg <[email protected]> wrote:
> Hi
>
> ons, 03 03 2010 kl. 18:28 +0000, skrev Neil Lawrence:
>> I'm a MATLAB user who keeps trying to convert to Octave. Octave 3.2 is
>> looking v. promising! Great job.
>
> 3.4 will be even better :-)
>
>> The implementation of erfcx in the octave-specfun package is simply
>>
>>
>> exp(x^2)*erfc(x)
>
> [snip]
>> The function is vital for computing accurate logarithms of the
>> Gaussian cumulative distribution function. Is there a way of getting a
>> good implementation into Octave?
>>
>> Most implementations seem to be based on this FORTRAN code:
>>
>> http://www.netlib.org/specfun/erf
>
> Wrapping FORTRAN code should be fairly easy. I would have guessed that
> Octave actually used the Netlib code for computing 'erf', but I can't
> seem to find it in the source. I'll ask on the [email protected]
> list. If we use the Netlib code in Octave it would probably be easiest
> to just include 'erfcx' in core Octave. If not, then we'll get an
> implementation up and running in the 'specfun' package.
>
> Søren
>

We only need the erfcx-related code, because erf and erfc are
typically provided by the C library.
I implemented erfcx as a built-in by rewriting the relevant code to C++:
http://hg.savannah.gnu.org/hgweb/octave/rev/59e34bcdff13

I'll be happy if someone independently verifies this and contributes
some tests. I compared this implementation briefly (several thousand
random values) with your code and they seem to produce almost equal
results.

enjoy

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to