I'm pretty sure it's not faster, but it was fun to write:
float asin(float x) {
float x2 = 1.0f-fabs(x);
u32 i = bitcast(x2);
i = 0x5f3759df - (i>>1);
float inv = bitcast(i);
return copysign(pi/2-pi/2*(x2*inv),x);
}
Courtesy of evil floating point bithacks.> floating point bithacks
The forbidden magic
You brought Zalgo. I blame this decade on you.
> float asinine(float x) {
FTFY :P
// what the fuck
That could do with some subtitles.