#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# Need java program to satisfy two functions.

Posts: 1Member
I need to show how to compute both:
X=ab+bc+ad-cc and Y=ab+cc+cd by using only a total of 3 multiplications for both equations. Inputs must be a,b,c and d and output both x and y.

Thanks
· ·

• Posts: 6,349Member
: I need to show how to compute both:
: X=ab+bc+ad-cc and Y=ab+cc+cd by using only a total of 3
: multiplications for both equations. Inputs must be a,b,c and d and
: output both x and y.
:
: Thanks
:
What you need to do is to rewrite the functions. I managed to rewrite them to 4 multiplications:
[code]
X = a*(b+d)+c*(b-c)
Y = a*b + c*(c+d)
[/code]
Eliminating the last one eludes me.
· ·
• Posts: 1Member
: I need to show how to compute both:
: X=ab+bc+ad-cc and Y=ab+cc+cd by using only a total of 3
: multiplications for both equations. Inputs must be a,b,c and d and
: output both x and y.
:
: Thanks
:
Hi !
I don't know if you need it yet but there is a solution:
X = (a + c)*(b + d) - c*(c + d)
Y = c*(c + d) + a*b

By the way the similar idia was used in Shtrassen algoritm of multiply matrices : for putting down the time of running from n^ 3 to n ^ log 7

Regards
Alexey

· ·