Talk:Numeric error propagation: Difference between revisions
Content added Content deleted
(→Not sure how to do this: One way is to ... (But can be ignored for purposes of task).) |
(→Not sure how to do this: why id()?) |
||
Line 16: | Line 16: | ||
:They should be treated as independent for the purposes of this task, but see the Python solution where I have added a check for an object being multiplied by itself, which means having the same id() in Python (implemented as a check on the memory location occupied by an object in C-Python). --[[User:Paddy3118|Paddy3118]] 18:19, 31 July 2011 (UTC) |
:They should be treated as independent for the purposes of this task, but see the Python solution where I have added a check for an object being multiplied by itself, which means having the same id() in Python (implemented as a check on the memory location occupied by an object in C-Python). --[[User:Paddy3118|Paddy3118]] 18:19, 31 July 2011 (UTC) |
||
:: Don't do that. This is the same question as the one I asked above about correlations. For a variable, you either track all its error sources for correctness, or track none for simplicity. Checking just one source is good for neither. Consider:<lang>a.value = 10 |
|||
a.error = 1.0 |
|||
b := a * 2 |
|||
c := a - b</lang>How do you deal with the error at assignment of c and d? Checking memory location isn't enough. If a variable has full error source information, a and b would have the same source of error but with different magnitude, so c.error == a.error, but a and b won't have the same mem location so you probably would think c.error = a.error * sqrt(5). Checking identifier equality is not much more correct than tracking nothing, but more confusing and less consistent. --[[User:Ledrug|Ledrug]] 20:20, 31 July 2011 (UTC) |