The problems with polynom.

'polynom' has little in common with 'detrend', 'polyfit' and 'wpolyfit'. This is because all of those GNU Octave functions attemt to fit a polynomial onto the data, whereas 'polynom' does something different. It estimates what the data will be further on. Please refer to TISEAN documentation: 
http://www.mpipks-dresden.mpg.de/~tisean/Tisean_3.0.1/docs/chaospaper/node21.html

1. When certain commands are invoked you get a core dump.
    $ polynom amplitude.dat -m4 -d8 -p4 -L1000 -o poly_am.dat
    
    polynom: Fits a polynomial to the data

    Using amplitude.dat as datafile, reading column 1
    Use 5000 lines.
    Opened poly_am.dat for writing
    *** Error in `polynom': double free or corruption (!prev): 0x0000000001d37500 ***
    Aborted (core dumped)

Without the '-L1000' option it works fine (any other '-L#' had the same result). The problem is that '-L1000' sets the CLENGHT=1000 (which is the default) and CAST=1, so it would seem CAST=1 causes the core dump. Seems like there is a bug in 'polynom.c:make_cast();'

Update: Bug resolved. Pushed upstream.

This function * needs * to be ported.
