Giter VIP home page Giter VIP logo

Comments (3)

Shimuuar avatar Shimuuar commented on May 24, 2024 1

I wish i knew. It's very much open problem and it seems not much research about it. I didn't look much though. I guess best introductory reading about floating point and its problems is "What every computer scientist should know about floating-point"

Problem with approximate equality is it's extremely context dependent and exact meaning of "approximately" depends on problem at hand. Relative equality |a - b| / max |a| |b| < ε forks fine save for problem of choosing ε. Absolute difference |a-b|<ε breaks down when value vary over many orders of magnitude. Once you go to more complex objects such as vectors/matrices there're much more ways to compare them. Thus type class with method approximately equal is impossible. Best we can hope is to provide tools and combinators for user

from dh-core.

nstepp avatar nstepp commented on May 24, 2024 1

Would it be reasonable to take the pytest approach and use both relative and absolute tests?

A set of utility functions could be provided along these lines, and it seems to me that providing type classes that are sufficiently constrained makes sense. For instance, providing instances only for field-level types and using tools for more complex objects. But I'm quite open to being wrong about that.

from dh-core.

AdLucem avatar AdLucem commented on May 24, 2024

I'm interested in this, but I wouldn't know where to start looking for theory about approximate comparisions. Can you give me some pointers?

Edit: also, type classes for approximate comparision of other data types- particularly vectors and matrices- would be incredibly useful.

from dh-core.

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.