broke out return and intermediate real scalar types for user-defined functions