Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: MORT
Home

[Freeciv-Dev] Re: MORT

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: MORT
From: Andrew McGuinness <cogers@xxxxxxxxx>
Date: Thu, 8 Jun 2000 03:31:03 -0700 (PDT)

--- Reinier Post <rp@xxxxxxxxxx> wrote:
> > Whether or not the code is absolutely horrible, I
> > suspect it pre-dates the widespread availability
> of
> > FPU hardware.  I really doubt that the code saves
> any
> > time over 
> >
> > const double MORTD=(double)(MORT-1)/MORT;
> > return (int)((double)b*exp(MORTD,d));
> > 
> > on any machine with a FPU
> 
> It's terrific, in the sense that it works great, but
> it's
> also practically impossible to understand.
> 
> From the Changelog (June/July, 1998) it's clear that
> a lot of experimental
> tuning went into it before the release.  And this
> includes tuning for
> performance - apparently some of these optimizations
> were only added
> when the code turned out to be too slow without
> them.  An irreproducible
> mess of heuristic madness, in the best AI coding
> traditions.

I have done some testing, and determined, contrary to
my expectation:

1) The code is correct, even for large "d"
2) It is slightly quicker than the straightforward
method using doubles, even on a Pentium II

Gosh!


=====
Andrew McGuinness                Luton, UK
andrew_mcguinness@xxxxxxxxxxx

__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com



[Prev in Thread] Current Thread [Next in Thread]