Simplify: cast exprs, extremes

Simplify constant expressions involving casts.
Simplify conditional expressions involving extremes.