I looked into it, specifically spark_math. I tried to implement the natural logarithm using the taylor series but had two problems.
- For fixed point: I need exponentiation but that is not implemented (would need n-th square root for that ig).
- For integers: exponentiation is implemented but after copying the code from fixed point I noticed that all values get floored and the result becomes bogus.
After implementing the taylor series I saw in the readme that it should be implemented in CORDIC. (And after learning what it is) I wanted to implement that. But I am not sure how I should create the arctan table since the values need to fit the datatype. And I may need to calculate the values during compile time for which I need a working arctan function… ![]()
How should the table be generated/handled? I would love to get some input on that!