Minor refactoring.

- Move epsilon to top of file in an anonymous namespace.
- Use static_cast to initialize epsilon inside function.
- Rename variable names to better reflect what ther stand for.