[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Floating point operations.



I am quite happy to hear that floating point operations
will someday compile into fast code. I can understand why
this is not to be done at this time. The reason it came
up is that Prof. Mumford of the math department wants to
do some work in object recognition which involves numeric
and symbolic computations. He was quite disapointed with T.
He now plannes to use Fortran; I don't know why he doesn't
want to use Pascal. There is a possiblity that the numerical
routines will be loaded into a process running T, so that the
symbolic processing can be done in T. Who knows?

The folloing results summerize our T measurements. The program
used summes the integers after converting each integer to 
a floating point number. The best way to do this is to not use
any integer arithmatic, but ....

Value of limit               10000     20000    Recklessness

Apple UCSD Pascal               22        44         -
Apollo Pascal                    4         8         -
Compiled T                      45        85        low
Compiled T                      35        63        high

The T code was

(define (sum-ints limit)
   (proclaim fixnum? limit)
   (do ((sum 0.0 (fl+ sum (fixnum->float count)))
        (count 1 (fx+ 1 count)))    ; Do you proclaim sum and count
       ((fx> count limit) sum)))    ; in the body of the do?

The T code was much slower that the Apples. The apples did
32-bit arithmatic, but still. Besides the fact that floating
point operations are not open coded, I found that each operation
makes a new cell for the result of the operation. That is
why I suggested the destructive floating point operations.
As suggested by Jonathan, that is something that the compiler
should do. When time permits the implementation of a optimizing
numerical compiler, I look forward to seeing very interesting
graphics for the Apollos running T.

John

PS The measurements involving fixnum operations were quite
favorable. do loops turn into very fast code. I will interested
in seeing how you get the factor of 2-3 speed up in new 
compiled code that John told me you expected.