Use fmin and fmax