Skip to content

proposal: helm_table.dat regeneration with higher precision? #1113

Description

@zingale

A while back I wrote an electron-positron EOS that computes the Fermi integrals with 64-, 80-, 128-, or 256-bit precision and with a large number of quadrature points (up to 800 per interval) using the method of Gong et al. 2001.

For cold temperatures, using higher precision and more quadrature points is important for thermodyanmic consistency:

image

This also computes all of the derivatives by differentiating the integrand instead of doing a finite-difference approximation (e.g. for the 3rd and 4th derivatives).

The code is here:

https://github.com/zingale/electron_positron_cxx

and a driver to output a helm_table.dat is here:

https://github.com/zingale/electron_positron_cxx/tree/main/generate_table

My question is whether it is worth investigating different tables with more precision in MESA. The table generation is pretty quick (it is threaded), so I am posting here just to see if there is interest in me exploring this.

As a separate bit, it can also use the almost-log spacing of https://arxiv.org/abs/2501.05410 which I coded up for GPUs (where logs are expensive).

Activity

  1. added
    enhancement
    eos
    on Nov 11, 2026
  2. linked a pull request that will close this issueEOS data loading refactor #1046on Nov 11, 2026
  3. Debraheem commented on Nov 11, 2026

    @Debraheem
    Member

    related: #839

  4. fxt44 commented on Nov 11, 2026

    @fxt44
    Member

    experiments are good!

    helmeos style equations of state depend crucially on subtractions. some quantities, hence the thermodynamic consistency, runs into precision troubles in the upper left (high T, low ρ) and lower right (low T, high ρ) where it becomes the subtraction of two large numbers and hoping for the correct small answer (as adjudicated by your approach above where such subtractions don't occur).

    using a cascading accumulator on the helmeos subtractions would be another interesting experiment to try.

  5. AstroBarker commented on Nov 11, 2026

    @AstroBarker
    Contributor

    Agreed re: "experiments are good"! I do wonder how much a relative deviation of say 10^-60 buys when we ultimately do double precision arithmetic? I don't have much experience here, so it could be more than I anticipate.

    Regarding the not quite transcendental (NQT) logarithms -- have you experimented with thermodynamic consistency when interpolating with them? I have not but I am a bit cautious: the NQT functions leverage a C^1 continuous interpolant. It's unclear how well it plays with e.g., bi-quintic interpolation and higher order thermodynamic derivatives.

  6. zingale commented on Nov 11, 2026

    @zingale
    CollaboratorAuthor

    I have not looked at the consistency with those the NQT. I mainly implemented to see how it affects GPU performance in our codes, since logs are expensive, but it wasn't really a big change, so I haven't pursued it further. It's not the 10^-60 that we care about, but its the O(1) error when 64-bit precision is used in some regimes in the thermodynamic plane that is the concern.

    And since this is only a cost paid once -- when generating the table -- it's pretty easy to do. I can generate a new table tomorrow -- I just will need to sync up the physical constants to the values MESA uses first. 128-bit runs reasonably fast.

  7. fxt44 commented on Nov 11, 2026

    @fxt44
    Member

    per eb's link, even extending a new helm table down to 1e-15 g/cm³ , or even 1e-20 g/cm³ if one dares, could be useful.

  8. linked a pull request that will close this issue[WIP] regenerate helm_table.dat #1119on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementeos

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions