Comments (4)
Confirmed in testing that with commit 005c504, the result of "PRINT 1000*(.7-LOG(2))" changed from 6.85281931 (as on C64) to 6.85281919 (as now).
from x16-rom.
Interesting. I did change the ADD, MULT, and SQR routines in the math library to more optimized versions (see commit 005c504) two years ago. It could be worth looking into, whether this change is the source of the error.
I don't have the opportunity to test this myself at the moment, so this is just informational, in case someone else picks up from here.
from x16-rom.
Strangely, it appears 'fmult' is more accurate than before commit 005c504 (at least in one relevant case) but something in 'log' that didn't change was wrong. Or else there's something strange about how 'facov' (the overflow/rounding byte) is handled.
In both the current code and before 005c504, LOG(2) ends with multiplying 'log2' by the following value in 'fac': 81 80 00 00 00 80 (where the last byte I've listed is that in 'facov' though it's not contiguous in memory). The result given for that is different, 80 B1 72 17 F8 2C with the old code and 80 B1 72 17 F8 B0 with the new.
Assuming 'facov' is a straightforward 8 bit extension of the mantissa of FAC then the new result is more accurate. Is that assumption right? I don't know.
Data:
80 31 72 17 f8 .. = 0.6931471806019545 (log2 in memory)
81 80 00 00 00 80 = 1.0000000002328306 (fac passed to fmult)
80 B1 72 17 F8 2C = 0.6931471806419722 (old code, better LOG(2))
80 B1 72 17 F8 B0 = 0.6931471807620255 (new code, better product)
from x16-rom.
I seem to remember that 'facov' indeed is just the eight following bits of the accumulator, used for extra accuracy. Or maybe 'facov' really only contains one or two bits (rather than eight), I'm not sure.
Now, the line "fac passed to fmult" should contain the exact real value 1.0, since this should be the log base 2 of the input value. I believe the value shown is the result of a lenghty calculation, so presumably there is some accumulated rounding error in this preceding calculation.
from x16-rom.
Related Issues (20)
- LOAD and SAVE should respect current BANK HOT 3
- DOS unit tests 07 and 08 (C: copy/concatenate) are broken HOT 4
- BASIC overflow/hang in SQR() HOT 4
- Screen editor changes colors when deleting across line boundary HOT 3
- GEOS won't start HOT 3
- CMDR-DOS: Input corruption when programmatically reading from a directory listing "$" (SA 0) and another file (SA 2) HOT 4
- To match official Perixx keyboard keycaps, treat scroll lock as 40/80 switch in BASIC instead of (or in addition to) F4 HOT 1
- memory_decompress not working when decompressing to VRAM HOT 2
- RFE: method for fetching the current working directory HOT 4
- Cursor not cleared in the BASIC editor on startup HOT 1
- [DOS] Rename across directories on FAT32 has incorrect and possibly undefined behavior HOT 1
- The future of X16 NMI behavior HOT 1
- Changes to basic\token2.s doesn't cause a build HOT 4
- Given SPI_CTRL_AUTOTX doesn't work on hardware it should be removed HOT 1
- Fat32 implementation doesn't understand 0xffffffff in the Free Count field in FSInfo
- Saving a file doesn't update the free space HOT 2
- Overwriting a file doesn't appear to work HOT 1
- Add ELSE and END IF to BASIC
- would like a way to adjust key repeat parameters on the system HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x16-rom.