From: "Tom St Denis" Newsgroups: comp.os.msdos.djgpp References: <9dde68b7 DOT 0106241053 DOT 2a385311 AT posting DOT google DOT com> <200106242138 DOT RAA18013 AT envy DOT delorie DOT com> <3b37e92e DOT 288745911 AT news DOT primus DOT ca> <200106260242 DOT WAA00615 AT envy DOT delorie DOT com> <3b3b4e40 DOT 213415946 AT news DOT primus DOT ca> <6480-Fri29Jun2001102012+0300-eliz AT is DOT elta DOT co DOT il> <3b3d95b2 DOT 362800381 AT news DOT primus DOT ca> <7704-Sat30Jun2001163109+0300-eliz AT is DOT elta DOT co DOT il> <3b4348be DOT 81254401 AT news DOT primus DOT ca> <2950-Wed04Jul2001203020+0300-eliz AT is DOT elta DOT co DOT il> <3b4372cf DOT 92024930 AT news DOT primus DOT ca> Subject: Re: DJGPP reserves wrong int size Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Message-ID: Date: Thu, 05 Jul 2001 00:47:17 GMT NNTP-Posting-Host: 24.112.8.23 X-Complaints-To: abuse AT home DOT net X-Trace: news3.rdc1.on.home.com 994294037 24.112.8.23 (Wed, 04 Jul 2001 17:47:17 PDT) NNTP-Posting-Date: Wed, 04 Jul 2001 17:47:17 PDT Organization: Excite AT Home - The Leader in Broadband http://home.com/faster To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Graaagh the Mighty" wrote in message news:3b4372cf DOT 92024930 AT news DOT primus DOT ca... > On Wed, 04 Jul 2001 20:30:20 +0300, "Eli Zaretskii" > sat on a tribble, which squeaked: > > >In any decent course in numerical computation, the first lesson > >teaches you that you cannot even solve a quadratic equation without > >risking numerical pitfalls. > > Newton's method? That does division, iteratively. The quadratic > formula? I doubt you'll have trouble with numerical instability except > right on the threshold of zero. > > Now please stop spouting your "numerical wisdom" and give some real, > usable information about what might cause what was observed, given > that all I did was assign some numbers to some doubles/long doubles > and perform a few arithmetic operations on them -- not even inside of > a loop. Actually Newtons method works well and gives the same results as a typical libc implementation. In one test I solved for cube roots via doubles and I got the exact same results. Also newtons method is quick. Within 10 or so itterations the result is essentially found. You can get goot square roots for example very quickly. Using 5 itterations of newtons method of the square root of 17 I get 4.1231067170 And from sqrt() I get 4.1231056256 Where newtons method gets 0.0000010914 higher. With 6 steps I get the same #'s. With about 15 steps I get the same results over a wide range of #'s Tom