/* nag_shifted_log (s01bac) Example Program. * * Copyright 2002 Numerical Algorithms Group. * * Mark 7, 2002. */ #include #include #include #include int main(void) { double x, y; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("nag_shifted_log (s01bac) Example Program Results\n"); Vprintf(" x y\n"); while (scanf("%lf", &x) != EOF) { /* nag_shifted_log (s01bac). * ln~(1~+~x) */ y = nag_shifted_log(x, NAGERR_DEFAULT); Vprintf("%12.4e %12.4e\n", x, y); } return EXIT_SUCCESS; }