Multiplying Polynomials

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Multiply several polynomials (real or complex) to create a new polynomial. This idea came from creating programs in the esoteric language Polynomial, see: http://esoteric.voxelperfect.net/wiki/Polynomial. Note that extremely large coefficients will often be in the result, so (depending on your language) it might be a good idea not to use the regular data types when multiplying.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

(x + 3)(x + 9)

Sample output:

x^2 + 12x + 27

Sample input:_

(x + 4)(x - 7)(x - 2i)(x + 2i)

Sample output:

x^4 - 3x^3 - 24x^2 - 12x - 112

Sample input:_

(x - 1 - 2i)(x - 1 + 2i)(x - 243)(x - 25i)(x + 25i)(x - 7i)(x + 7i)(x - 1 - 11i)(x - 1 + 11i)(x - 4826809)

Sample output:

x^10 - 4827056x^9 + 1192223600x^8 - 8577438158x^7 + 958436165464x^6 - 4037071023854x^5 + 141614997956730x^4 - 365830453724082x^3 + 5225367261446055x^2 - 9213984708801250x + 21911510628393750

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1@tttttanaka2540.05642012/03/17 13:26:520B / 174B / 48B

Python _

RankUserSizeTimeDateStatistics
1hallvabo1910.07362010/05/21 00:37:0980B / 68B / 42B
2tobiesque2580.08242010/05/17 06:44:460B / 182B / 44B
3primo2870.08212010/05/17 04:32:320B / 138B / 133B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima2670.13102010/05/18 18:49:020B / 187B / 47B

Arc _

RankUserSizeTimeDateStatistics
1youz1605.99922010/05/20 20:16:510B / 64B / 85B

Xtal _

RankUserSizeTimeDateStatistics
1pooq2710.06892010/10/08 20:12:250B / 190B / 49B

J _

RankUserSizeTimeDateStatistics
1I., S.1380.09842011/03/07 22:36:460B / 23B / 110B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai (embed)2790.10162010/10/07 22:27:000B / 196B / 50B

R _

RankUserSizeTimeDateStatistics
1pooq2600.89292011/01/28 18:31:130B / 184B / 44B

Vim _

RankUserSizeTimeDateStatistics
1nn2430.10822010/05/18 13:20:332B / 180B / 57B

Language Ranking_

RankLangUserSizeScore
1JI., S.13810000
2Arcyouz1608625
3Pythonhallvabo1917225
4Vimnn2435679
5Ruby@tttttanaka2545433
6Rpooq2605307
7Common LISPkozima2675168
8Xtalpooq2715092
9OCamlm.ukai (embed)2794946

return top