Using Fixpoint to Solve Mathmatic Equation ( x= sin x fixpoint style)

来源:互联网 发布:ubuntu解压中文乱码 编辑:程序博客网 时间:2024/05/16 10:49

(defun  fixpoint  ( x  y)

 

(funcall   y    (funcall  x  x  y) )

 

)

 

(defun  try ( f check init)

(if  (funcall check  (funcall f  init) init )

       init

     (progn

     (print  init)

     (try   f   check   (funcall f  init) )

     )

)

)

 

(setq  fun (fixpoint  'fixpoint

(lambda (s)   

(lambda ( f check init)

(if  (funcall check  (funcall f  init) init )

       init

     (progn

     (print  init)

     (funcall   s   f   check   (funcall f  init) )

     )

)

)

)

)

)

 

 

(funcall  fun  (lambda(x)(sin x) )

      (lambda (x y)(if (<  (abs (-  x  y))  (/ 1  10000) ) t  nil))  (/ 1  11) )