Cody

Jess Stuart

2603
Rank
3
Badges
485
Score
51 – 62 of 62

Jess Stuart submitted a Comment to Problem 2033. poll: would you like the regexp (?@cmd) functionality to be banned in Cody?

Is there a way to parse the code inside the regex and assign an appropriate size to it? That would seem like the most fair thing to do.

on 7 Feb 2017

Jess Stuart submitted a Comment to Problem 42775. Raise a polynomial to a power

Thought of another way to do this... q=poly(kron(roots(p),ones(N,1))); One-liner with size 21, but fails because of trivial roundoff error :(

on 6 Feb 2017

Jess Stuart received Solver badge for Solution 1114855

on 2 Feb 2017

Jess Stuart submitted a Comment to Solution 1114065

Here is my algorithm that "failed" the isequal test by -5e-14 on a few values. I thought I would actually try to write a somewhat fast algorithm instead of just a for loop calling conv() repeatedly and reallocating memory each time. function q = polypow(p,N) q=ifft((fft([p zeros(1,(N-1)*(length(p)-1))])).^N); end

on 2 Feb 2017

Jess Stuart received Commenter badge for Solution 1114065

on 2 Feb 2017

Jess Stuart submitted a Comment to Solution 1114065

This is a numerical algorithm and is not exact, but very accurate. I'm failing the test because the output for p=1:5; N=3 is off by this amount... -3.4972e-14 8.8818e-15 3.5527e-14 0.0000e+00 0.0000e+00 -2.8422e-14 Columns 7 through 12: 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -5.6843e-14 Column 13: 0.0000e+00 COMPLETELY RIDICULOUS!!!!. Using isequal() is a poor choice for evaluating numerical algorithms.

on 2 Feb 2017

51 – 62 of 62