Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves accuracy of vector square root approximation example.
The previous implementation was unnecessarily inaccurate: Measured max error of 2.647303869947791 ulp @ 2.0831878e-19 func (0x1.ebe0fap-63) = 0x1.f5d6b2p-32 func_ref (0x1.ebe0fap-63) = 0x1.f5d6acb494965p-32 2'139'095'041 tested in [0 , inf] 57.2114955877736548% correctly rounded ( 1223808265) 88.4557938629712339% faithfully rounded (+ 668345235) 11.5442061370287661% >= 1.0 ulp (+ 246941541) Which is 21.6 bits of precision rater than the claimed 23. The new implementation has lower maximum error and higher correctly- and faithfully-rounded rates: Measured max error of 0.800413005053997 ulp @ 3.0387554e-29 func (0x1.342a9ap-95) = 0x1.8d378p-48 func_ref (0x1.342a9ap-95) = 0x1.8d378199cfbbcp-48 2'139'095'041 tested in [0 , inf] 87.4400844352198163% correctly rounded ( 1870426510) 100.0000000000000000% faithfully rounded (+ 268668531) With is 23.3 bits of precision. * src/vector-examples.adoc (Square root approximation example): Use `r - (0.5 r) ((x r) r - 1)` formulation for 1/sqrt(x) estimate refinement.
- Loading branch information