- Z80 Float
- 05 Jan 2019 01:22:50 pm
- Last edited by Xeda112358 on 14 Jan 2019 01:29:01 pm; edited 2 times in total
I'm still learning how to work with GitHub/git, but you can help or access the code for this project here.
The library of "single precision" floats (they don't conform to IEEE standards ) needs a lot of work using my newer knowledge. However, it does have abs, add, sub, rsub, negate, arithmetic mean, square root, geometric mean, Borschardt-Gauss, compare, 1/x, division, multiplication, e^x, 2^x, 10^x, x^y, ln(x), log2(x), log10(x), log_y(x), atanh, acosh, asinh, atan, asin, acos, rand, float→TI float, float→str, str→float.
The extended precision floats (15-bit exponent, 64-bit mantissa) are not as compete yet, but I have implemented: add, sub, rsub, arithmetic mean, multiplication, division, square roots, geometric mean, Borschardt-Gauss, acos, asin, atan, acosh, asinh, atanh, ln(x), and float→str.
I am particularly proud of the fact that square roots average under 6600cc, about 13 times faster than TI's (and to about 5 digits more precision).
Later when I am home I'll come up with screen shots. I hope these are useful ! There is a lot more work to be done. Maybe even make eZ80 versions ! This has been kind of exhausting, honestly.
EDIT: Screenshot:
For 64-bit floats, results are only good to about 19 digits, though 20 digits are displayed. With that in mind, the biggest error is less than half a digit so I'm calling it rounding error, both of the inputs (constants are only stored to 64 bits precision) and during intermediate calculations.
EDIT: 14 Jan 2019
Here is a screenshot of some of the single-precision routines!
The library of "single precision" floats (they don't conform to IEEE standards ) needs a lot of work using my newer knowledge. However, it does have abs, add, sub, rsub, negate, arithmetic mean, square root, geometric mean, Borschardt-Gauss, compare, 1/x, division, multiplication, e^x, 2^x, 10^x, x^y, ln(x), log2(x), log10(x), log_y(x), atanh, acosh, asinh, atan, asin, acos, rand, float→TI float, float→str, str→float.
The extended precision floats (15-bit exponent, 64-bit mantissa) are not as compete yet, but I have implemented: add, sub, rsub, arithmetic mean, multiplication, division, square roots, geometric mean, Borschardt-Gauss, acos, asin, atan, acosh, asinh, atanh, ln(x), and float→str.
I am particularly proud of the fact that square roots average under 6600cc, about 13 times faster than TI's (and to about 5 digits more precision).
Later when I am home I'll come up with screen shots. I hope these are useful ! There is a lot more work to be done. Maybe even make eZ80 versions ! This has been kind of exhausting, honestly.
EDIT: Screenshot:
For 64-bit floats, results are only good to about 19 digits, though 20 digits are displayed. With that in mind, the biggest error is less than half a digit so I'm calling it rounding error, both of the inputs (constants are only stored to 64 bits precision) and during intermediate calculations.
EDIT: 14 Jan 2019
Here is a screenshot of some of the single-precision routines!