Feedback I corrected an error in the last clause of exp_ratintvl->ratintvl 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Re: News Project step #5, deadline Monday 2 December (Mike O'Donnell)
Re: Question Error in exp_xreal? (Maris Goldmanis)
Re: Warning Something's wrong still... (Mark Kittisopikul)
Date: 2002, Nov 29
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

When I approximated e^(x/scale) on an interval not in [-1,1], I used the very conservative approximation [0,3^(x/scale)]. But I forgot to correct for the scale, since exp_ratinitvl->ratintvl is supposed to approximate e^x, not e^(x/scale). I had another error in the same clause, but it would be very hard to notice in the numerical values of test cases. I forgot that when r is rational, 3^r is generally not rational, so my (expt 3 maxsri) is not generally exact. I corrected that by taking the integer above maxsri. Here is the corrected clause, which I posted in version 3 of my definition of exponentiation.

(make_ratintvl 0 (expt (expt 3 (ceiling->exact maxsri)) scale))
Think about why I used ceiling->exact here, instead of ceiling. ceiling is typically used to produce an integer as an approximation to a real. But my code here is using the integer as a rigorous upper bound. As a value it is not exact, but as an upper bound it is.




Mike O'D.


to: "I corrected an error in the last clause of exp_ratintvl->ratintvl"