Code Monkey home page Code Monkey logo

surreal's People

Contributors

lacaranian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

surreal's Issues

Add conversion functions for numbers

There should be robust conversion functions between surreal numbers and the other numerical types that lie within the field. These include:

  • Integers
  • Rationals
  • Reals

Improve code organization

The code is currently sitting in a monolithic file without any modularity. This should be changed to a module which does not export utility functions.

Implement infinite sets of Surreals

Find a way to represent infinite sets of surreals in the left or right set of a surreal, allowing for representation of infinite ordinals and infinitesimals, and numbers such as 1/3.

Implement division

Division of surreal numbers is a monster. The left set and right set of the result of division are defined in terms of one another, which has the potential to require an infinite sequence of surreals to provide a valid result. The formula for the division of two surreal numbers (restricting z_L to positive options) is:

x = y / z = y * {0 , (1+(z_R-z)_x_L)/z_R , (1+(z_L-z)_x_R)/z_L | (1+(z_L-z)_x_L)/z_L , (1+(z_R-z)_x_R)/z_R }

An example: 1/3 is equal to {0|} / {2|}, which produces {0 , (1-x_R)/2 | (1-x_L)/2} (null left or right sets render their "blueprint" unusable, so it won't contribute new elements). This produces {0 , (1-x_R)/2 | 1/2 , (1-x_L)/2}, which then allows {0 , 1/4 , (1-x_R)/2 | 1/2 , (1-x_L)/2}, and so on, until the infinite sequences become {0 , 1/4 , 5/16 ... | 1/2 , 3/8 , 11/32 ...}. This is a correct representation of 1/3, but takes an infinite amount of memory to represent in the current paradigm.

Improve evaluation speed

The evaluation speed for simple arithmetic operations is dismal. This is due primarily to the recursive structure of a surreal, which causes any recursively defined operation to explode as the number of operations increases. I need to ensure that the canonical form of a surreal is preferred and the evaluation of operations that would typically involve large thunks when evaluated lazily is made strict.

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.