Complex polynomial evaluation

Frank Reininghaus frank78ac@googlemail.com
Tue Dec 11 23:04:00 GMT 2007


Hi,

I've written a bit of code that evaluates polynomials with real or 
complex coefficients for complex variables. There was some discussion 
about this a couple of years ago, see

http://sourceware.org/ml/gsl-discuss/2004-q2/msg00040.html

and follow-ups.

I've followed the example of gsl_poly_eval () in gsl_poly.h and 
poly/eval.c and wrote two functions:

gsl_poly_complex_eval () evaluates a polynomial with real coefficients 
for a complex variable,
gsl_complex_poly_complex_eval () does the same with complex coefficients.

I'm not quite sure if the choice of names is appropriate, but I think 
that it makes sense to have both functions because one often needs to 
evaluate real polynomials for complex values (like Taylor series 
expansions for some functions).

If you are interested in including this in GSL, you can use the patches 
for gsl_poly.h and eval.c which I have attached (an alternative might be 
to create a new header file gsl_complex_poly.h). If this is the case, I 
could also write a bit of documentation and code for some test cases to 
be included in 'make check'. So far, I've checked the results for many 
random polynomials with Maxima. Moreover, I've checked with random data 
that both functions yield the same results for real polynomials and that 
their results coincide with gsl_poly_eval () if the variable is also real.

Regards,
Frank

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_eval.c
Type: text/x-csrc
Size: 1198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20071211/2deb816e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_gsl_poly.h
Type: text/x-chdr
Size: 1562 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20071211/2deb816e/attachment-0001.bin>


More information about the Gsl-discuss mailing list