From 2e79b6184512c8fd46dd956e7fca554e898ca345 Mon Sep 17 00:00:00 2001 From: AZEN-SGG Date: Fri, 18 Apr 2025 03:15:23 +0300 Subject: [PATCH] Add .zip archive --- 2025.04.04/Krivoruchenko_SK.zip | Bin 5866 -> 5803 bytes 2025.04.04/dist/Krivoruchenko_SK/profile.txt | 187 ------------------ 2025.04.18/08Ex/solve.c | 1 - 2025.04.18/Krivoruchenko_SK.zip | Bin 0 -> 9223 bytes 2025.04.18/dist/Krivoruchenko_SK/Makefile | 2 +- 2025.04.18/dist/Krivoruchenko_SK/a06.c | 34 ++++ 2025.04.18/dist/Krivoruchenko_SK/a07.c | 34 ++++ 2025.04.18/dist/Krivoruchenko_SK/a08.c | 34 ++++ .../dist/Krivoruchenko_SK/contin_func.c | 36 ++++ .../dist/Krivoruchenko_SK/contin_func.h | 2 + 2025.04.18/dist/Krivoruchenko_SK/solve.c | 79 ++++++++ 2025.04.18/dist/Krivoruchenko_SK/solve.h | 3 + 12 files changed, 223 insertions(+), 189 deletions(-) delete mode 100644 2025.04.04/dist/Krivoruchenko_SK/profile.txt create mode 100644 2025.04.18/Krivoruchenko_SK.zip create mode 100644 2025.04.18/dist/Krivoruchenko_SK/a06.c create mode 100644 2025.04.18/dist/Krivoruchenko_SK/a07.c create mode 100644 2025.04.18/dist/Krivoruchenko_SK/a08.c diff --git a/2025.04.04/Krivoruchenko_SK.zip b/2025.04.04/Krivoruchenko_SK.zip index 387948d7ab278d72c086ca7e2e25ee81d00614b7..ea0d997b3eb4d88a07972a5a8ad1a9113e2f136c 100644 GIT binary patch delta 2457 zcmZ{lcTf}B62?OsScsGmA#{NtEh@c92_Q%>5s*lUNJshw1Y(d9stN=|nqUD%$^+pk zQZ-T(kt!t8q=-a18VE(;;+uQb_wKwibM}vKc6NWWXXiU}a%FNvOA`^~70ddy`f;DFp;|SyE;|)vrHhT^6)0?g(bshu!?a|TE;GQ?n)gl_7HATK? zPxa_d`6O|ISh1QJ?)uy^c~vaxvd--I!S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?M3dvHCZ1cf=QF2oB-3V z+%hS|J-1x?J>rA%N4YR(L9c!TA7P1Ke@mdl*J}N9hXIg48tx}sX1-EcFr_MdEL9zy z%qLc(SWs|xKI#jJ6Nu4L%ymMMJe_d`54-))DyqM0n$(@^V2a?pid3}C zD6Uy(;&^V^Z7`QLY2V%EReC}&ZvB+o2`=(Y9oBUDBX&PAwFW_klulUy`6I#;^n)cXAQ7zg-e>HYB_m=&wR@7~O^Yv1ShvicFE&xI)x4fo?)xe$AmyGKN-yYuQR=y^=1_xT#=F&- z_RBAW_DpPpO(gYgzQ2a;j<|l6TYEBR`LI?8`3+K_5?lu%0 zN8=E*!S`i~1;ZTQ-yM#xXq=!N1`lC#f%=#q*uQ&hP>4hvKZFhg5jat98;!@`L&K52 z(*0Z1exys@S$6)CINopk0KfqV1OKJ}hV$=l`w?e(*WWm<{~zaD8lr-DNG<}@5)|jY zH<0sJq~APaI|-Vgz)g(!KPAKO6d%toi3R{SFSmg6&I%6TMJ(oTe>4uyy|Uv2fIk6P Ch=n)+ diff --git a/2025.04.04/dist/Krivoruchenko_SK/profile.txt b/2025.04.04/dist/Krivoruchenko_SK/profile.txt deleted file mode 100644 index 87e6946..0000000 --- a/2025.04.04/dist/Krivoruchenko_SK/profile.txt +++ /dev/null @@ -1,187 +0,0 @@ -Flat profile: - -Each sample counts as 0.01 seconds. - % cumulative self self total - time seconds seconds calls s/call s/call name - 57.69 143.36 143.36 1 143.36 248.19 t14_solve - 42.17 248.15 104.79 6000 0.02 0.02 gauss_inverse - 0.08 248.35 0.20 2 0.10 0.15 read_or_init_matrix - 0.04 248.45 0.10 72000000 0.00 0.00 f2 - 0.02 248.49 0.04 1 0.04 0.04 get_matrix_norm - 0.00 248.49 0.00 2 0.00 0.00 print_matrix - 0.00 248.49 0.00 1 0.00 0.00 get_r1 - 0.00 248.49 0.00 1 0.00 0.00 get_r2 - 0.00 248.49 0.00 1 0.00 0.00 init_identity_matrix - - % the percentage of the total running time of the -time program used by this function. - -cumulative a running sum of the number of seconds accounted - seconds for by this function and those listed above it. - - self the number of seconds accounted for by this -seconds function alone. This is the major sort for this - listing. - -calls the number of times this function was invoked, if - this function is profiled, else blank. - - self the average number of milliseconds spent in this -ms/call function per call, if this function is profiled, - else blank. - - total the average number of milliseconds spent in this -ms/call function and its descendents per call, if this - function is profiled, else blank. - -name the name of the function. This is the minor sort - for this listing. The index shows the location of - the function in the gprof listing. If the index is - in parenthesis it shows where it would appear in - the gprof listing if it were to be printed. - -Copyright (C) 2012-2022 Free Software Foundation, Inc. - -Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. - - Call graph (explanation follows) - - -granularity: each sample hit covers 4 byte(s) for 0.00% of 248.49 seconds - -index % time self children called name - -[1] 100.0 0.00 248.49 main [1] - 143.36 104.83 1/1 t14_solve [2] - 0.20 0.10 2/2 read_or_init_matrix [4] - 0.00 0.00 2/2 print_matrix [7] - 0.00 0.00 1/1 init_identity_matrix [10] - 0.00 0.00 1/1 get_r1 [8] - 0.00 0.00 1/1 get_r2 [9] ------------------------------------------------ - 143.36 104.83 1/1 main [1] -[2] 99.9 143.36 104.83 1 t14_solve [2] - 104.79 0.00 6000/6000 gauss_inverse [3] - 0.04 0.00 1/1 get_matrix_norm [6] ------------------------------------------------ - 104.79 0.00 6000/6000 t14_solve [2] -[3] 42.2 104.79 0.00 6000 gauss_inverse [3] ------------------------------------------------ - 0.20 0.10 2/2 main [1] -[4] 0.1 0.20 0.10 2 read_or_init_matrix [4] - 0.10 0.00 72000000/72000000 f2 [5] ------------------------------------------------ - 0.10 0.00 72000000/72000000 read_or_init_matrix [4] -[5] 0.0 0.10 0.00 72000000 f2 [5] ------------------------------------------------ - 0.04 0.00 1/1 t14_solve [2] -[6] 0.0 0.04 0.00 1 get_matrix_norm [6] ------------------------------------------------ - 0.00 0.00 2/2 main [1] -[7] 0.0 0.00 0.00 2 print_matrix [7] ------------------------------------------------ - 0.00 0.00 1/1 main [1] -[8] 0.0 0.00 0.00 1 get_r1 [8] ------------------------------------------------ - 0.00 0.00 1/1 main [1] -[9] 0.0 0.00 0.00 1 get_r2 [9] ------------------------------------------------ - 0.00 0.00 1/1 main [1] -[10] 0.0 0.00 0.00 1 init_identity_matrix [10] ------------------------------------------------ - - This table describes the call tree of the program, and was sorted by - the total amount of time spent in each function and its children. - - Each entry in this table consists of several lines. The line with the - index number at the left hand margin lists the current function. - The lines above it list the functions that called this function, - and the lines below it list the functions this one called. - This line lists: - index A unique number given to each element of the table. - Index numbers are sorted numerically. - The index number is printed next to every function name so - it is easier to look up where the function is in the table. - - % time This is the percentage of the `total' time that was spent - in this function and its children. Note that due to - different viewpoints, functions excluded by options, etc, - these numbers will NOT add up to 100%. - - self This is the total amount of time spent in this function. - - children This is the total amount of time propagated into this - function by its children. - - called This is the number of times the function was called. - If the function called itself recursively, the number - only includes non-recursive calls, and is followed by - a `+' and the number of recursive calls. - - name The name of the current function. The index number is - printed after it. If the function is a member of a - cycle, the cycle number is printed between the - function's name and the index number. - - - For the function's parents, the fields have the following meanings: - - self This is the amount of time that was propagated directly - from the function into this parent. - - children This is the amount of time that was propagated from - the function's children into this parent. - - called This is the number of times this parent called the - function `/' the total number of times the function - was called. Recursive calls to the function are not - included in the number after the `/'. - - name This is the name of the parent. The parent's index - number is printed after it. If the parent is a - member of a cycle, the cycle number is printed between - the name and the index number. - - If the parents of the function cannot be determined, the word - `' is printed in the `name' field, and all the other - fields are blank. - - For the function's children, the fields have the following meanings: - - self This is the amount of time that was propagated directly - from the child into the function. - - children This is the amount of time that was propagated from the - child's children to the function. - - called This is the number of times the function called - this child `/' the total number of times the child - was called. Recursive calls by the child are not - listed in the number after the `/'. - - name This is the name of the child. The child's index - number is printed after it. If the child is a - member of a cycle, the cycle number is printed - between the name and the index number. - - If there are any cycles (circles) in the call graph, there is an - entry for the cycle-as-a-whole. This entry shows who called the - cycle (as parents) and the members of the cycle (as children.) - The `+' recursive calls entry shows the number of function calls that - were internal to the cycle, and the calls entry for each member shows, - for that member, how many times it was called from other members of - the cycle. - -Copyright (C) 2012-2022 Free Software Foundation, Inc. - -Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. - -Index by function name - - [5] f2 [8] get_r1 [7] print_matrix - [3] gauss_inverse [9] get_r2 [4] read_or_init_matrix - [6] get_matrix_norm [10] init_identity_matrix [2] t14_solve diff --git a/2025.04.18/08Ex/solve.c b/2025.04.18/08Ex/solve.c index 4c24573..b5e9f0f 100644 --- a/2025.04.18/08Ex/solve.c +++ b/2025.04.18/08Ex/solve.c @@ -2,7 +2,6 @@ #include "contin_func.h" #include -#include #include #include diff --git a/2025.04.18/Krivoruchenko_SK.zip b/2025.04.18/Krivoruchenko_SK.zip new file mode 100644 index 0000000000000000000000000000000000000000..bdcbbfe95f823e48b6c819b74e465df5386aee60 GIT binary patch literal 9223 zcmbW6byS?m*6z{ZPH+ei8fe^u6EwIquEE`cTS#!X#x=NG&|o3BJ3$(U00|Dk0s(F_ zXEH<1ob%o9UV72B-u~mas`m3#y}R~SmV-yYhk=1XhKZ_+(>Z_{Qm%x9fdM~)fkA}+ zYQ)CHVp5=H=Kx{Dz9pl%?Me)rks=;XR?4rai<3{ANkY{?smtl7Q4AviGq`;HvE*AntfjHD=Qf1TJ?Hh>c;? z!SYCCMH~u$wzBPfwZ+KnlGEUr2#~X?_NtijcY9G+E7tX_9Stb)idyx3?D)>K&8t!) zs`UgF%9Djp!GWXf0mU?ke1utB1gxNm3l<_LMyYt)%QUJr_P%dLB$l7$U6lWL-&t4vj z;?0lVPK)a{fr zsW9F7fI`U0xecUxNPY=eWX`iqTjo$>e`*GW}dj>yT?t_n_Asxe>9;sxRDW(#|WDxTMDUJPMC z8KHhM)-%o52d%j)@t@mrP0CSYhlDQmqT9@o#Y@5i`K{M+0P6+=vA1e3AV_dxp`pGylJvoR^{Ie&AIYo-vbr~CKhVye;Jya#YA64)V`AqTaXTPTdjat zqkTyH&S)@vFZ5k1-2h!8(A zFl7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nRy3Fzi9VuSYk{u6dD^vi$6{xkp~@!@R$*;sjqMTWNAjo6@VmWSAF3}}B9iUFcGiJm_gA7cO65_pI$faZ@zY|sY5 zL#*sMDZ~Bjs#BH>?yn)k=Xd>EB~ z)^8q?eX#$k<~#)Bi#EC4gMW>`mhce#&)d*LaLD6d;NJqR`^3ch9{g+kPvHAN|9&}n z2v#Au-!;&y%ES5o!u;P(q~FuXhuB-9dn`1m{QtrJ{=R>REhoLlLf`)XJ1ipfq=A9K PhJKQvse=y1{nP&eMET1b literal 0 HcmV?d00001 diff --git a/2025.04.18/dist/Krivoruchenko_SK/Makefile b/2025.04.18/dist/Krivoruchenko_SK/Makefile index cbfc3d3..b371b8d 100644 --- a/2025.04.18/dist/Krivoruchenko_SK/Makefile +++ b/2025.04.18/dist/Krivoruchenko_SK/Makefile @@ -5,7 +5,7 @@ FLAGS = -fstack-protector-all -W -Wall -Wextra -Wunused -Wcast-align -Werror -pe %.o: %.c gcc -c $(FLAGS) $< -all: a01.out a02.out a03.out a04.out a05.out +all: a01.out a02.out a03.out a04.out a05.out a06.out a07.out a08.out solve.o: solve.c solve.h array_io.o: array_io.c array_io.h diff --git a/2025.04.18/dist/Krivoruchenko_SK/a06.c b/2025.04.18/dist/Krivoruchenko_SK/a06.c new file mode 100644 index 0000000..bf43037 --- /dev/null +++ b/2025.04.18/dist/Krivoruchenko_SK/a06.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +#include "io_status.h" +#include "solve.h" + +/* ./a.out x eps */ +int main(int argc, char *argv[]) +{ + double x, eps, t, r1 = 0, r2 = 0; + int task = 6; + + if ( + !((argc == 3) && + sscanf(argv[1], "%le", &x) == 1 && + ((sscanf(argv[2], "%le", &eps) == 1) && eps > 0)) + ) { + fprintf(stderr, "Usage: %s x eps\n", argv[0]); + return 1; + } + + t = clock(); + r1 = fcos(x, eps); + t = (clock() - t) / CLOCKS_PER_SEC; + + r2 = fabs(r1 - cos(x)); + + printf("%s : Task = %d Result = %e Residual = %e Elapsed = %.2f\n", argv[0], task, r1, r2, t); + + return 0; +} + diff --git a/2025.04.18/dist/Krivoruchenko_SK/a07.c b/2025.04.18/dist/Krivoruchenko_SK/a07.c new file mode 100644 index 0000000..040df9e --- /dev/null +++ b/2025.04.18/dist/Krivoruchenko_SK/a07.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +#include "io_status.h" +#include "solve.h" + +/* ./a.out x eps */ +int main(int argc, char *argv[]) +{ + double x, eps, t, r1 = 0, r2 = 0; + int task = 7; + + if ( + !((argc == 3) && + sscanf(argv[1], "%le", &x) == 1 && + ((sscanf(argv[2], "%le", &eps) == 1) && eps > 0)) + ) { + fprintf(stderr, "Usage: %s x eps\n", argv[0]); + return 1; + } + + t = clock(); + r1 = fexp(x, eps); + t = (clock() - t) / CLOCKS_PER_SEC; + + r2 = fabs(r1 - exp(x)); + + printf("%s : Task = %d Result = %e Residual = %e Elapsed = %.2f\n", argv[0], task, r1, r2, t); + + return 0; +} + diff --git a/2025.04.18/dist/Krivoruchenko_SK/a08.c b/2025.04.18/dist/Krivoruchenko_SK/a08.c new file mode 100644 index 0000000..f7519c6 --- /dev/null +++ b/2025.04.18/dist/Krivoruchenko_SK/a08.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +#include "io_status.h" +#include "solve.h" + +/* ./a.out x eps */ +int main(int argc, char *argv[]) +{ + double x, eps, t, r1 = 0, r2 = 0; + int task = 8; + + if ( + !((argc == 3) && + ((sscanf(argv[1], "%le", &x) == 1) && x > 0) && + ((sscanf(argv[2], "%le", &eps) == 1) && eps > 0)) + ) { + fprintf(stderr, "Usage: %s x eps\n", argv[0]); + return 1; + } + + t = clock(); + r1 = dln(x, eps); + t = (clock() - t) / CLOCKS_PER_SEC; + + r2 = fabs(r1 - log(x)); + + printf("%s : Task = %d Result = %e Residual = %e Elapsed = %.2f\n", argv[0], task, r1, r2, t); + + return 0; +} + diff --git a/2025.04.18/dist/Krivoruchenko_SK/contin_func.c b/2025.04.18/dist/Krivoruchenko_SK/contin_func.c index 4267921..c97e35d 100644 --- a/2025.04.18/dist/Krivoruchenko_SK/contin_func.c +++ b/2025.04.18/dist/Krivoruchenko_SK/contin_func.c @@ -36,3 +36,39 @@ double scos (const double x, const double eps) return value; } + +double sexp (const double x, const double eps) +{ + double value = 1; + double monom = x; + int i = 1; + + while (monom - eps >= DBL_EPSILON) + { + value += monom; + + i++; + monom *= x/i; + } + + return value; +} + +double fln (const double x, const double eps) +{ + const double z = (x - 1) / (x + 1); + double value = 0; + double monom = z, el = z; + int i = 1; + + while (el - eps > DBL_EPSILON) + { + value += el; + + i+=2; + monom *= z*z; + el = monom / i; + } + + return 2 * value; +} \ No newline at end of file diff --git a/2025.04.18/dist/Krivoruchenko_SK/contin_func.h b/2025.04.18/dist/Krivoruchenko_SK/contin_func.h index 404674a..d7d2055 100644 --- a/2025.04.18/dist/Krivoruchenko_SK/contin_func.h +++ b/2025.04.18/dist/Krivoruchenko_SK/contin_func.h @@ -3,5 +3,7 @@ double ssin (const double x, const double eps); double scos (const double x, const double eps); +double sexp (const double x, const double eps); +double fln (const double x, const double eps); #endif diff --git a/2025.04.18/dist/Krivoruchenko_SK/solve.c b/2025.04.18/dist/Krivoruchenko_SK/solve.c index dc0422a..7bf86ce 100644 --- a/2025.04.18/dist/Krivoruchenko_SK/solve.c +++ b/2025.04.18/dist/Krivoruchenko_SK/solve.c @@ -2,6 +2,7 @@ #include "contin_func.h" #include +#include #include #include @@ -222,3 +223,81 @@ double fsin (double x, const double eps) return answer; } + +double fcos (double x, const double eps) +{ + double answer; + short flag = 1; + + if (x - M_PI*2 >= DBL_EPSILON) + x = fmod(x, M_PI*2); + + if (x - M_PI >= DBL_EPSILON) + { + x -= M_PI; + flag *= -1; + } + + if (x - 1 >= DBL_EPSILON) + { + x -= M_PI_2; + flag *= -2; + } + + if (abs(flag) == 2) + { + x /= 2; + + answer = ((flag > 0) - (flag < 0)) * (2 * ssin(x, eps) * scos(x, eps)); + } else + answer = flag * scos(x, eps); + + return answer; +} + +double fexp (double x, const double eps) +{ + double integral, fractal, answer = 1; + bool is_negative = false; + + if (x < DBL_EPSILON) + { + is_negative = true; + x = -x; + } + + integral = floor(x); + fractal = x - integral; + + for (double i = 0; (integral - i) > DBL_EPSILON; ++i) + answer *= M_E; + + answer *= sexp(fractal, eps); + if (is_negative) + answer = 1. / answer; + + return answer; +} + +double dln (double x, const double eps) +{ + double value = 0; + int b = 0; + + while (x - 2 > DBL_EPSILON) + { + x *= 0.5; + b++; + } + + while (x - 1 <= DBL_EPSILON) + { + x *= 2; + b--; + } + + value = fln(x, eps); + + value += b * M_LN2; + return value; +} diff --git a/2025.04.18/dist/Krivoruchenko_SK/solve.h b/2025.04.18/dist/Krivoruchenko_SK/solve.h index f81212d..d9a44eb 100644 --- a/2025.04.18/dist/Krivoruchenko_SK/solve.h +++ b/2025.04.18/dist/Krivoruchenko_SK/solve.h @@ -11,5 +11,8 @@ double t4_solve ( double * restrict D ); double fsin (double x, const double eps); +double fcos (double x, const double eps); +double fexp (double x, const double eps); +double dln (double x, const double eps); #endif