| ArithFunct/Bernard04 | ArithFunct/kabaczek | ||||
|---|---|---|---|---|---|
| n | 1 | def ADD(a, b): | n | 1 | def ADD(f, g): |
| 2 | def h(x): | 2 | def h(x): | ||
| n | 3 | if callable(a): | n | 3 | if callable(f): |
| 4 | c = a(x) | 4 | f_1 = f(x) | ||
| 5 | else: | 5 | else: | ||
| n | 6 | c = a | n | 6 | f_1 = f |
| 7 | |||||
| 8 | if callable(b): | 7 | if callable(g): | ||
| 9 | d = b(x) | 8 | g_1 = g(x) | ||
| 10 | else: | 9 | else: | ||
| n | 11 | d = b | n | 10 | g_1 = g |
| 12 | |||||
| 13 | return c + d | 11 | return f_1 + g_1 | ||
| 14 | |||||
| 15 | return h | 12 | return h | ||
| 16 | 13 | ||||
| 17 | 14 | ||||
| n | 18 | def SUB(a, b): | n | 15 | def SUB(f, g): |
| 19 | def h(x): | 16 | def h(x): | ||
| n | 20 | if callable(a): | n | 17 | if callable(f): |
| 21 | c = a(x) | 18 | f_1 = f(x) | ||
| 22 | else: | 19 | else: | ||
| n | 23 | c = a | n | 20 | f_1 = f |
| 24 | |||||
| 25 | if callable(b): | 21 | if callable(g): | ||
| 26 | d = b(x) | 22 | g_1 = g(x) | ||
| 27 | else: | 23 | else: | ||
| n | 28 | d = b | n | 24 | g_1 = g |
| 29 | |||||
| 30 | return c - d | 25 | return f_1 - g_1 | ||
| 31 | |||||
| 32 | return h | 26 | return h | ||
| 33 | 27 | ||||
| 34 | 28 | ||||
| n | 35 | def MUL(a, b): | n | 29 | def MUL(f, g): |
| 36 | def h(x): | 30 | def h(x): | ||
| n | 37 | if callable(a): | n | 31 | if callable(f): |
| 38 | c = a(x) | 32 | f_1 = f(x) | ||
| 39 | else: | 33 | else: | ||
| n | 40 | c = a | n | 34 | f_1 = f |
| 41 | |||||
| 42 | if callable(b): | 35 | if callable(g): | ||
| 43 | d = b(x) | 36 | g_1 = g(x) | ||
| 44 | else: | 37 | else: | ||
| n | 45 | d = b | n | 38 | g_1 = g |
| 46 | |||||
| 47 | return c * d | 39 | return f_1 * g_1 | ||
| 48 | |||||
| 49 | return h | 40 | return h | ||
| 50 | 41 | ||||
| 51 | 42 | ||||
| n | 52 | def DIV(a, b): | n | 43 | def DIV(f, g): |
| 53 | def h(x): | 44 | def h(x): | ||
| n | 54 | if callable(a): | n | 45 | if callable(f): |
| 55 | c = a(x) | 46 | f_1 = f(x) | ||
| 56 | else: | 47 | else: | ||
| n | 57 | c = a | n | 48 | f_1 = f |
| 58 | |||||
| 59 | if callable(b): | 49 | if callable(g): | ||
| 60 | d = b(x) | 50 | g_1 = g(x) | ||
| 61 | else: | 51 | else: | ||
| t | 62 | d = b | t | 52 | g_1 = g |
| 63 | |||||
| 64 | return c / d | 53 | return f_1/g_1 | ||
| 65 | |||||
| 66 | return h | 54 | return h | ||
| 67 | 55 | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||