Newsgroups: comp.os.msdos.djgpp From: Elliott Oti Subject: Re: high precision nonlinear math functions ? Sender: usenet AT phys DOT uu DOT nl (News system Tijgertje) Message-ID: In-Reply-To: <4.1.19981112171650.00a26d70@hal.nt.tuwien.ac.at> Date: Fri, 13 Nov 1998 10:30:56 GMT X-Nntp-Posting-Host: ruunf0.phys.uu.nl Content-Type: TEXT/PLAIN; charset=US-ASCII References: <4 DOT 1 DOT 19981112171650 DOT 00a26d70 AT hal DOT nt DOT tuwien DOT ac DOT at> Mime-Version: 1.0 Organization: Physics and Astronomy, University of Utrecht, The Netherlands Lines: 44 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Thu, 12 Nov 1998, Anton Helm wrote: > I've some problems with numerical precision > of some math functions. > > Is there any math lib available that can do these > computations in long double ? > > I would need e.g.: > > log(tan(b/2.0 + PI/4.0)) > > asin(e * sin(b)) > > atan(exp(f)) > > Unfortunately all of them are inside an iteration loop > so they really need to be fast. > > I recently got an infinite iteration loop due to low precision > (all other computations are done in long double). > If I change the break criteria of the iteration loop so that I > jump out before the error occurs the results are not precise enough :-( Hmm. If you're looking for double precision math software you might want to search the Guide to Available Mathematical Software at http://www.nist.gov/gams/ for free and commercial software and libraries. Netlib, at http://www.netlib.org is also a good starting point. But if you are planning to use long double precision transcendental functions in an inner loop, then you can't expect much speed anyway. And if your source code is suffering from numerical precision problems because it's operating at the limits of i86 double resolution, you should seriously consider re-examining the algorithms you are using. Cheers Elliott Oti http://www.fys.ruu.nl/~oti Eh? Where's my sig?