simplify cos(asin(r*sqrt(2)-sqrt(1/2))+pi/4)