Function To FloatCurve

I want to make a float curve with a given Function, Where do I have to do it, in c++, in the editor curve? The function would be like y = 2x. Thanks.