To answer the question of doing arbitrarily complicated "advanced" math in Axe (A system which does not support many math functions) is to approximate using more simple functions. This is in fact what Axe does natively for sin, cos, arctan, etc. I will demonstrate how I would approach this problem, the same way I did those other functions. Hopefully this will be helpful to everyone. Take a look at how arccos looks:

First things first, since we are using 8.8 and brads (binary radians) the same picture should range from -256 to 256 left to right, and 256 to 0 up to down.

Next, does the shape look like anything simple that you're familiar with? What if we split it into 2 mirror images at the center? Yes! The left and right halves look like rotated and/or flipped square root functions, close enough!

So what are the functions for left and right? Lets do the right side first. By the shape, we know its going to take the form of sqrt(-x). But its shifted to the right by 256 so sqrt(256-x) and also we want it to go through point (0,128) and so when x=0, sqrt(256-x) should be 128, but its actually just 16. So multiply by 8 and finally you get y = 8*sqrt(256-x) for the right half. Follow a similar process for the left and you get: y = 256 - 8*sqrt(256+x)

One cool thing to notice is that in fixed point, all math is modulo 256 and so 256.0 is actually the same as 0.0 so these equations strangely optimize to a case where it looks like we're taking the square root of a negative number all the time, but that's just modular arithmetic for you! This also forces us to add an extra special case.

`y = 8.0*sqrt(-x) when x>0`

y = -8.0*sqrt(x) when x<0

y = 128.0 when x=0

So now the code should be easy and straightforward. Here is an unoptimized version for readability:

`:Lbl acos`

:If r1=0.0

: Return 128.0

:ElseIf r1<<0.0

: Return -√(r1)r*8.0

:Else

: Return √(-r1)r*8.0

:End

This is all untested, but I believe it should work