Biseccion
Biseccion
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
double xi = 0.5;
double xu = 2;
double xr1 = xu;
double xr;
double fxi; //f(xi)
double fxr; //f(xr)
double res=0; // f(xi)*f(xr)
double ErrorA;
int contador = 0;
while (contador<3)
{
if (res > 0)
{
xi = xr1;
}
else
{
xu = xr1;
}
xr = (xi + xu) / 2;
fxi = System.Math.Log(xi * xi) - 0.7;
fxr = System.Math.Log(xr * xr) - 0.7;
res = fxi * fxr;
Console.Read();
}
}
}