[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

Division operation in parallella

Forum for anything not suitable for the other forums.

Division operation in parallella

Postby idannben » Thu Jul 09, 2015 10:57 pm

idannben
 
Posts: 1
Joined: Thu Jul 09, 2015 6:59 pm

Re: Division operation in parallella

Postby tnt » Fri Jul 10, 2015 5:04 am

no
tnt
 
Posts: 408
Joined: Mon Dec 17, 2012 3:21 am

Re: Division operation in parallella

Postby m_labbaf » Sun Jul 12, 2015 7:15 pm

So, what is the most efficient method to implement floating-point division.
I want to has a real-time application!
m_labbaf
 
Posts: 20
Joined: Sun Mar 29, 2015 7:25 am

Re: Division operation in parallella

Postby piotr5 » Wed Jul 15, 2015 12:15 pm

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...
piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: Division operation in parallella

Postby m_labbaf » Sun Jul 19, 2015 10:32 am

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
Last edited by m_labbaf on Mon Jul 20, 2015 7:59 am, edited 1 time in total.
m_labbaf
 
Posts: 20
Joined: Sun Mar 29, 2015 7:25 am

Re: Division operation in parallella

Postby piotr5 » Mon Jul 20, 2015 6:00 am

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!
piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: Division operation in parallella

Postby m_labbaf » Mon Jul 20, 2015 7:59 am

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
Last edited by m_labbaf on Mon Jul 20, 2015 8:49 am, edited 1 time in total.
m_labbaf
 
Posts: 20
Joined: Sun Mar 29, 2015 7:25 am

Re: Division operation in parallella

Postby tnt » Mon Jul 20, 2015 8:05 am

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.
tnt
 
Posts: 408
Joined: Mon Dec 17, 2012 3:21 am

Re: Division operation in parallella

Postby washeryard424 » Tue Oct 04, 2016 9:52 am

washeryard424
 
Posts: 1
Joined: Wed Sep 28, 2016 10:56 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

cron