Quiet[Remove["Global`*"],{Remove::rmnsm}];Print["Mathematica $Version = “",$Version,"”"];Print["Execution time = ",DateString[DateList[],{"Hour",":","Minute"," on ","DayNameShort"," ","Day"," ","MonthNameShort"," ","Year"}]];

(*
	Copyright © 2015 Julian D. A. Wisean
	Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”),to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,sublicense,and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions: 
	The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
	The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability,fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise,arising from,out of or in connection with the software or the use or other dealings in the software.
*)

(*
	Users are requested but not required to send any improvements of this code to the author, Julian D. A. Wiseman, www.jdawiseman.com/author.html 
	Users are requested but not required to share improvements at http://mathematica.stackexchange.com/questions/101954/postscriptform-or-forthform  
	Also acknowledged is help received at http://mathematica.stackexchange.com/questions/102508/matchq-ing-except-and-except 
*)

(* PostScriptForm[] *)
(*
	http://mathematica.stackexchange.com/questions/101954/postscriptform-or-forthform
	http://mathematica.stackexchange.com/questions/102894/multi-case-function-many-single-case-delayed-assignments-or-one-which
*)
Remove[PostScriptForm];
PostScriptForm[thing_Rational]:=ToString[N[thing,20],InputForm,NumberMarks->False];
PostScriptForm[thing_?AtomQ]:=ToString[thing];
PostScriptForm[thing_List]:=StringJoin@@Riffle[Map[PostScriptForm,thing],"\r\n"];
PostScriptForm[MatrixForm[thing_]]:=PostScriptForm[thing];
PostScriptForm[Times[-1,thing_]]:=StringJoin[PostScriptForm[thing]," neg"];

PostScriptForm[thing_Power]:=(
	psExponent[n_Integer/;n≥1]:=Which[
		n==1,"",
		n==2,"dup mul",
		n==3,"dup dup mul mul",
		EvenQ[n],psExponent[n/2]<>" dup mul",
		Divisible[n,3],psExponent[n/3]<>" dup dup mul mul",
		True,"dup "<>psExponent[(n-1)/2]<>" dup mul mul" (* Must be odd *)
	];
	Which[
		thing[[2]]==-1,"1 "<>PostScriptForm[thing[[1]]]<>" div",
		thing[[2]]==0,"1",
		(Rational===Head[thing[[2]]])&&IntegerQ[Log[2,Denominator[thing[[2]]]]],PostScriptForm[thing[[1]]^Simplify[2*thing[[2]]]]<>" sqrt",
		Not[IntegerQ[thing[[2]]]],PostScriptForm[thing[[1]]]<>" "<>PostScriptForm[thing[[2]]]<>" exp",
		thing[[2]]>0,PostScriptForm[thing[[1]]]<>" "<>psExponent[thing[[2]]],
		True,"1 "<>PostScriptForm[thing[[1]]]<>" "<>psExponent[-thing[[2]]]<>" div"
	]);

PostScriptForm[thing_Times]:=StringJoin@@Riffle[Reap[If[MatchQ[thing[[1]],Power[_,n_Integer/;n<0]],(Sow["1 "<>PostScriptForm[thing[[1,1]]]<>" div"];),(Sow[PostScriptForm[thing[[1]]]];)];Map[(If[MatchQ[#,Power[_,n_Integer/;n<0]],(Sow[PostScriptForm[#[[1]]^(-#[[2]])]<>" div"];),(Sow[PostScriptForm[#]<>" mul"]; )])&,Drop[List@@thing,1]]][[2,1]]," "];

PostScriptForm[thing_Plus]:=
StringJoin@@If[FreeQ[thing,_^n_],
	(* Simple expression, no powers, to be summed one item at a time *)
	Module[{i},
		i=Position[thing,Except[Times[-1,_]|(_?Negative)],1,Heads->False];
		If[Length[i]>0,i=i[[1,1]],(i=Position[thing,Not[MatchQ[#,Times[-1,_]]]&,1,Heads->False];i=If[Length[i]>0,i[[1,1]],1])];	Prepend[Map[(" "<>Replace[#,{(n_Integer/;n<0:>ToString[-n]<>" sub"),(Times[-1,_]:>PostScriptForm[Times@@Drop[#,1]]<>" sub"),(Times[n_/;n<0,_]:>PostScriptForm[Times@@Drop[#,1]]<>" "<>ToString[-#[[1]]]<>" mul sub"),(Times[n_/;n>0,_]:>PostScriptForm[Times@@Drop[#,1]]<>" "<>ToString[#[[1]]]<>" mul add"),(_:>PostScriptForm[#]<>" add")}])&,Drop[List@@thing,{i}]],Replace[thing[[i]],{Times[-1,_]:>PostScriptForm[-thing[[i]]]<>" neg",_:>PostScriptForm[thing[[i]]]}]]  ],
	(* Polynomial *)
	Module[{vars,exps,v,rcl,i,firstMul},
		vars=Variables[thing];
		exps=Exponent[thing,vars];
		v=Select[Transpose[{vars,exps}],(#[[2]]==Max@@exps)&][[1,1]];
		rcl=Reverse[Map[Factor,CoefficientList[thing,v]]];
		Reap[
			i=1;firstMul=True;If[rcl[[1]]=!=1,Sow[PostScriptForm[rcl[[1]]]]];
Map[If[#===0,i++,(Sow[If[firstMul&&rcl[[1]]===1,PostScriptForm[v^i]<>" "," "<>PostScriptForm[v^i]<>" mul "]<>If[MatchQ[#,(Times[_?Negative,_]|(_?Negative))],PostScriptForm[-#]<>" sub",PostScriptForm[#]<>" add"]];i=1;firstMul=False)]&,Drop[rcl,1]];
			If[i>1,Sow[" "<>PostScriptForm[v^(i-1)]<>" mul "]];
		][[2,1]]
]];

Map[{#,PostScriptForm[#]}&,
{9+n,9-n,-9+n,-9-n,1/n,2n^-1,n^-2,3n^-11,-(a b/c/d )e,f g h,a+4b-2c,-(a b/c/d )e+f g h,b b+a b,Sqrt[2],(a a+2 a b+b b),(a a-2 a b-b b)^3,1+2r+3(r^2)+4(r^3)+5(r^4)+6(r^5),1-5(r^4)+6(r^5),-1-5(r^4)+(r^5),(r^(91/32)),(r^(91/48))}]//MatrixForm

testPoly=2 (-768 (h^6)+64 (h^6) (nC^2)+9216 (h^5) r-768 (h^5) (nC^2) r-44864 (h^4) (r^2)-3456 (h^4) nC (r^2)+5184 (h^4) (nC^2) (r^2)+113152 (h^3) (r^3)+27648 (h^3) nC (r^3)-20992 (h^3) (nC^2) (r^3)-168128 (h^2) (r^4)-69504 (h^2) nC (r^4)+44736 (h^2) (nC^2) (r^4)+160512 h (r^5)+56832 h nC (r^5)-43776 h (nC^2) (r^5)-65344 (r^6)-25728 nC (r^6)+22144 (nC^2) (r^6)-1216 (h^4) r w+3456 (h^4) nC r w-1344 (h^4) (nC^2) r w+9728 (h^3) (r^2) w-27648 (h^3) nC (r^2) w+10752 (h^3) (nC^2) (r^2) w-3200 (h^2) (r^3) w+56064 (h^2) nC (r^3) w-26496 (h^2) (nC^2) (r^3) w-65024 h (r^4) w-3072 h nC (r^4) w+19968 h (nC^2) (r^4) w+35520 (r^5) w+20352 nC (r^5) w-22656 (nC^2) (r^5) w+304 (h^4) (w^2)-864 (h^4) nC (w^2)+336 (h^4) (nC^2) (w^2)-2432 (h^3) r (w^2)+6912 (h^3) nC r (w^2)-2688 (h^3) (nC^2) r (w^2)-12192 (h^2) (r^2) (w^2)-576 (h^2) nC (r^2) (w^2)+3744 (h^2) (nC^2) (r^2) (w^2)+68224 h (r^3) (w^2)-52992 h nC (r^3) (w^2)+6528 h (nC^2) (r^3) (w^2)-11888 (r^4) (w^2)-23904 nC (r^4) (w^2)+18336 (nC^2) (r^4) (w^2)+6496 (h^2) r (w^3)-6720 (h^2) nC r (w^3)+1440 (h^2) (nC^2) r (w^3)-25984 h (r^2) (w^3)+26880 h nC (r^2) (w^3)-5760 h (nC^2) (r^2) (w^3)-14816 (r^3) (w^3)+33600 nC (r^3) (w^3)-14400 (nC^2) (r^3) (w^3)-812 (h^2) (w^4)+840 (h^2) nC (w^4)-180 (h^2) (nC^2) (w^4)+3248 h r (w^4)-3360 h nC r (w^4)+720 h (nC^2) r (w^4)+12052 (r^2) (w^4)-19320 nC (r^2) (w^4)+6840 (nC^2) (r^2) (w^4)-3060 r (w^5)+4536 nC r (w^5)-1512 (nC^2) r (w^5)+255 (w^6)-378 nC (w^6)+126 (nC^2) (w^6));

PostScriptForm[testPoly]

testPoly/.{nC->4,w->1001.,h->650.,r->131.}