MCPcopy Create free account
hub / github.com/avaneev/biteopt / calcNistLanczos2

Function calcNistLanczos2

tests/test_nist.cpp:506–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504 0.0, &calcNistLanczos1, &calcNistLanczos1_p };
505
506static double calcNistLanczos2( const double* const x, const int N )
507{
508 const int pn = 24;
509 static const double py[] = {
510 2.5134, 2.04433, 1.6684, 1.36642, 1.12323, 0.92689, 0.767934, 0.638878, 0.533784, 0.447936, 0.377585, 0.319739, 0.272013, 0.232497, 0.199659, 0.17227, 0.149341, 0.13007, 0.113812, 0.100042, 0.0883321, 0.0783354, 0.0697669, 0.0623931, };
511
512 static const double px[] = {
513 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1, 1.15, };
514
515 double s = 0.0;
516 int i;
517
518 for( i = 0; i < pn; i++ )
519 {
520 double d = py[ i ];
521 d -= x[0]*exp(-x[1]*px[i])+x[2]*exp(-x[3]*px[i])+
522 x[4]*exp(-x[5]*px[i]);
523
524 s += d * d;
525 }
526
527 return( s );
528}
529
530static void calcNistLanczos2_p( double* const minv, double* const maxv,
531 const int N, double* const optv )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected