Losing float precision

It's the same as OP's code; only difference is the use of a double instead of a float. And hence better results on a Due.

Only useful if OP uses a Due or similar :wink: