tag:blogger.com,1999:blog-4446292666398344382.post5017959602859976029..comments2020-10-14T21:49:04.423-07:00Comments on Machined Learnings: Fast Inverse RootsPaul Mineirohttp://www.blogger.com/profile/05439062526157173163noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4446292666398344382.post-46849336076238955872011-06-20T09:09:16.140-07:002011-06-20T09:09:16.140-07:00The postfix indicates the number of Newton steps d...The postfix indicates the number of Newton steps done.<br /><br />rsqrtf0 relative accuracy 0.0236779<br />rsqrtf1 relative accuracy 0.000969781<br />rsqrtf2 relative accuracy 1.86903e-06<br />rsqrtf3 relative accuracy 2.66092e-08<br />rsqrtf0 million calls per second = 233.094<br />rsqrtf1 million calls per second = 182.67<br />rsqrtf2 million calls per second = 154.079<br />rsqrtf3 million calls per second = 121.4<br /><br />So without any Newton steps they have similar speed and (in)accuracy. However the superior form of the Newton step means the square root hack has a much better computation vs. accuracy tradeoff.Paul Mineirohttps://www.blogger.com/profile/05439062526157173163noreply@blogger.comtag:blogger.com,1999:blog-4446292666398344382.post-71529889897346750712011-06-20T07:57:13.477-07:002011-06-20T07:57:13.477-07:00Yes, I'll test that. However my immediate res...Yes, I'll test that. However my immediate response is, if you know you are taking an inverse integral power, the Newton step can be done faster and more accurately with y = x^p as the objective function.Paul Mineirohttps://www.blogger.com/profile/05439062526157173163noreply@blogger.comtag:blogger.com,1999:blog-4446292666398344382.post-22890797784105441582011-06-20T07:45:10.503-07:002011-06-20T07:45:10.503-07:00How does p = 0.5 compare to the fast inverse squar...How does p = 0.5 compare to the fast inverse square root hack in your test harness? (I'm interested in both timing and err.)John Langfordhttps://www.blogger.com/profile/08621090280449787411noreply@blogger.com