(expr_, pts, vars_=("x",))
| 58 | |
| 59 | |
| 60 | def sample(expr_, pts, vars_=("x",)): |
| 61 | # `pts` entries are scalars (univariate, substituted for x) or tuples |
| 62 | # matching `vars_` (multivariate — all variables substituted at once). |
| 63 | out = [] |
| 64 | for p in pts: |
| 65 | tup = p if isinstance(p, list) else [p] |
| 66 | try: |
| 67 | sub = {SYMS[v]: sympify(str(t)) for v, t in zip(vars_, tup)} |
| 68 | out.append(float(N(expr_.subs(sub), 30))) |
| 69 | except Exception: |
| 70 | out.append(None) |
| 71 | return out |
| 72 | |
| 73 | |
| 74 | def mantexp_values(res): |
no test coverage detected