Sounds like the author concluded that that algorithm ends up not being as accurate as just converting to double and doing StrictMath.sqrt. You might ask the guys on the Apache Drill mailing list how they calculate STDDEV just as a point of reference. I think the way you've done it already is a good trade off for now - maybe just add a TODO. Double gives us what, like almost 20 digits of accuracy?