An electro-optical programmable nonlinear function generator (PNFG) is developed on a multimode waveguide with four parallel thermal electrodes. The current on one electrode is chosen as the input, while the rest serve as function-defining units to modulate the multimode interference. The electro-thermo-optical effects are analyzed step by step and the impact on the eigenmode properties is derived. It shows that the optical output power variation by altered interference, in response to the input current, manifests as a complex ensemble of functions in general. The PNFG aims to find the special setting under which such relation can be simplified into some basic functions. Through an optimization program, a variety of such functions are found, including Sigmoid, SiLU, and Gaussian. Furthermore, the shape of these functions can be adjusted by finetuning the defining units. This device may be integrated in a large-scale photonic computing network that can tackle complex problems with nonlinear function adaptability.