- power::derivative(): slight optimization.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 2 Jan 2001 17:46:07 +0000 (17:46 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 2 Jan 2001 17:46:07 +0000 (17:46 +0000)
ginac/power.cpp

index a0c6ea441620719d6b4dfb7d9f857b8a487999a3..14878a9187f40a588b0ea498336793fd5f1de943 100644 (file)
@@ -545,9 +545,9 @@ ex power::derivative(const symbol & s) const
                return mul(newseq, exponent);
        } else {
                // D(b^e) = b^e * (D(e)*ln(b) + e*D(b)/b)
-               return mul(power(basis, exponent),
+               return mul(*this,
                           add(mul(exponent.diff(s), log(basis)),
-                          mul(mul(exponent, basis.diff(s)), power(basis, -1))));
+                          mul(mul(exponent, basis.diff(s)), power(basis, _ex_1()))));
        }
 }