Dimitri Bohlender
https://bohlender.github.io/blog/
Thoughts on formal methods, computer science, art & society
Hugo  gohugo.io
engb
© Dimitri Bohlender
Wed, 21 Aug 2019 17:23:49 +0200

SMTbased Reasoning About the Fast Inverse Square Root
https://bohlender.github.io/blog/smtbasedoptimisationoffastinversesquareroot/
Thu, 12 Sep 2019 09:31:28 +0200
Dimitri Bohlender
smt
smtlib
software verification
https://bohlender.github.io/blog/smtbasedoptimisationoffastinversesquareroot/
<p>While there is a <a href="https://web.archive.org/web/20160308091758/http://www.daxia.com/bibis/upload/406Fast_Inverse_Square_Root.pdf">mathematical explanation</a> for the choice of <code>0x5F3759DF</code> in the <a href="https://en.wikipedia.org/wiki/Fast_inverse_square_root">famous bitlevel hack</a> for approximating the multiplicative inverse of the square root of a 32bit floatingpoint number, it is not immediately clear to what extent the reasoning is really applicable in the context of machine data types and their peculiarities.
This post illustrates how this, and related aspects, can be investigated with <a href="https://en.wikipedia.org/wiki/Satisfiability_modulo_theories">SMT</a>based reasoning about the actual implementation.</p>