refactored Cache’s write operations
a little refactoring
replaced the static Cache in DoubleRef with a pointer
improved multiplication hit ratio