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