Skip to content

Commit

Permalink
- better accuracy for InvSqrt thanks to new coeff and 8 bytes less (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
dubusal committed Jun 3, 2014
1 parent 0b48d6b commit b8e209c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IMU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ float InvSqrt (float x){
float f;
} conv;
conv.f = x;
conv.i = 0x5f3759df - (conv.i >> 1);
return 0.5f * (conv.f * (3.0f - x * conv.f * conv.f));
conv.i = 0x5f1ffff9 - (conv.i >> 1);
return conv.f * (1.68191409f - 0.703952253f * x * conv.f * conv.f);
}

// signed16 * signed16
Expand Down

0 comments on commit b8e209c

Please sign in to comment.