Removing equality testing on doubles