OPTION ARITHMETIC COMPLEX
! The set of complex number m such as 
! the repetition of f(z)=cosh z + m is bouned.
! This program dicides for non-bounded on overflow within 400 times. 
! As mathematically conj(cosh(z))=cosh(conj(z)) holdsC
! this program deals with the points on the upper plane.
DEF cosh(z)=(EXP(z)+EXP(-z))/2    
! Note. The supplied function COSH does not cope with complex numebers.
DEF f(z)=cosh(z)+mu
LET left = -4                  ! left                 
LET right =  4                  ! right               
LET h = (right - left)             ! height
SET WINDOW left, right,-h/2,h/2  
DRAW axes  
ASK PIXEL SIZE(left,-h/2;right,h/2) px,py
LET px=px-1
LET py=py-1     
SET POINT STYLE 1
FOR v = 0 to h/2 step h/py                            
   FOR u= left TO right step (right-left)/px                               
      LET mu=COMPLEX(u,v)
      LET z = 0                        ! initial value                            
      WHEN EXCEPTION IN
         FOR n=1 TO 400                ! maximum number of repetition                      
            LET z=f(z)     
         NEXT n                         
         PLOT POINTS: u,v
         PLOT POINTS: u,-v
      USE
      ! Decide for divergence
      END WHEN
   NEXT u                                        
NEXT v                                      
END                                             
 
