Giter VIP home page Giter VIP logo

jsoftfloat's People

Contributors

thethirdone avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jsoftfloat's Issues

Implement logarithm function

Division, SquareRoot and Logarithm are more difficult than addition and multiplication because they can result in infinite digits. The simple algorithm for long division gives a simple way to find the answer up to x digits though. Squareroot can also be found exactly up to x digits by using the bisection method (works particularly well for binary floats). But logarithm is slightly harder to get the precise answer up to ``x` digits because there isn't an exact exponential function either. This means that in order to get the correct rounding, more sophisticated error bounding is needed.

Typically this is done with Newton-Raphson iteration and precomputed tables, and continuing until the error is between floating-point values. I would like to keep the code simpler than anything more complex than what I can understand directly from reading the code though. One of the goals of this project is to have a readable, correct floating-point implementation; using more complex algorithms runs counter to that goal.

I'm not sure how to proceed. I will probably just work on other things until I get an idea (it worked for sqrt).

jsoftload package does not exist

I'm trying to install RARS assembler to an offline machine. I get jsoftload package does not exist when I run build-jar.sh. So I extracted jsoftload source to my machine bu I still get this error.

Underflow rounding is incorrect

small should round to 0 or Float32(1) depending on rounding mode, but it always goes to 0.

        ExactFloat small = new Float32(1).toExactFloat();
        small = small.divide(new ExactFloat(BigInteger.valueOf(4)),4);

I also believe, when divided by 2, this doesn't trigger underflow.

fmadd.d fa0, [1], [1], [0] produces 0 in fa0

This code produces actual zero when computes 1*1+0 by fmadd.d fa0, ft1, ft2, ft0:

	li		t1 1
	fcvt.d.w	ft2, t1
	fcvt.d.w	ft1, t1
	fcvt.d.w	ft0, zero
	fmadd.d		fa0, ft2, ft1, ft0

The result is 0 in fa0 instead of 1

The problem is here. Perhaps, here must be not ||, but &&?

Inconsistent results multiplying to near subnormal boundry

The simplest case I could create which shows this is F32(0x43c0a000) + F32(0x0000476e) which should equal F32(0x006B7E4A), but instead equals F32(0x00EB7E4A).

The key seems to be the lowest exponent bit is set erroneously. The extra details in both numbers seem to be important, but its not clear yet how.

Inconsistencies adding near subnormal edge

There are several issues related to addition near the the subnormal boundary, the answer correctly given is clearly wrong and there has to be an off by one or something in the exact conversion (has to be an a weird issue as it has been completely tested for to exact and back) or addition code (not as well tested) .

For example, F32(0x00F00000) + F32(0x00100000) should equal F32(0x01000000), but instead equals F32(0x00F80000)

This shouldn't be a super hard bug to track down, but I'm not going to be able to fix it immediately.

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.