[Freeciv-Dev] Re: MORT
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> 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.
--
Reinier
|
|