Newton had a fun way to approximate general roots...
#16
Oh here's a thought (I used to shoot them down so they couldn't get away) but lucky me, I'm out of ammo at the moment.

Knowing approximations are only accurate to a growing number of leading digits per iteration, I'm wondering if there is some formula that could be used to calculate the accurate digits in each iteration? I looked at a couple of Newton root examples, but I couldn't come away with any particular pattern. I mean after the initial estimates get the first digit correct, I suppose one could assign one new correct digit per each iteration, and get it right every time. That would be an accurate, but slower way. Also, it appears that Mark @bplus nailed it with the tiny number idea, in that a lot of these I've tried quickly get into that many zeros and a trailing 1. I was thinking maybe something like:

Code: (Select All)
IF LEN(num$) > 7 AND VAL(MID$(num$, LEN(num$) - 8)) <= 1 THEN EXIT DO

I don't know, maybe that 1 would need to be a 9? I'd have to do a lot of testing to figure that one out. 00000001 or 00000002 or 00000009, etc.methods as well. Ultimately I want something that is relatively easy to keep as a fraction. That's the trick in converting back. If you keep the fraction in memory, and then display the decimal to the screen, you can always convert back by ignoring the decimal and working back the fraction.

Well, now I can have a look at some of the other posts in this thread, and I'll comment back later today.

Thanks,

Pete
If eggs are brain food, Biden takes his scrambled.
Reply


Messages In This Thread
RE: Newton had a fun way to approximate general roots... - by Pete - 09-14-2022, 04:35 PM



Users browsing this thread: 15 Guest(s)