#pragma once
structlog_table{staticconstexprintM=65536;staticconstexprintmask=M-1;doublel[M];log_table():l(){unsignedlonglongx=88172645463325252ULL;doublelog_u64max=log(2)*64;for(inti=0;i<M;i++){x=x^(x<<7);x=x^(x>>9);l[i]=log(double(x))-log_u64max;}}doubleoperator()(inti)const{returnl[i&mask];}};