Complex formula sound generation

Can anyone please help me how to write to a .wav file a waveform of sound of the formula like y = Asin(2pi*(sin(2pift)+sin(2pifkt)). I have done some research but seem to be getting nowhere. Thanks.