Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newton had a fun way to approximate general roots...
#8
(09-13-2022, 04:18 AM)Pete Wrote:
(09-13-2022, 03:58 AM)bplus Wrote: LOOP UNTIL olda = a

Because it hard to get olda to be exactly = a

Loop Until abs(a-olda) < someTinyNumber  ' Might work better

Good point. Many of these iteration functions eventually repeat. It might be an interesting challenge to find a number and root combination that does not. In any case, I would imagine when I convert this to string math, I can exit it by limiting the progressively longer output of digits. That would be preferable to trying to figure out what that "tiny number" would be with so many different decimal possibilities to consider. That's another algorithm to itself. The goal, of course, is to prevent an infinite loop situation. I could always use LOOP UNTIL STEVE = funny_looking, but that would cause a premature exit situation, in most cases. Big Grin

Pete

Yes, I was thinking ahead when you did start your String Math. Actually I was surprised that loops terminated on the few tests I made with your code using Double Type but the tests were neither extremely large nor small.

SomeTinyNumber was meant to be whatever precision you want so that the answer is "good enough" usu 10^-n n being number of decimals for your precision.

Jack is probably more experienced with this stuff good to have his input here!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Newton had a fun way to approximate general roots... - by bplus - 09-13-2022, 04:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "I'm Having Fun." James D Jarvis 6 1,307 07-25-2023, 11:32 PM
Last Post: Kernelpanic
  New General Discussion Subforums admin 13 4,714 02-14-2023, 08:21 AM
Last Post: PhilOfPerth
  Fun with hardware acceleration. Pete 0 477 10-20-2022, 10:25 PM
Last Post: Pete
  Roots and powers playing nicely together... Pete 28 5,102 10-01-2022, 10:16 PM
Last Post: Kernelpanic
  Pascal's Triangle and nth roots. Pete 2 883 09-26-2022, 04:15 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)