Performance optimization of minimally nonlinear irreversible heat engines and refrigerators under a trade-off figure of merit.