#include "error.h" #include #include "interval.h" #include "lineInterval.h" #include "secondDerive.h" #include "taylorInterval.h" #include "recurse.h" // stuff for truncation.... void selfTest() { static int i=0; if (i>0) { error::printTime(); error::diagnostic(); cout << endl << endl; } interMath::selfTest(); linearization::selfTest(); secondDerive::selfTest(); taylorFunction::selfTest(); cout << " -- Installation complete -- " << endl; i++; } taylorFunction gammaNu = taylorUpright::gamma + taylorUpright::vorVc*"0.5" +taylorUpright::swapVorVc*"-0.5"; taylorFunction vorNu = taylorUpright::vor*"0.5"+taylorUpright::swapVor*"0.5" + taylorUpright::vorVc*"0.5" +taylorUpright::swapVorVc*"-0.5"; static interval zetapt = "0.10044457142705639500"; taylorFunction tauVNu = vorNu*"-1"+taylorUpright::sol*zetapt; taylorFunction tauGNu = gammaNu*"-1"+taylorUpright::sol*zetapt; taylorFunction highTauVc =taylorSimplex::highVorVc*"-1"+taylorSimplex::sol*zetapt; taylorFunction tauAnalytic = taylorSimplex::vor*"-1"+taylorSimplex::sol*zetapt; static void setupright(domain& x,domain& z,domain& x0,domain& z0) { interval tx[6]={"6.3001","4","4","4","4","4"}; interval tz[6]={"8","6.3001","6.3001","6.3001","6.3001","6.3001"}; x = domain::lowerD(tx); x0 = domain::lowerD(tx); z = domain::upperD(tz); z0 = domain::upperD(tz); } static void setC(domain& x,domain& z,domain& x0,domain& z0) { interval tx[6]={"6.3001","4","4","6.3001","4","4"}; interval tz[6]={"8","6.3001","6.3001","8","6.3001","6.3001"}; x = domain::lowerD(tx); x0 = domain::lowerD(tx); z = domain::upperD(tz); z0 = domain::upperD(tz); } static void setANC(domain& x,domain& z,domain& x0,domain& z0) { interval tx[6]={"6.3001","4","4","8","4","4"}; interval tz[6]={"8","6.3001","6.3001","10.24","6.3001","6.3001"}; x = domain::lowerD(tx); x0 = domain::lowerD(tx); z = domain::upperD(tz); z0 = domain::upperD(tz); } static void setLower(domain& x,interval x1,interval x2,interval x3, interval x4,interval x5,interval x6) { interval tx[6]={x1,x2,x3,x4,x5,x6}; x = domain::lowerD(tx); } static void setUpper(domain& x,interval x1,interval x2,interval x3, interval x4,interval x5,interval x6) { interval tx[6]={x1,x2,x3,x4,x5,x6}; x = domain::upperD(tx); } // a small variation of prove::generic int generic2(const domain& x,const domain& z,const taylorFunction& F, taylorFunction& G) { domain x0 = x,z0 = z; const taylorFunction* I[2] = {&F,&G}; cellOption opt; return prove::recursiveVerifier(0,x,z,x0,z0,I,2,opt); } // a small variation of prove::generic int generic2dih(const domain& x,const domain& z,const taylorFunction& F, taylorFunction& G,double d) { domain x0 = x,z0 = z; const taylorFunction* I[2] = {&F,&G}; cellOption opt; opt.setDihMax(d); return prove::recursiveVerifier(0,x,z,x0,z0,I,2,opt); } // a small variation of prove::generic int generic3(const domain& x,const domain& z,const taylorFunction& F, taylorFunction& G, taylorFunction& H) { domain x0 = x,z0 = z; const taylorFunction* I[3] = {&F,&G,&H}; cellOption opt; return prove::recursiveVerifier(0,x,z,x0,z0,I,3,opt); } // a small variation of prove::generic int genericFlatSigma(const taylorFunction& F) { // Used in 4.4. interval tx("6.3001"); interval x[6]={"4","4","4",tx,"4","4"}; interval z[6]={tx,tx,tx,"8",tx,tx}; /* gamma */ { taylorFunction Fx = taylorFlat::gamma+ F; taylorFunction H1 = taylorSimplex::eta2_234*"-1" + taylorSimplex::unit*"2"; taylorFunction H2 = taylorSimplex::eta2_456*"-1" + taylorSimplex::unit*"2"; if (!generic3(domain::lowerD(x),domain::upperD(z),Fx,H1,H2)) { return 0; } cout << "fs: gamma done" << "\n"; } /* vor */ { taylorFunction Fx = taylorFlat::vor+ F; taylorFunction H1 = taylorSimplex::eta2_234 + taylorSimplex::unit*"-2"; if (!generic2(domain::lowerD(x),domain::upperD(z),Fx,H1)) { return 0; } cout << "fs: vor done" << "\n"; } /* vorVc */ { interval xc[6]={"4.84","4","4","6.76","4","4"}; taylorFunction Fx = taylorSimplex::lowVorVc+ F; if (!prove::generic(domain::lowerD(xc),domain::upperD(z),Fx)) { return 0; } cout << "fs: vorVc done" << "\n"; } /* vorVc */ { interval xc[6]={"4","4","4","7.29","4","4"}; taylorFunction Fx = taylorSimplex::lowVorVc+ F; if (!prove::generic(domain::lowerD(xc),domain::upperD(z),Fx)) { return 0; } cout << "fs: vorVc done" << "\n"; } /* vorVc */ { taylorFunction Fx = taylorSimplex::lowVorVc+ F; taylorFunction H1 = taylorSimplex::eta2_456 + taylorSimplex::unit*"-2"; if (!generic2(domain::lowerD(x),domain::upperD(z),Fx,H1)) { return 0; } cout << "fs: vorVc done" << "\n"; } return 1; } // a small variation of prove::generic int genericFlatSigmaX(const taylorFunction& F,interval x[6],interval z[6]) { // Used in A.4.12. /* gamma */ { taylorFunction Fx = taylorFlat::gamma+ F; taylorFunction H1 = taylorSimplex::eta2_234*"-1" + taylorSimplex::unit*"2"; taylorFunction H2 = taylorSimplex::eta2_456*"-1" + taylorSimplex::unit*"2"; if (!generic3(domain::lowerD(x),domain::upperD(z),Fx,H1,H2)) { return 0; } cout << "fs: gamma done" << "\n"; } /* vor */ { taylorFunction Fx = taylorFlat::vor+ F; taylorFunction H1 = taylorSimplex::eta2_234 + taylorSimplex::unit*"-2"; if (!generic2(domain::lowerD(x),domain::upperD(z),Fx,H1)) { return 0; } cout << "fs: vor done" << "\n"; } /* vorVc */ { interval xc[6]={"4.84","4","4","6.76","4","4"}; for (int i=0;i<6;i++) if (xc[i]