mirror of
https://github.com/correl/sicp.git
synced 2024-11-23 11:09:57 +00:00
Exercise 1.44
This commit is contained in:
parent
f8324dd7d1
commit
f5cfef579b
1 changed files with 17 additions and 1 deletions
16
1-3.org
16
1-3.org
|
@ -660,6 +660,22 @@ layout: org
|
||||||
any given function using `smooth' and `repeated' from *Note
|
any given function using `smooth' and `repeated' from *Note
|
||||||
Exercise 1-43::.
|
Exercise 1-43::.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#+begin_src scheme :tangle yes
|
||||||
|
;; -------------------------------------------------------------------
|
||||||
|
;; Exercise 1.44
|
||||||
|
;; -------------------------------------------------------------------
|
||||||
|
|
||||||
|
(define (smooth f)
|
||||||
|
(lambda (x) (/ (+ (f (- x dx))
|
||||||
|
(f x)
|
||||||
|
(f (+ x dx)))
|
||||||
|
3)))
|
||||||
|
|
||||||
|
(define (smooth-n f times)
|
||||||
|
((repeated smooth times) f))
|
||||||
|
#+end_src
|
||||||
** Exercise 1.45
|
** Exercise 1.45
|
||||||
We saw in section *Note 1-3-3:: that attempting to compute square
|
We saw in section *Note 1-3-3:: that attempting to compute square
|
||||||
roots by naively finding a fixed point of y |-> x/y does not
|
roots by naively finding a fixed point of y |-> x/y does not
|
||||||
|
|
Loading…
Reference in a new issue