#include<iostream>
using std::cout;
float Q_rsqrt( float number ) { long i; float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
int main(void) { cout<<Q_rsqrt(23.22); }
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIHN0ZDo6Y291dDsgCmZsb2F0IFFfcnNxcnQoIGZsb2F0IG51bWJlciApIHsgbG9uZyBpOyBmbG9hdCB4MiwgeTsgCmNvbnN0IGZsb2F0IHRocmVlaGFsZnMgPSAxLjVGOwoKeDIgPSBudW1iZXIgKiAwLjVGOwp5ICA9IG51bWJlcjsKaSAgPSAqICggbG9uZyAqICkgJnk7ICAgICAgICAgICAgICAgICAgICAgICAvLyBldmlsIGZsb2F0aW5nIHBvaW50IGJpdCBsZXZlbCBoYWNraW5nCmkgID0gMHg1ZjM3NTlkZiAtICggaSA+PiAxICk7ICAgICAgICAgICAgICAgLy8gd2hhdCB0aGUgZnVjaz8gCnkgID0gKiAoIGZsb2F0ICogKSAmaTsKeSAgPSB5ICogKCB0aHJlZWhhbGZzIC0gKCB4MiAqIHkgKiB5ICkgKTsgICAvLyAxc3QgaXRlcmF0aW9uCi8vIHkgPSB5ICogKCB0aHJlZWhhbGZzIC0gKCB4MiAqIHkgKiB5ICkgKTsgLy8gMm5kIGl0ZXJhdGlvbiwgdGhpcyBjYW4gIGJlIHJlbW92ZWQKIHJldHVybiB5Owp9IAppbnQgbWFpbih2b2lkKSB7IGNvdXQ8PFFfcnNxcnQoMjMuMjIpOyB9