The CALC4 program for VAX/VMS will do exactly what you want, if you have access to a VAX. If so, and you want to download a copy, you can get one by anonymous FTP from a.cfr.cmu.edu in directory [.VMS.CALC4].
Bob Murphy