logo

Crowdly

In program este data o functie la tema corespunzatoare. Scrieti instructiunea ce...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

In program este data o functie la tema corespunzatoare. Scrieti instructiunea ce lipseste.

#include <iostream>

#include <cmath>

#define eps 0.00000000001

#define iter 200

double f(double x) {

return x*x*x-2*x*x*cos(x)+x-3;

}

//f1 este derivata functiei f

double f1(double x) {

return 3*x*x+2*x*x*sin(x)-4*x*cos(x)+1;

}

double itang(double a) {

int i;

double x,y1,y;

i=0;

x=a;

y=f(x);

y1=f1(x);

while ( (i<=iter) && ((y<-eps) || (y>eps)) ) {

x=x-y/y1;

y=f(x);

y1=f1(x);

cout << "\n\nf(" << x << ")=" << y << " la iteratia " << i;

i++;

}

if (

Answer Question 3

) {

cout<<"Problema nu se poate rezolva in nr. maxim de iteratii";

return 0;

}

//Din cauza metodei TI-207, nu se va afisa rezultatul in caz ca radacina va fi egala cu 0.

else

return x;

}

int main() {

double x, a;

cout << "a= ";

cin >> a;

x=itang(a);

if (x!=0)

cout << '\n' << x;

return 0;

}

More questions like this

Want instant access to all verified answers on moodle1.ceiti.md?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!