灯下 登录
计算机科学 / SICP / 1.3.4 Procedures as Returned Values

Exercise 1.40 · 习题

Exercise 1.40: Define a procedure cubic
that can be used together with the newtons-method procedure in
expressions of the form

(newtons-method (cubic a b c) 1)

to approximate zeros of the cubic x
3

+
a

x
2

+

b

x

+

c.

练习 1.40:定义过程 cubic,使其能与 newtons-method 过程在如下形式的表达式中配合使用:

(newtons-method (cubic a b c) 1)

以近似求三次方程 x³ + ax² + bx + c 的零点。

Racket #lang sicp
(newtons-method (cubic a b c) 1)