Qin Jiushao algorithm Knowledge points

Source: Internet
Author: User

Qin Jiushao algorithm is a polynomial simplification algorithm proposed by the mathematician Qin Jiushao in the Southern Song Dynasty of China. In the West is called the Horner algorithm.

Qin Jiushao (about 1202-1261), the word DAO Ancient, the Southern Song Dynasty people, was born in Rushire (today, Shandong Qufu area people).

Generally, the evaluation of a unary n-th polynomial needs to undergo 2n-1 and n -Times addition , whereas the Qin Jiushao algorithm requires only n multiplication and n - th addition.

At the time of manual calculation, the operation process is greatly simplified.

Rewrite an n-th polynomial into the following form: When the value of the polynomial is evaluated, the value of the first polynomial in the inner bracket is computed, that is, the value of the polynomial is computed by the inward and outer layers, i.e.In this way, the value of the n-th polynomial f (x) is converted to the value of the N-once polynomial. Conclusion: For an n-th polynomial, at most, do n multiplication and N-time addition.
1 int Get (int  x) 2 {3      int sum=0; 4       for (int i=n;i>=0;---i) 5           sum=sum*x+A[i]; 6      return sum; 7 }

Inexperienced shallow, Dianran also shallow, calendar thing deep, machine also deep.

Qin Jiushao algorithm knowledge points

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.