Rational Functions or Cost Analysis