> f = function(y) (5/(1+y) + 5/((1+y)^2) + 105/((1+y)^3) - 88)^2
> optimize(f, c(0,1))
$minimum
[1] 0.09807912
$objective
[1] 8.321122e-06
Two lines. R is so sweet.
> f = function(y) (5/(1+y) + 5/((1+y)^2) + 105/((1+y)^3) - 88)^2
> optimize(f, c(0,1))
$minimum
[1] 0.09807912
$objective
[1] 8.321122e-06
Two lines. R is so sweet.
0.080 seconds
Comments
No comments yet.
Leave a comment