That leads to the immanent question: Why does this code use double? This sounds slow for our ports without accessible hardware FPU.