1 auto pow2( double x ){ return x^^2; }
2 auto res1 = df_scalar( &pow2, 1 );
3 auto res2 = df_scalar( &pow2, 3 );
4 auto res3 = df_scalar( &pow2, -2 );
5 assert( abs(res1 - 2.0) < 2e-6 );
6 assert( abs(res2 - 6.0) < 2e-6 );
7 assert( abs(res3 + 4.0) < 2e-6 );