transform fmin/fmax calls when possible (PR24314)