Theoretical studies of strongly correlated rare-earth intermetallics RIn3 and RSn3 (R = Sm, Eu, and Gd)