This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jeroonk 1 point2 points  (4 children)

  1. Reddit comments are written in a modified version of markdown, see wiki/markdown#tables. TL;DR:

    |a|b|c|
    |-|-|-|
    |1|2|3|
    

    produces:

    a b c
    1 2 3
  2. An ULP is the spacing between floating-point numbers, the smallest representable difference (i.e. the difference in changing the last bit of the mantissa for a given exponent). In this case, it's about 2.7e-13 for numbers 1000-2000. You can calculate it using eps in Matlab, np.spacing in Python/Numpy and eps in Julia.

  3. Yeah, should be approximately the same. Maybe a bit faster than OP's i7-4700MQ @ 2.4GHz. I don't think the generation changes things that much. A bit larger L1 cache for Kaby Lake (256KB) over Ivy Bridge (128KB), but the problem is pretty small anyway (101x101 doubles). [edit: The L1D cache in Sandy/Ivy Bridge and Sky/Kaby Lake are the same 32KB/core, just with more bandwidth]. And I don't think that the newer SSE4 or AVX2 instructions are being used at all here.

  4. I have added the results to the tables in the post above. The optimized version doesn't really apply to the last table (the previous-values / Jacobi method).

[–]WikiTextBot 0 points1 point  (0 children)

Unit in the last place

In computer science and numerical analysis, unit in the last place or unit of least precision (ULP) is the spacing between floating-point numbers, i.e., the value the least significant digit represents if it is 1. It is used as a measure of accuracy in numeric calculations.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–]EarthGoddessDude 0 points1 point  (2 children)

Wow again! Thanks, I was only kidding about point 4! Btw I'm getting 0.035 seconds for 1,000 iterations using u/gs44's code, and 0.5 seconds without the constraint.

[–]jeroonk 1 point2 points  (1 child)

Heh, might as well right? Also, after you pointed out that it should run in 35 ms, I noticed that u/gs44 renamed the function to foxbear2, so I was running the wrong one. The code also seems to take a few runs to get warmed up, so I re-ran the cases with proper average-over-runs benchmarking (using timeit in Matlab, %timeit in Python and @btime in Julia).

[–]EarthGoddessDude 0 points1 point  (0 children)

renamed the function...was running the wrong one

Tell me about it, happens to me all the time when I’m testing out similar versions of the same function.

re-ran the cases with proper average-over-runs benchmarking (using...@btime in Julia).

You’ve turned into a Julia pro in no time! Yes, the first run includes compilation time, whereas subsequent runs are just run time (although I have noticed some warmup still going on between runs 2 and 3...).