Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "stdio.h"
- #include <iostream>
- double proc(double x){
- double rez = 0;
- int status;
- const double c2 = 5/3;
- const int c3 = 2;
- __asm{
- finit
- fld x;//x
- fld x; //x x
- fmul;//x^2
- fld x;//x x^2
- fmul;//x^3
- fld x;//x x^3
- fmul;//x^4
- fld x;//x x^4
- fmul;//x^5
- fld x;//x x^5
- fld x;//x x x^5
- fmul;//x^2 x^5
- fld x;//x x^2 x^5
- fmul;//x^3 x^5
- fld c2;//5/3 x^3 x^5
- fmul//5*(x^3)/3 x^5
- fld c3;//2 5*(x^3)/3 x^5
- fadd;//2+5*(x^3)/3 x^5
- fadd; //2+5*(x^3)/3 x^5
- fstp rez;// сохранение результата
- }
- return rez;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(LC_ALL,"Russian");
- printf("Рыков Иван 6112-Б\nвариант №22\n");
- printf( "y= x^5 - (5*x^3)/3 + 2 \n");
- double x;
- std::cout << "x = ";
- std::cin >> x;
- std::cout << "f(x)= " <<proc(x) << "\n";
- x = 0;
- for (int i = 2; i <= 20; i++)
- {
- x += 0.1;
- std::cout << "№ " << i << " x= " << x << " f(x)= " << proc(x) << "\n";
- }
- std::cout << std::endl;
- system("Pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement