For requirement 1, you'll probably find some general math program (try
http://sal.jyu.fi/A/1/index.shtml for possibilities) that will do it. None of those will address the problem of tranlsating into gates. for that you would be on a different page of SAL
http://sal.jyu.fi/Z/1/index.shtml looking for, eg, VHDL-compatible apps.