Git Product home page Git Product logo

Comments (4)

rmjarvis avatar rmjarvis commented on September 28, 2024

I couldn't reproduce the exact result you had. On my laptop, this results in the following:
junk

A little bit smaller residuals, and a different pattern. Apparently the rounding behavior on my laptop is somewhat different than on collab. If you use double precision though, the differences are ~1.e-15.

So I think this isn't a problem with the method per se. Just single-precision floating point errors accumulating. But they are a fair bit higher than the single-precision epsilon value, so I switched the code to use double precision for the phases, which basically fixed it. cf. #1234

from galsim.

EiffL avatar EiffL commented on September 28, 2024

Hum interesting, I wouldn't have guessed platform-specific discrepancies at that level. But ok, if you recover 1e-15 using double precision then you are right it's not related to an approximation in this formula used to compute the phase.

from galsim.

rmjarvis avatar rmjarvis commented on September 28, 2024

The first equation is nominally exact, but can have rounding errors. The line you pointed to was intended to get back to |z|=1, which it does to the accuracy of the data type. So the errors are just that numerical rounding errors can add up, maybe semi-coherently, rather than purely randomly. And apparently differently on different systems. That surprised me too, FWIW.

from galsim.

rmjarvis avatar rmjarvis commented on September 28, 2024

Done. #1234

from galsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.