cpp sine generator