Re: roots
- To: mathgroup at smc.vnet.net
- Subject: [mg29641] Re: roots
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Fri, 29 Jun 2001 01:36:16 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Part of a reply Daniel Lichtblau sent to the mathgroup included ---------- > >While it may not be a universally held opinion, one sometimes >hears in this group that Mathematica is not terribly well suited >for computations that are primarily numeric in nature. Indeed, >a few months back the question arose as to what might be an >ideal language in which to write a "foolproof" (so far as one >can obtain) code to find all roots of a univariate function >in a given interval; exactly the problem again at hand today. >My opinion, which I back with the code above, is that >Mathematica is an excellent candidate for this task. Moreover >I note that the code is essentially all numeric. Yes, you can >instead use C, load QUADPACK for the numeric integrations, and >so forth (provided you don't need bignum capabilities). But I >think the simplicity of the Mathematica approach, relative ease >of development/extension/maintainance (and in particular the >easy ability to influence the quadrature steps with options) >argue well that Mathematica is a fine choice for the job. > --------- I think Daniel was refering to the RootSearch program I am working on and wrote about in the past. I am one of the biggest fans of Mathematica. Take a look at my tips and tricks website and that should be clear. However, if you are writing a program that does a lot of simple number crunching with only machine numbers, then it will run a lot faster if its written in C. I always suspected functions like NIntegrate, NDSolve use fast C implementations when they are using machine precision. I figured I should do the same if I want optimal performance. I also plan to give my RootSearch function options such as PrecisionGoal. With the right option settings my method will approximate the roots as close as possible with machine precesion and then refine the approximations with arbitrary precision in Mathematica. Then with the right combination of options my RootSearch function will avoid the C implementation altogether and use a Mathematica implementation with arbitrary precision from start to finish. That could be useful in cases where one must avoid machine precision numbers. Cheers, Ted Ersek Download Mathematica tips, tricks from http://www.verbeia.com/mathematica/tips/Tricks.html