|
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.
|