Workaround for Intel platform: replace min() with ternary operator