Skip to content

document approach to accuracy #134

Open

Description

@tpapp

Following up on the recent discussion at #45, we should perhaps consider documenting the package's approach to accuracy.

I would say roughly this:

  1. We aim for accurate implementations of at least Float64 inputs. "Accurate" is determined as a practical trade-off.
  2. Most methods have ::Float32 and ::Float16 implementations, with similar aims.
  3. All methods have a generic fallback, which may not be as accurate but should not produce wildly incorrect results.
  4. Docstrings should document more specific claims for each method.
  5. If more accuracy is needed, please open an issue.

Activity

  1. tpapp commented on Nov 9, 2026

    @tpapp
    CollaboratorAuthor

    Also, just my personal comment: I usually work with logs because they improve accuracy of my calculations per se. They are very costly (it is not uncommon for LogExpFunctions to eat up 50% of CPU time in an economic model), but worth it because they handle differing magnitudes so well.

    However, I don't need log calculations themselves to be accurate to the last ulp. For my purposes accuracy comes from just using logs, not the logs being super-accurate. At some point diminishing returns kick in.

  2. andreasnoack commented on Nov 9, 2026

    @andreasnoack
    Member

    I've summarized the situation in #135. I don't think it is a matter of losing a bit of precision. The fallbacks can lose almost all precision, and in a larger codebase, it can be quite hard to identify where such loss of precision happens. As mentioned in #45, my opinion is that functions like the ones in this repo should only be defined when they provide reasonable precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions