optimal coding for rbf