Dollar declines, yen hits 40-year low