Right now, sqrt is incredibly fast, but the ~5% max error really makes it a poor fit for many uses. Adding a single round of Newton's method makes it much more precise, at the expense of a division. This could be behind a feature flag, or the current sqrt could be kept available as fast_sqrt or similar.
Right now,
sqrt
is incredibly fast, but the ~5% max error really makes it a poor fit for many uses. Adding a single round of Newton's method makes it much more precise, at the expense of a division. This could be behind a feature flag, or the current sqrt could be kept available asfast_sqrt
or similar.