|
A simple ipow(X, N) function may be written that requires a maximum of 2*log2[N] multiplications (may be off-by-one), and a possible division (if N was negative). If all N are known, it is possible to optimize ipow() even further, by writing custom code for each power.
For summation of polynomials, note that there are special cases where the Horner polynomial calculation may be optimized:
Even polynomials p(x) = a0 + a2*x^2 + a4*x^4 ... ==> y = x^2; p(y) = a0 + a2*y + a4*y^2 ...
Odd polynomials p(x) = a1*x + a3*x^3 + a5*x^5 ... ==> y = x^2; q(y) = a1 + a3*y + a5*y^2 ... ; p(x) = q(y) * x
...
One advantage of the alternate forms is that they preserve mathematical identities such as p(x) == p(-x) for even polynomials, and p(x) = -p(-x) for odd polynomials.
Note that using Horner polynomial evaluation Horner's method - Wikipedia, the free encyclopedia[^] saves many multiplications - you only need a maximum of 2*(N-1) multiplications and (N-1) additions for the entire polynomial.
EDIT - corrected information about polynomial evaluation
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
modified 11-Apr-16 7:17am.
|
|
|
|
|
Thanks for the edits - after checking out the link to Wikipedia, I have finally got my head around the whole thing.
The only thing that would concern me is the potential loss of accuracy. The whole of my calculation is based on numerous polynomials, and some have already been truncated in the interests of speed.
At present, I am getting a 95% hit rate of 6" of arc, and 99% of 12" of arc when compared to results from the full rigorous approach. As 1' of arc is one Nautical mile in Longitude (or on the equator) this is acceptable, bearing in mind that I do all my sailing at latitudes of about 35° North, where the NM subtends more than 1' of Latitude. What it means is that the final positional accuracy is purely down to the skill of the sextant operator - an error of 1" of time is equivalent to 15" of arc, or 1/4 NM.
|
|
|
|
|
a great read that evoked fascinating responses, thanks. Is "Xamarinate" really trademarked ?
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard
|
|
|
|
|
BillWoodruff wrote: Is "Xamarinate" really trademarked ?
Yes, but only by me!
I was first going to use 'Xamarinade' as in soaked in Xamarin, but as this is my first venture into this technology, I thought it more appropriate to terminate the word in the way the terminator terminated things.
|
|
|
|
|
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Who's up for the CCC ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
I am waiting for Mr. Bihy[^]. If he doesn't then I will post one.
I ain't got no signature.
|
|
|
|
|
Ok thanks
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Poor Rey[^]
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
May you carry me with you, always
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
"Remakes are the path to the dark side. Remakes leads to anger. Anger leads to hate. Hate leads to suffering."
Disappointed with episode 7 (4.1), don't think I'll be bothering with the rest
The whole thing's rigged to blow, touch those tanks and "boooom"!
modified 31-Aug-21 21:01pm.
|
|
|
|
|
I could hardly make it through the whole movie, I was so disappointed. So much hype for so long delivering almost nothing and... spoiler alert... they kill Han Solo for no good reason and not even in any spectacular way! I suspect Harrison Ford looked at the script and said, "Enough! I can't do this cr*p! Kill me now!" - so they did.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
He fulfilled the Obi-wan death scene from episode 4 (killed by his younger prodigy).. reminded me of the scene-for-scene 2006 remake of the Omen.
I can't wait to see the new ripped off, politically corrected Ghostbusters (seriously, I'm giving that a miss too)
The whole thing's rigged to blow, touch those tanks and "boooom"!
modified 31-Aug-21 21:01pm.
|
|
|
|
|
They're remaking Ghostbusters? Noooooooooooo!!!!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
|
Forogar wrote: they kill Han Solo for no good reason
They really gloss over that a sith needs to kill a loved one. If I had not read various other spinoff books I would have been lost for some of the movie.
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|
Forogar wrote: they kill Han Solo for no good reason and not even in any spectacular way! Well, there you go.
I sat through it, and I don't even remember that bit.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Quote: )»Ŧ»)
modified 11-Apr-16 4:49am.
|
|
|
|
|
refer
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
|
level
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
radar
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
radar is correct
well done
|
|
|
|
|
Movie Quote Of The Day
I can't have somebody coming into our home and telling us the reason our son is in a coma is because his soul has floated off somewhere in another dimension.
Which movie?
|
|
|
|
|
Silver Soul Surfer
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|