1.6
Because of the nature of the scheme's application order evaluation, the function will fall into the loop (improve guess x has been calculated)
1.7
The value is too small, 0.001 this precision is far from enough ...
Value is too large, due to the limited accuracy of floating point numbers, (such as the use of IEEE754 floating-point standard, 32-bit floating point number indicates that 123456789 such numbers will have a serious loss of precision), it is not possible to obtain the correct two large number of the difference.
1 (define (ABS x)2(if(>= x0)3 x4(-x )))5 6 (define (average a B)7(/(+ a B)2))8 9 (define (Improve guess X)Ten (Average guess One(/x guess) ) A -(Define (Good-enough?)guess x) -(< (/(ABS (-(Improve guess x) the guess)) - guess) - 0.01)) - +(Define (sqrt-iter guess x) -(Cond (Good-enough?guess x) guess) +(Else(sqrt-iter (Improve guess x) x)) A )) at - - (define (sqrt x) -(Sqrt-iter1.0x))
---> In principle can, but in fact the accuracy of the loss is certain ...
1.8
1 (define (improve2 guess x)2(/ (+ (/x3(*guess guess))4(*2guess))5 3))6 7(Define (GOOD-ENOUGH2?)guess x)8(< (/(ABS (-(Improve2 guess x)9 guess))Ten guess) One 0.01)) A -(Define (cbrt-iter guess x) -(Cond (GOOD-ENOUGH2?guess x) guess) the(Else(cbrt-iter (Improve2 guess x) - x ))) - - (define (CBRT x) +(Cbrt-iter1.0x))
SICP 1.6-1.8