Small challenge
|
04-23-2023, 11:10 AM
(This post was last modified: 04-23-2023 11:15 AM by robve.)
Post: #16
|
|||
|
|||
RE: Small challenge
(04-23-2023 08:00 AM)EdS2 Wrote: There must be several ways to compute x^10: Indeed! It is common to find exponentiation by squaring for integer powers, which tends to be more accurate than repeated multiplication and log*exp closed forms. It's pretty straightforward to do. Here is the way I've implemented it in Forth850 MATH.FTH: Code: : F** ( r1 r2 -- r3 ) x^10 is broken down to three squarings and one multiplication \( \left(x\left((x^2)^2\right)\right)^2 \) hence 4 multiplications suffice. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)