Calculate Xtilde3 in C++