comment on how tempDoublePtr is optimized