/* Driver for routine zriddr */

#include <stdio.h>
#define NRANSI
#include "nr.h"
#include "nrutil.h"

int i;

static float fx(float x)
{
	float y;

	y=x*(1.0-x);
	printf("%4d %14.6f %14.6f\n",++i,x,y);
	return y;
}

int main(void)
{
	float root;
	
	i=0;

	printf("\nRoots of x(x-1):\n");
	printf("%18s %15s\n","x","f(x)");
	root=zriddr(fx,.5,5.0,1.0e-4);
//	printf("root %14.6f %14.6f\n",root,fx(root));
	return 0;
}
#undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software $!6)D$|2$3. */
