{r}
root_secant(function(x){((x + 2)^2)*((x - 1)^4)*(x+5)},x=0)
Sintaks fungsi
## $`function`
## function(x){((x + 2)^2)*((x - 1)^4)*(x + 5)}
## <bytecode: 0x000000000f897138>
##
## $root
## [1] 0.9999996
##
## $iter
## [1] 72
root_secant(function(x){6*(x^4)+11*(x^3)-56*(x^2) +60}, x=0)
Sintaks fungsi
## $`function`
## function(x){6*(x^4)+11*(x^3)-56*(x^2) +60}
## <bytecode: 0x0000000010d85a80>
##
## $root
## [1] 1.000008e-06
##
## $iter
## [1] 3
root_secant(function(x){x^4-5*(x^3)+3*(x^2)+x}, x=0)
Sintaks fungsi
## $`function`
## function(x){x^4-5*(x^3)+3*(x^2)+x}
## <bytecode: 0x00000000103487a0>
##
## $root
## [1] 0
##
## $iter
## [1] 2
root_secant(function(x){7*x + 2*x - 1 - 3}, x=0)
Sintaks fungsi
## $`function`
## function(x){7*x + 2*x - 1 - 3}
## <bytecode: 0x00000000109cdc60>
##
## $root
## [1] 0.4444444
##
## $iter
## [1] 2