News Avoid iteration when you can calculate precision directly 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Re: News Project Step #2, deadline Wednesday 13 November (Mike O'Donnell)
Date: 2002, Nov 26
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

Almost all of you iterated to find the right precision for xr1 and xr2 to get a given precision in ((mult_xreal xr1 xr2) prec). Several of you even iterated for add_xreal. That gives you nice robust code, with relatively little dependence on the particular operation. But it will probably hurt performance a lot. For addition, you can just allocate half of the error to each of the arguments. For multiplication, it's more complicated, but there's still a simple formula. Look at my solution, and figure out how I derived my formula from the partial derivatives of x*y.




Mike O'D.


to: "Avoid iteration when you can calculate precision directly"