#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
double f(double x)
{
return exp(2*x)+x-4;
}
int main()
{
double a=0,b=1,x;
int count=1;
do
{
x=b-f(b)*(b-a)/(f(b)-f(a));
printf("%-3d: ",count++);
printf("%-10lf ",x);
cout<<endl;
if(f(a)*f(x)<0)
{
if(abs(a-x)<10e-5)
break;
a=x;
}
else
{
if(abs(b-x)<10e-5)
break;
b=x;
}
}while(1);
return 0;
}