Subj : Re: ratio approximation algorithm To : comp.programming From : Richard Heathfield Date : Wed Aug 17 2005 01:42 am Roger Willcocks wrote: > > "Richard Heathfield" wrote in message > news:ddpf4a$2bo$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com... >> Not too shoddy. Not exactly >> blitzingly fast, either, but I'm not quite sure what your performance >> criteria are. > > Hmm, a pure brute force approach took 0.37 seconds on my laptop (1.8GHz > Pentium). The trick is to notice that the numerator (a.c) and the > denominator (b.d) can only take on a small number of distinct values (for > instance c >= a), Brute force faster than Monte Carlo? Whatever is the world coming to? :-) -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk mail: rjh at above domain .