Accurate x - log(1+x)
|
05-05-2022, 08:18 PM
(This post was last modified: 05-06-2022 12:15 AM by Albert Chan.)
Post: #2
|
|||
|
|||
RE: Accurate x - log(1+x)
(04-27-2020 07:54 PM)Albert Chan Wrote: I tried to re-use my formula, for log(probability of no repetition) Let's try our new x_sub_log1p function. (note: y = x - log1p(x) ≥ 0) Code: function ln_nr(n,s) -- log(probability of no repetition) lua> P_collision(365, 30) 0.7063162427241915 lua> P_collision(2^128, 5e12) 3.6734198463188465e-014 lua> P_collision(2^128, 2.6153e18) 0.009999839905579181 Let's see what happen if we replace with naive implementation ... lua> function x_sub_log1p(x) return x - log1p(x) end lua> P_collision(365, 30) -- still OK, n is not huge 0.7063162427241918 lua> P_collision(2^128, 5e12) -- bad 7.346839692638293e-014 lua> P_collision(2^128, 2.6153e18) -- bad 0.019899683013021148 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Accurate x - log(1+x) - Albert Chan - 05-05-2022, 07:52 PM
RE: Accurate x - log(1+x) - Albert Chan - 05-05-2022 08:18 PM
RE: Accurate x - log(1+x) - Albert Chan - 05-05-2022, 08:57 PM
RE: Accurate x - log(1+x) - Albert Chan - 05-06-2022, 02:03 PM
RE: Accurate x - log(1+x) - Albert Chan - 05-09-2022, 12:41 AM
RE: Accurate x - log(1+x) - Albert Chan - 04-04-2023, 11:05 PM
|
User(s) browsing this thread: 1 Guest(s)