### Cmath Library

How can I write my cmath library using functions? help me please!I donT know others.
I must not using include<cmath>
for example;

double sin(double x) //sin function
{return x-((x*x*x)/6.)+((x*x*x*x*x)/120.);}

double cos(double y) //cos function
{return 1-((x*x)/2.)+((x*x*x*x)/24.)-((x*x*x*x*x*x)/720.);}
Last edited on
Pick a function. Look at wikipedia for how to calculate it. Write code to do that.
 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768`` ``````#include using namespace std; double sin(double x) //sin function {return x-((x*x*x)/6.)+((x*x*x*x*x)/120.);} double cos(double x) //cos function {return 1-((x*x)/2.)+((x*x*x*x)/24.)-((x*x*x*x*x*x)/720.);} double tan(double x) //tan function {return x+(x*x*x/3.)+(2.*x*x*x*x*x/15.)+(17.*x*x*x*x*x*x*x/315.)+(62.*x*x*x*x*x*x*x*x*x/2835.);} double arcsin(double x) {//arcsin function if(x<-1 || x>1) {cout<<"not using this function ==>"; } else { x=x+(x*x*x/6.)+(3.*x*x*x*x*x/40.)+(5*x*x*x*x*x*x*x/112.)+(35*x*x*x*x*x*x*x*x*x/1152.);} return x; } double arccos(double x){//arccos function if(x<-1 || x>1) {cout<<"not using this function ==>"; } else { x=0.5*3.14159-x-(x*x*x/6.)-(3.*x*x*x*x*x/40.)-(5.*x*x*x*x*x*x*x/112.); return x;}} double arctan(double x){//arctan function if(x<-1 || x>1) {cout<<"not using this function ==>"; } else { x= x-(x*x*x/3.)+(x*x*x*x*x/5.)-(x*x*x*x*x*x*x/7.);} return x;} double exp(double x) //exp function but 12! {return 1+x+(x*x/2.)+(x*x*x/6.)+(x*x*x*x/24.)+(x*x*x*x*x/120.)+(x*x*x*x*x*x/720.)+(x*x*x*x*x*x*x/5040.) +(x*x*x*x*x*x*x*x/40320.)+(x*x*x*x*x*x*x*x*x/362880.)+(x*x*x*x*x*x*x*x*x*x/3628800.)+(x*x*x*x*x*x*x*x*x*x*x/39916800.) +(x*x*x*x*x*x*x*x*x*x*x*x/479001600.); } double fabs(double x){ if(x<0) {x=x*-1;} else x=x; return x;} int main () { double a,h; cin>>a; cout<<"sin("<
`else x=x*1;`