// testing one function at two points // #include #include double my_sqrt( double x) { return exp(log(x)/2); } int main( void) { double x[2] = { 2, 10}; for( int i = 0; i < 2; ++i) { double y1 = my_sqrt(x[i]); double y2 = sqrt(x[i]); printf( "sqrt %g %g %g\n", x[i], y1, y2); } } /* output: f2.c sqrt 2 1.41421 1.41421 sqrt 10 3.16228 3.16228 */