# speed of unbalanced multiplication

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Thu Feb 7 12:56:48 CET 2013

```Ciao Niels,

Il Gio, 7 Febbraio 2013 10:29 am, Niels Möller ha scritto:
> But if we change the meaning of r, maybe it would make sense to
> interpret it as follows:
>
>   if r <= size, it's the size of the smaller operand (what your change
>   does).
>
>   if r > size, its the size of the *product*, so do size limbs by (r -
>   size) limbs.

I suggest:
If r > 0, it's the size of the smaller operand.

If r < 0, its absolute value is the size of the *product*.

This way, the meaning of r does not depend on size. In both cases, the -s
parameter gives the larger size.

An example:
\$ tune/speed -s 1-10 mpn_mul.-6 mpn_mul.6
mpn_mul.-6     mpn_mul.6
1                 n/a           n/a
2                 n/a           n/a
3        #0.000000288           n/a
4        #0.000000202           n/a
5        #0.000000165           n/a
6                 n/a  #0.000000637
7                 n/a  #0.000000639
8                 n/a  #0.000000708
9                 n/a  #0.000000786
10                n/a  #0.000000860

Regards,
m

--
http://bodrato.it/

```