|
|
|
|
|
by AlotOfReading
97 days ago
|
|
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. |
|
JK