daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. long double f1(vector<long double> v) {
  2.     assert(v.size() == 2);
  3.     return 100.0 * sqr(v[1] - sqr(v[0])) + sqr(1.0 - v[0]);
  4. }
  5.  
  6. long double f1x1(vector<long double> v) {
  7.     assert(v.size() == 2);
  8.     return 2.0 * (200.0 * pow(v[0], 3) - 200.0 * v[0] * v[1] + v[0] - 1.0);
  9. }
  10.  
  11. long double f1x2(vector<long double> v) {
  12.     assert(v.size() == 2);
  13.     return 200.0 * (v[1] - sqr(v[0]));
  14. }
  15.  
  16. long double f1x1x1(vector<long double> v) {
  17.     assert(v.size() == 2);
  18.     return 1200.0 * sqr(v[0]) - 400.0 * v[1] + 2.0;
  19. }
  20.  
  21. long double f1x1x2(vector<long double> v) {
  22.     assert(v.size() == 2);
  23.     return -400.0 * v[0];
  24. }
  25.  
  26. long double f1x2x2(vector<long double> v) {
  27.     assert(v.size() == 2);
  28.     return 200.0;
  29. }
  30.  
  31. long double f2(vector<long double> v) {
  32.     assert(v.size() == 2);
  33.     return sqr(v[0] - 4) + 4 * sqr(v[1] - 2);
  34. }
  35.  
  36. long double f2x1(vector<long double> v) {
  37.     assert(v.size() == 2);
  38.     return 2.0 * (v[0] - 4.0);
  39. }
  40.  
  41. long double f2x2(vector<long double> v) {
  42.     assert(v.size() == 2);
  43.     return 8.0 * (v[1] - 2.0);
  44. }
  45.  
  46. long double f2x1x1(vector<long double> v) {
  47.     assert(v.size() == 2);
  48.     return 2.0;
  49. }
  50.  
  51. long double f2x1x2(vector<long double> v) {
  52.     assert(v.size() == 2);
  53.     return 0;
  54. }
  55.  
  56. long double f2x2x2(vector<long double> v) {
  57.     assert(v.size() == 2);
  58.     return 8.0;
  59. }
  60.  
  61. long double f3(vector<long double> v) {
  62.     assert(v.size() == 2);
  63.     return sqr(v[0] - 2) + sqr(v[1] + 3);
  64. }
  65.  
  66. long double f3x1(vector<long double> v) {
  67.     assert(v.size() == 2);
  68.     return 2.0 * (v[0] - 2.0);
  69. }
  70.  
  71. long double f3x2(vector<long double> v) {
  72.     assert(v.size() == 2);
  73.     return 2.0 * (v[1] + 3.0);
  74. }
  75.  
  76. long double f3x1x1(vector<long double> v) {
  77.     assert(v.size() == 2);
  78.     return 2.0;
  79. }
  80.  
  81. long double f3x1x2(vector<long double> v) {
  82.     assert(v.size() == 2);
  83.     return 0;
  84. }
  85.  
  86. long double f3x2x2(vector<long double> v) {
  87.     assert(v.size() == 2);
  88.     return 2.0;
  89. }
  90.  
  91. long double f4(vector<long double> v) {
  92.     assert(v.size() == 2);
  93.     return sqr(v[0] - 3) + sqr(v[1]);
  94. }
RAW Paste Data
Top