f | def ADD(f, g): | f | def ADD(f, g): |
| def h(x): | | def h(x): |
| if callable(f) and callable(g): | | if callable(f) and callable(g): |
| return f(x) + g(x) | | return f(x) + g(x) |
n | | n | |
| if callable(f) and not callable(g): | | if callable(f) and not callable(g): |
| return f(x) + g | | return f(x) + g |
n | | n | |
| if not callable(f) and callable(g): | | if not callable(f) and callable(g): |
| return f + g(x) | | return f + g(x) |
n | | n | |
| if not callable(f) and not callable(g): | | if not callable(f) and not callable(g): |
| return f + g | | return f + g |
| | | |
| return h | | return h |
| | | |
| | | |
| def SUB(f, g): | | def SUB(f, g): |
| def h(x): | | def h(x): |
| if callable(f) and callable(g): | | if callable(f) and callable(g): |
| return f(x) - g(x) | | return f(x) - g(x) |
n | | n | |
| if callable(f) and not callable(g): | | if callable(f) and not callable(g): |
| return f(x) - g | | return f(x) - g |
n | | n | |
| if not callable(f) and callable(g): | | if not callable(f) and callable(g): |
| return f - g(x) | | return f - g(x) |
n | | n | |
| if not callable(f) and not callable(g): | | if not callable(f) and not callable(g): |
| return f - g | | return f - g |
| | | |
| return h | | return h |
| | | |
| | | |
| def MUL(f, g): | | def MUL(f, g): |
| def h(x): | | def h(x): |
| if callable(f) and callable(g): | | if callable(f) and callable(g): |
| return f(x) * g(x) | | return f(x) * g(x) |
n | | n | |
| if callable(f) and not callable(g): | | if callable(f) and not callable(g): |
| return f(x) * g | | return f(x) * g |
n | | n | |
| if not callable(f) and callable(g): | | if not callable(f) and callable(g): |
| return f * g(x) | | return f * g(x) |
n | | n | |
| if not callable(f) and not callable(g): | | if not callable(f) and not callable(g): |
| return f * g | | return f * g |
| | | |
| return h | | return h |
| | | |
| | | |
| def DIV(f, g): | | def DIV(f, g): |
| def h(x): | | def h(x): |
| if callable(f) and callable(g): | | if callable(f) and callable(g): |
| return f(x) / g(x) | | return f(x) / g(x) |
n | | n | |
| if callable(f) and not callable(g): | | if callable(f) and not callable(g): |
| return f(x) / g | | return f(x) / g |
n | | n | |
| if not callable(f) and callable(g): | | if not callable(f) and callable(g): |
| return f / g(x) | | return f / g(x) |
t | | t | |
| if not callable(f) and not callable(g): | | if not callable(f) and not callable(g): |
| return f / g | | return f / g |
| | | |
| return h | | return h |
| | | |