| 261 | // ---------------------------------------------------------------------------------------- |
| 262 | |
| 263 | double brown_residual (int i, const matrix<double,4,1>& x) |
| 264 | /*! |
| 265 | requires |
| 266 | - 1 <= i <= 20 |
| 267 | ensures |
| 268 | - returns the ith brown residual |
| 269 | !*/ |
| 270 | { |
| 271 | double c; |
| 272 | double f; |
| 273 | double f1; |
| 274 | double f2; |
| 275 | |
| 276 | f = 0.0E+00; |
| 277 | |
| 278 | |
| 279 | c = double ( i ) / 5.0E+00; |
| 280 | f1 = x(0) + c * x(1) - std::exp ( c ); |
| 281 | f2 = x(2) + std::sin ( c ) * x(3) - std::cos ( c ); |
| 282 | |
| 283 | f = f1*f1 + f2*f2; |
| 284 | |
| 285 | return f; |
| 286 | } |
| 287 | |
| 288 | // ---------------------------------------------------------------------------------------- |
| 289 | |