diff --git a/src/arithmetic.ts b/src/arithmetic.ts index 122f2c7..4333cc6 100644 --- a/src/arithmetic.ts +++ b/src/arithmetic.ts @@ -45,7 +45,7 @@ export class Pow extends Op { derivative(param: Param) { const [a, b] = this.dependsOn if (b.isConst()) { - return `${b.ref()}*pow(${a.ref()},${b.ref()}-1.0)` + return `${b.ref()}*pow(${a.ref()},${b.ref()}-1.0)*${a.derivRef(param)}` } else if (a.isConst()) { return `pow(${a.ref()},${b.ref()})*log(${a.ref()})*${b.derivRef(param)}` } else {