Why doubles?
Can we use float precision here?
Please change to float if doubles are not justified