21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
56 stars 37 forks source link

Migration toward double precision floating point numbers #361

Open daviesje opened 3 months ago

daviesje commented 3 months ago

There are many parts of the C backend which use the single precision float without there being a clear reason (and in some cases converting between the two several times). While it makes sense to store the largest grids in single precision, most of the internal calculations (notably the interpolation tables) should be able to be in double without taking a performance hit.

We should run some performance tests replacing some of the float calculations with double throughout the code. Having a more uniform data size throughout will make development a little easier and the double precision should be a little more forgiving in terms of floating point errors that could accumulate.