Derivative by nn

gsub(/[-+]?[0-9.]*/," & "){o=i=_
for(a=$++i;a~"x"?a=1:$++i~"x";a=c~"\^"?$++i:c){c=$++i
a*1||a=a 1
a*=b=c~"\^"?$++i:1
o=o(o&&a>0?"+":_)(--b?(a-1?a+1?a:"-":_)(b-1?"x^"b:"x"):a)}}$0=o?o:0_

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page