Re: Polynomial fitting routines?



In article <quGdnWnhlu9pbhbeRVn-gA@xxxxxxxxxxx>,
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> writes:
> Steven G. Kargl wrote:
>
> (snip)
>
>> I'm looking for an algorithm that will fit a polynomial to
>> log(x) for 0.25 <= x <= 2 with at least 64-bit precision.
>> I investigated NSWC Math LIb's pfit.f last night. pfit.f
>> worked well on a test on sin(x) and -pi/2 <= x <= pi/2, but
>> I got horrible results for log(x).
>
> If I remember, it is not usual to write a polynomial in x, but
> in (x-1) or some other rational function of x such as (x-1)/(x+1).
>
> Try a fit with one of those.
>

Indeed. After revisiting Abramowitz and Stegun's 4.1.26 and
converting pfit.f to double precision, I can find a polynomial
over the range I'm interested. Unfortunately, it only produces
about O(1e-12) relative error on a few test values. This is
much too large for my purposes.

--
Steve
http://troutmask.apl.washington.edu/~kargl/
.



Relevant Pages

  • Re: How much requirement documentation up front?
    ... provide a best fit for a particular product. ... where there is no historical data or products where consumer habits ... fitting analysis again and selects a new algorithm. ... The fact that the software product itself makes it very convenient to ...
    (comp.object)
  • Re: C++: why 80 charachters??
    ... I guess if the result of your editor's word-wrapping algorithm is ... to be able to fit more than about 130 characters on my ... print utility to do ...
    (comp.lang.cpp)
  • Re: random model
    ... My GA algorithm is in fact searching for coefficients to fit a dataset. ... > thinking of are inherent in the GA itself, whatever you're modeling; ...
    (sci.math)
  • Re: 3-D fit for extrapolation
    ... of equations in as many unknowns as you have nans. ... As for evaluating a polynomial fit over the entire ... with the simplex algorithm, especially since there ...
    (comp.soft-sys.matlab)
  • Re: !! Help !! Finding an open range within a range of numbers
    ... the most naive algorithm possible is probably good enough. ... for the length of the range of free cells you're currently in. ... fit, best fit, worst fit and ... you may want to merge adjacent free blocks. ...
    (comp.lang.pascal.delphi.misc)