6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jun 04, 2024 10:10 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Mar 27, 2011 3:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
I ran some experiments on BeebEm to see how expensive it is to deal with floating point values.

Note that the code in the 4.32 version of BBC BASIC is a lot quicker than that in earlier versions: it takes 0.8 milliseconds to multiply two 5-byte numbers on a 3MHz 65C02, compared to 1.2 milliseconds in version 3.

The relative cost of trig functions is improved too: I think the older basic uses a polynomial for each, whereas the newer one uses(*) the ratio of two polynomials, which gets more accuracy for less work. The following figures are calculated as an equivalent number of multiplies:

Code:
    hibasic3  basic 4.32
sqrt   5.3        2.3
sin    8.6        8.1
cos   14.4       10.8
tan   22.3       11.8
atn   10.7        8.8


Edit: Basic2 source is here or here

Edit: (*) actually uses some other trick - continued fraction?? See here although it mostly duplicates the basic4 documentation linked above.

Edit: repaired some broken links: beebwiki is now found at http://beebwiki.mdfs.net


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: