octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OctDev] complex error function


From: Daniel J Sebald
Subject: Re: [OctDev] complex error function
Date: Wed, 21 Nov 2012 20:00:18 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 11/21/2012 04:47 PM, Steven G. Johnson wrote:
On 11/21/12 3:17 PM, Jordi Gutiérrez Hermoso wrote:
On 21 November 2012 14:55, Steven G. Johnson<address@hidden> wrote:
On 11/21/12 11:47 AM, Jordi Gutiérrez Hermoso wrote:

But after you do the patch, how will we incorporate it back into our
own codebase, if we have a copy of it?


"cp Faddeeva.cc octave/...../Faddeeva.cc" is pretty easy...

What if you become unresponsive to accepting patches?

Then you are even more screwed if you link to it as a separate library
shipped by me, because then you can't merge your changes at all.

What if I
already had patches there? Then I can't just overwrite the local copy,
I'd have to do merges instead. And also, I or someone else in Octave
has to be remembering to periodically do this copy and make sure that
something has changed.

Instead, users periodically check my site to see if something has
changed, and re-install the shared library if necessary. Which do you
think they will update more often, Octave or some obscure little library
they've never heard of?

Moreover:

1) Code like this doesn't change very much over the long term. It is not
likely to get much in the way of new features (except for new language
interfaces), and bugfixes should tend to accumulate very slowly over
time (probably slower and slower over time as it "converges").

There looks to be a 2011 publication raising concerns about past Faddeeva algorithms. After a decade or so, a new finding came along.


2) It is easy for me to send a message to the octave mailing list, or
submit a bug report, if I have a bugfix. I am already doing this for
SciPy. It is much harder to publicize the need for users to download an
updated version of an obscure little library to users, distros,
etcetera. As long as I am maintaining the code upstream I will continue
to do this; if I were to stop maintaining the code then you won't have
any more patches to merge anyway.

3) Other than Octave and possibly SciPy, it is not clear who would use
it in library form. Most scientific programmers that I know are very
unsophisticated about libraries and it is much easier for them to just
make a copy of the C++ code and link to it directly rather than
installing a shared library (which they only do by necessity for large
packages). And SciPy may well prefer to just include their own copy of
my source, as they are doing now, so as not to introduce an external
dependency; certainly no one on the SciPy lists mentioned any interest
in me shipping a shared library.

Eh, I'm not sure about that. When it comes to scientific programming, software developers go to sources they can trust. A well maintained library that is tried and tested is more apt to get used than a small hunk of code. That becomes more true with the more general use the algorithm gets.


Please, don't trivialise this problem. I know software distribution is
a chore and hard work, but it can't be avoided.

I'm not trivializing it, I'm simply suggesting that standalone libraries
are not necessarily the best solution for distributing relatively small
self-contained numerical subroutines like this. The question is, what is
the best software distribution mechanism for this problem, considering
users as well as developers?

Look, it is easy for me to make an autoconfiscated tarball if that is
what you really want. It's not a significant chore (the Makefile.am and
configure.ac files would only be a few lines long). I just don't think
anyone other than you would want this in shared-library form, so what
you are asking for doesn't make a lot of sense to me.

Why do you think that?

Looking at this document you cited:

www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

the standard does more than just suggest names cerf, etc. The language it uses is "All external names described below are reserved" which is slightly stronger than "suggest" without actually giving the definitions of the formulas.

7.26.1 Complex arithmetic <complex.h>
The function names
cerf
cerfc
cexp2
cexpm1
clog10
clog1p
clog2
clgamma
ctgamma
and the same names suffixed with f or l may be added to the declarations in the <complex.h> header.

In other words, in terms of standardized function names, none in the library shall have the names above for anything other than what are complex variations of the standard routines, i.e., extensions.

It seems to me the way to go here is create cerf() and cerfc() in library format. In fact, implement all of those functions above in what would be called an "extension" to the library. After having done that, you could consider working with glibc developers to add it to the standard library. Why these haven't been implemented yet, I'm not sure. I suspect some of them are pretty straightforward, e.g., complex logarithms; maybe that is why.

The advantages of going that route are a good review of the algorithm (review is good, just as with peer review of research papers) and an accessible way for programs like Octave (and several others) to use the algorithm.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]