Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: [mg4414] Horner scheme function ?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Bruce Carpenter

Posts: 2
Registered: 12/7/04
Re: [mg4414] Horner scheme function ?
Posted: Jul 24, 1996 7:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

At 10:49 PM 7/21/96, Manfred Krafczyk wrote:
>Hi all,
>does anybody know where I can find a Mathematica
>function that returns the Horner representation
>of a polynomial or how such a function could be
>constructed from the standard M. function set ?
>
>Any hints welcome,
>thanks in advance
>Manfred Krafczyk
>kraft@busch.bauwesen.uni-dortmund.de


Hi Manfred,

Take a look at the following:

In[45]:=
Hornerize[poly_,var_] := Fold[(#1 x + #2)&,0,Reverse[CoefficientList[poly,var]]]

In[46]:=
Hornerize[3 x^6 + 4 x^5 - x^4 + 27 x^3 - x + 1, x]

Out[46]=
1 + x*(-1 + x^2*(27 + x*(-1 + x*(4 + 3*x))))

In[47]:=
Hornerize[-c x^2 + b x^5, x]

Out[47]=
x^2*(-c + b*x^3)

Cheers,
Bruce Carpenter

-----------------------
Dr. Bruce Carpenter
Educational Applications Coordinator phone: (217) 398-0700
Wolfram Research, Inc. fax: (217) 398-0747
100 Trade Centre Drive email: brucec@wolfram.com
Champaign, IL 61820 web: http://www.wolfram.com









Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.