Post Reply 
New firmware for the Swissmicros DM15L
10-24-2024, 02:13 PM
Post: #130
RE: New firmware for the Swissmicros DM15L
New beta at the top.

Thanks for spotting that John! To save flash memory I am using the complex version of the C function to compute arcsin/cos. In theory they should not return complex numbers for arguments between -1 and 1, but they are buggy. The same code compiled on my desktop machine doesn't break the sin/asin test that you used to find the bug. It is, unfortunately, a "bug" of the ARM math library, new lib. I put bug in quotes because you could argue that I should not use a complex function when I know that the argument is a real number. I am cheating a bit and I was hoping to get away with it Sad

To fix it, I implemented a simple check as suggested by RPNerd (thank you!) although it's costing me 0.5% of flash memory, we are now almost at 99% usage.

In the long term I hope to implement some of these functions from scratch, or use a different math library that behaves better, we'll see.

Another change in this beta is that the SOLVE algorithm now has some control over the precision used to get to the solution. The precision set by the user with FIX/SCI/ENG (up to the max of 15) is used by SOLVE to know when to stop. The function is evaluated and considered 0 with the precision set by the user, before stopping and returning the root. Of course, there is always the hard limit of a maximum of 100 iterations (which I might make user settable too, in the future).

Cheers!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: New firmware for the Swissmicros DM15L - jebedeo - 10-24-2024 02:13 PM



User(s) browsing this thread: 12 Guest(s)