[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Division operation in parallella
Page 1 of 1

Division operation in parallella

PostPosted: Thu Jul 09, 2015 10:57 pm
by idannben

Re: Division operation in parallella

PostPosted: Fri Jul 10, 2015 5:04 am
by tnt
no

Re: Division operation in parallella

PostPosted: Sun Jul 12, 2015 7:15 pm
by m_labbaf
So, what is the most efficient method to implement floating-point division.
I want to has a real-time application!

Re: Division operation in parallella

PostPosted: Wed Jul 15, 2015 12:15 pm
by piotr5
the most efficient method is to transform division into multiplication with some float.
in pal division is handled by calculating the multiplicative inverse. not sure how the accuracy is there. in gcc a similar method is secretly available (newton?)...

if the number of values you divide by is small, make a list of multiplicative inverses.
also the actual speed for calculating them could be optimized depending on the nature of the values, or accuracy needed.
for example dividing by a power of 2, even inverse power of 2, can be handled by summation and shifts.
or when you have the inverse of 10 then 100 has its square as inverse...

also I've read mathematicians usually never calculate the inverse matrix.
so in your algorithm maybe also actual division could be avoided through slight changes.
please say more about the actual algorithm, maybe there is a possibility to eliminate the divisions?
maybe work with rational numbers as objects and perform comparisons through multiplication...

Re: Division operation in parallella

PostPosted: Sun Jul 19, 2015 10:32 am
by m_labbaf
Actually I have an application that should resolve in real-time.
In this I should solve an mathematical equation in small Time-Step. during this process I should find inverse of 8x8 matrix.
So I want to use Gauss elimination method, that need division in each step.

It will be appreciated, if any idea proposed for finding inverse matrix fast.

thanks

Re: Division operation in parallella

PostPosted: Mon Jul 20, 2015 6:00 am
by piotr5
so your problem is in turning the triangle-matrix into a diagonal one? have you considered that triangle-matrix already is sufficient to your problem and no actual inverse matrix is needed? maybe just representing the solution of the equation as rational numbers would help you? you described the wrong part of your algorithm. the question is, what do you need the solution of the linear equation for? do you know of other algorithms which could use the upper triangle matrix instead of an actual inverse? and if the final output is just a single number, then you need only a single division if you represented intermediate results as rational numbers!

Re: Division operation in parallella

PostPosted: Mon Jul 20, 2015 7:59 am
by m_labbaf
It seems that I should describe my application in more detail, in order to find better solution.
I want to create a real-time simulator for electrical circuit. To solving each circuit we can use nodal method. So, I write nodal equations for my circuit. As my circuit has 8 node, we have a 8x8 matrix. So we have Ax = b which A is 8x8 matrix and x (vector 8x1) is the simulator output and b (vector 8x1) is input of the simulator.
In order to find the x vector as simulator output (equations solution), I should find the solution of this equations.
A matrix isn't triangular at all, but is symmetric and real. I do not convert triangular-matrix to diagonal-matrix. I just want to find the equations unique solution.

Simulator Time-Step is very small, so we should solve equations as fast as possible.
Also, I cannot understand about rational number. Can you describe more about it.

thanks in advance

Re: Division operation in parallella

PostPosted: Mon Jul 20, 2015 8:05 am
by tnt
Rational number is a technique to avoid doing multiple division and defer them all to the end.

Basically you store each number as two numbers N, D and the true value is N / D. (so at the init you have D = 1.0f and N = whatever).

Then when you want to multiple X1 = N1/D1 by X2 = N2/D2 you get Y = (N1 * N2) / (D1 * D2).
When you want to divide X1 by X2 you get Z = (N1 * D2) / (D1 * N2)

Then only at the very end, when you want the actual result, do you do the division.

Re: Division operation in parallella

PostPosted: Tue Oct 04, 2016 9:52 am
by washeryard424