optimizing precision calculation