Ardianta_Pargo

Numerik

May 6th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function f(x){return Math.pow(x,2) + 3*x - 6}
  2. undefined
  3. f(1)
  4. -2
  5. f(2)
  6. 4
  7. function c(a,b){return b - ((f(b)*(b-a))/(f(b)-f(a)))}
  8. undefined
  9. c(1,2)
  10. 1.3333333333333335
  11. f(c(1,2))
  12. -0.22222222222222143
  13. 2-1.3
  14. 0.7
  15. 2-1.333
  16. 0.667
  17. c(1.3,2)
  18. 1.3650793650793651
  19. f(c(1.3,2))
  20. -0.041320231796422746
  21. 2-1.33
  22. 0.6699999999999999
  23. 2 - c(1.33,2)
  24. 0.631911532385466
  25. c(1.365,2)
  26. 1.3715632364493322
  27. f(c(1.365,2))
  28. -0.004124579072636969
  29. 2-1.371
  30. 0.629
  31. c(1.371,2)
  32. 1.3721550776958091
  33. f(c(1.371,2))
  34. -0.0007252096661805041
  35. 2-1.372
  36. 0.6279999999999999
  37. c(1.372,2)
  38. 1.3722536095417452
  39. f(c(1.365,2))
  40. -0.004124579072636969
  41. c(1.372,2)
  42. 1.3722536095417452
  43. f(c(1.372,2))
  44. -0.0001592024744159204
  45. 2-1.3722
  46. 0.6277999999999999
  47. c(c(1.372,2),2)
  48. 1.3722785932420452
  49. f(c(c(1.372,2),2))
  50. -0.000015682803498506814
  51. f(2)
  52. 4
  53. f(4)
  54. 22
  55. f(22)
  56. 544
  57. 2-1.37227
  58. 0.6277299999999999
  59. c(1.37227,2)
  60. 1.3722802078380232
  61. f(c(1.37227,2))
  62. -0.000006407661961915778
  63. 2-1.37228
  64. 0.6277200000000001
  65. 2 - (-1)
  66. 3
  67. (-9) - (-1)
  68. -8
  69. -8 < 0
  70. true
Advertisement
Add Comment
Please, Sign In to add comment