//
you're reading...
Uncategorized

C++ Functional Iteration with Graphs

#include<iostream>
#include<cmath>
using namespace std;

double f (double x){
return sin(x);
}

int main(){
cout.precision(17);
cout<< "Enter inital value for x";
double x; cin >> x;

for(int i=1; i < (1 << 30); ++i){
   double y = f(x); //cout << y << endl;
   x=y;
}
cout<<"end of iteration x= "<< x;
return 0;
}

 

y=1.1x

 

Screen Shot 2016-01-29 at 8.21.17 AM

y=1.1x -.05

Screen Shot 2016-01-29 at 8.20.44 AM

y=cos(x)

Screen Shot 2016-01-29 at 8.21.29 AM

y=cos(x)

y=sin(x)

y=4x(1-x)

Advertisement

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: