//Newton's Method
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
double f(double x);
double df(double x);
int main()
{
double Delta = 1E-6;
double Epsilon = 1E-6;
double Small = 1E-6;
int Max = 99;
int Cond = 0;
int K;
double P0;
double P1;
double Y0;
double Y1;
double Df;
double Dp;
double RelErr;
printf("Enter initial value\n");
scanf("%lf", &P0);
Y0 = f(P0);
for (K = 1; K <= Max ; K++)
{
if(Cond) break;
Df = df(P0);
if( Df == 0)
{
Cond = 1;
Dp = 0;
}
else
{
Dp = Y0/Df;
}
P1 = P0 - Dp;
Y1 = f(P1);
RelErr = 2 * fabs(Dp) / (fabs(P1) + Small);
if( (RelErr < Delta) && (fabs(Y1) < Epsilon) )
{
if(Cond != 1)
{
Cond = 2;
}
}
P0 = P1;
Y0 = Y1;
}
printf("\nIteration: %d > %lf\n", K-1, P1);
system("PAUSE");
return 0;
}
double f(double x)
{
return tan(x) - x - 1;
}
double df(double x)
{
return -cos(x);
}
No, you should always tell someone if you or someone you know is being bullied.
wellyou should tell someone
Are you 5 years old? Tell on someone, is to tell someone else that someone is doing something wrong. But don't do that, other wise you'll be a dibber dobber cindy, and you'll go to kindy.
Tell them what is wrong, because it's better to tell someone than keep it to yourself xx
berate, scolded
ya you need to tell someone and if you trust your brother enough then there is nothin wrong with that.
you can download WinWar games!! If not, then something is wrong with your computer.
Yea, think so. -- another answer -- No, it is not wrong to tell them. But - it would be wrong to try to force them to change their views purely because of your religious opinions.
It means that they will do whatever you tell them, even if they know it's wrong.
Do you mean 'criticize?' That means to tell what is wrong, what is bad about someone or something.
Yes there is nothing wrong with telling a freind when you kiss someone I always do.
If you mean mentally always think you are right if someone says your wrong THINK YOU ARE NOT unless I tell you, you are wrong than you ARE