Precision analysis for hardware acceleration of numerical algorithms