Use EvalResult instead of nan to represent missing result
Check if constants are in bounds.