%! /pi 3.1415927 def % solving x = M + e sin (x) by iteration % this is reasonable only if e is small % stack: M e /solve { 4 dict begin /e exch def /M exch def % find n such that e^{n} < 10^{-7}, or n > -7 ln(10)/ln(e) /n -7 10 log mul e log div cvi 1 add def % M is the initial guess M % x on stack at start of loop n { % change x from radians to degrees 180 mul pi div sin e mul M add } repeat end } def