Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 344
    • Issues 344
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #23415

sample_laplace_distribution() should take multiple random inputs

Currently, sample_laplace_distribution() takes a random double as input, and then extracts the following random values:

  • a random sign
  • a random value in (0.0, 1.0]

This reduces the precision of the result. For details, see: https://trac.torproject.org/projects/tor/ticket/23061#comment:32

Instead, the function could take a random boolean sign and p, and the transform becomes:

result = mu - b * (sign ? 1.0 : -1.0)
                * tor_mathlog(1.0 - p);

This would increase the precision by one bit, plus whatever precision is lost in 2.0 * fabs(p - 0.5).

This may have been introduced in dad5eb7e.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking