本文介绍了仅使用三个乘法的复数乘积的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们进行复数乘法,如下所示:

We do complex number multiplication as follows:

(a + i * b) * (c + i * d) = (a * c - b * d) + i * (a * d + b * c)

结果的实部和虚部是

real part = (a * c - b * d)
imag part = (a * d + b * c)

这涉及四个实数乘法.只有三个实数乘法怎么办?

This involves four real multiplications. How can we do it with only three real multiplications?

推荐答案

您对两个数字感兴趣:A=ac−bdB=ad+bc.计算三个实数乘法S1=acS2=bdS3=(a+b)(c+d).现在您可以将结果计算为A=S1−S2B=S3−S1−S2.

You are interested in two numbers : A=ac−bd and B=ad+bc. Compute three real multiplications S1=ac, S2=bd, and S3=(a+b)(c+d). Now you can compute the results asA=S1−S2 and B=S3−S1−S2.

此过程称为Karatsuba乘法,在算法分析中大量使用.

This process is called Karatsuba multiplication and used heavily in Algorithm analysis.

它用于查找最接近的一对点.

It is used to find the closest pair of points.

这篇关于仅使用三个乘法的复数乘积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 12:13