MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Why won't Horner[] work?


Paul McHale wrote:
> When I issue the command:
> 
> In:= Fit[ {{1,200},{200,0},{400,200}}, {1,x,x^2}, x]
> 
> Out:= 202.01 - 2.01508 x + 0.00502513 x^2
> 
> This seems good.  But when I do
> 
> 
> In:= Horner[Fit[ {{1,200},{200,0},{400,200}}, {1,x,x^2}, x]]
> 
> Out:= Horner[202.01 - 2.01508 x + 0.00502513 x^2]
> 
> 
> Why doesn't it evaluate the polynomial?  To I need to convert the
> output of fit?
> 
> Thanks,
> Paul
> 
Hi Paul,

You must load the package *Algebra`Horner* before you can use the 
instruction *Horner[]*.

In[1]:=
Needs["Algebra`Horner`"]

In[2]:=
Horner[Fit[{{1, 200}, {200, 0}, {400, 200}},
    {1, x, x^2}, x]]

Out[2]=
202.0100502512563 + (-2.0150753768844227 +
     0.005025125628140706*x)*x

Best regards,
/J.M.


  • Prev by Date: Operating with binary numbers
  • Next by Date: Re: Why won't Horner[] work?
  • Previous by thread: Re: Why won't Horner[] work?
  • Next by thread: Re: Why won't Horner[] work?