Forum Discussion
Altera_Forum
Honored Contributor
11 years agosqrtf custom instruction gives sometimes absolutely wrong results
I use Quartus 13.1.0.182 web edition with a Cyclone III FPGA The project is compiled with the Floating point custom instruction 2.0 from Qsys. My code calculates the square root and some time...
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- Looks that way, probably failing to increment the exponent when the mantissa is rounded up. FWIW you'll probably get better precision from calculating one of sqrt((1+sin)*(1-sin)) or sqrt(0.5 - sin*sin + 0.5). --- Quote End --- Thank you for your reply. Even if your fix works in this special case (not already test), I don't really trust this sqrt hardware function! There is no guaranty it would not do the same with an other rounded. I should ask Altera directly