Use the __restrict__ GCC extension on double* pointers, to avoid aliasing. NB: the C “restrict” keyword does not exist in C++.