Author Topic: Large integers and floats  (Read 1880 times)

nidud

  • Member
  • *****
  • Posts: 1531
    • https://github.com/nidud/asmc
Re: Large integers and floats
« Reply #15 on: July 04, 2018, 09:12:24 PM »
so wouldnt this be possible to use for faster computation of PI with loads of decimals,compared to have some almost unlimited Array of numbers other ways?

Yes, it allows computation directly which simplify declarations. The internal calculation must be higher than max storage (REAL10 in MASM) so this is now extended from 96-bit to 128-bit to handle REAL16.

The values based on PI may thus be declared using macros as above or directly:
Code: [Select]
PI    equ 3.141592653589793238462643383279502884197169399375105820974945
...
PI_2  equ PI / 2.0
PI_4  equ PI / 4.0

Right taylor series,but i have todo research first,maybe arcsine where sine pi is
Also Real16 sine would be useful or you already made that nidud?

The assembler allows usage of Add(+), Subtract(-), Multiply(*), and Divide(/) directly which uses REAL16 internally, so it should be possible to construct static functions using macros based on this.

I'm currently implementing a DirectXMath library for testing out the vectorcall implementation which includes passing of arguments, assigning values and return codes
using vectors, so this may clarify how REAL16 values may be used.

The only compiler using REAL16 internally (as far as I know) is the Intel Fortran Compiler in addition to a few open source libraries, so this is more about how Asmc handles floats internally than any practical use, at least for now. This basically simplify the xmm versus pointers/regs using INVVOKE given all REALx values is passed in xmm registers.
Code: [Select]
VECTOR TYPEDEF REAL16

daydreamer

  • Member
  • ***
  • Posts: 471
Re: Large integers and floats
« Reply #16 on: July 05, 2018, 02:11:04 AM »
I have looked at taylor series for trigo
I tested with arcsin with a scientific calculator and I think 2xarcsin (1.0) would work for pi calculation
Sine is a series that include x^2/3! Changing every time sign and increasing x^3/ while increasing 4!,5! Etc
The x! Increases very fast to high integer numbers ,i think 10!,is the number of combinations you can put numbers 1-10 in
I hope raymond or any math skilled would like to explain best way to calculate this function ???
I wonder how many calculations in sine taylor series is needed for real16 precision

Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

daydreamer

  • Member
  • ***
  • Posts: 471
Re: Large integers and floats
« Reply #17 on: July 06, 2018, 03:52:57 AM »
I think sine Taylor series calculation,should use constants 1/(3!),1/(5!),1/(7!),1/(9!)... Until it's enough for real16 precision and many divisions will be replaced by faster mul and cache previous x*x*x calculations to be used in x^5,x^7,x^9... Calculations, maybe possible to write parallel code for simultaneously multiply 4 or more of the above constants to take advantage of cpu that can handle execute many mulpd in parallel
I am actually working on coding sine function to get it right first and compare to built in sine function,so I can compare precision vs speed

Now i know what a real16 is:
Real10 is a supermodell woman,10 on 1-10 scale
Real16 is the wife of a man who says "my wife is the most beautiful woman in the World" :biggrin:
« Last Edit: July 07, 2018, 01:53:15 AM by daydreamer »
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*