Task

Implement the algorithm to compute the principal   nth   root   





A

n





{\displaystyle {\sqrt[{n}]{A}}}

   of a positive real number   A,   as explained at the   Wikipedia page.



(define (nth-root n a)
  (let ((x1 a)
	(x2 (div a n)))
    (until (= x1 x2)
      (setq x1 x2
	    x2 (div
		(add
		 (mul x1 (- n 1))
		 (div a (pow x1 (- n 1))))
		n)))
    x2))