#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char *argv[]) {
	
	if (argc != 4) { // expecting 4 arguments, if not provided, terminate
		printf("call: %s <lower bound> <upper bound> <approximation error>\n",argv[0]);
		exit(1);
	}
			   
	double lowerBound = atof(argv[1]);
	double upperBound = atof(argv[2]);
	double error = atof(argv[3]);

	double x = lowerBound;
	double y;		
	
	int i = 0;
	
	while (x < upperBound) {
		y = log(x);
		printf("%d\t%f\t%f\n", i, x, y);
		x = x * (1.0 + sqrt(8.0 * error));
		i++;
		
		if (x > upperBound) {
			x = upperBound;
			y = log(x);
			printf("%d\t%f\t%f\n", i, x, y);
		}
	}

	return 0;
}
