sci.math.num-analysis #38846 (19 + 288 more) [1]--[1]--[1] From: Jay Southard [1] Approximation Algorithms Date: Thu Dec 11 17:30:01 EST 1997 Hi, Does anyone have a source for numerical approximations? For example, I recall seeing an approximation for 2-D distance, eg: SQRT(A^2 + B^2) I've come up with: assume A >= B >= 0 then Approx = A + (1/4)*B which is about 6% off worst case. I don't think this was actually the approximation that I vaugely recall, but you get the idea. Thanks, -- jay --MORE--(?%)End of article 38846 (of 38876) -- what next? [npq] sci.math.num-analysis #38863 (18 + 288 more) (1)--[1]--[1] From: spellucci@mathematik.th-darmstadt.de (Peter Spellucci) [1] Re: Approximation Algorithms Date: Fri Dec 12 09:44:32 EST 1997 |> |> Approx = A + (1/4)*B I don't believe in this one. i would guess A*(1+(B/A)**2/2-(B/A)**4/8+... ) taking the series of sqrt(1+x), after extracting A. a very good source of approximations for various functions is Abramowitz&Stegun: Handbook of mathematical functions. hope this helps peter End of article 38863 (of 38876) -- what next? [npq] sci.math.num-analysis #38876 (17 + 288 more) (1)--(1)--[1] From: "James Van Buskirk" [1] Re: Approximation Algorithms Date: Fri Dec 12 19:58:43 EST 1997 Your mistrust is not misplaced. The best coefficient for B above is sqrt(16-sqrt(128))-sqrt(8)+1 for a max relative error of 5.5%. This is a lot closer to 1/3 (max error = 5.7%) than 1/4 (max error = 11.6%). The series you quote above is not currently useful as far as I can tell because the time to execute a division is comparable to the time for a square root (about 16 clocks throughput) to double precision on today's processors (at least on alphas). End of article 38876 (of 38876) -- what next? [npq]