From d5725d770e7af0871a3d122e69ca60eaa115aadf Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Fri, 12 May 2023 22:31:07 -0400 Subject: [PATCH] Fix pow() derivative --- src/arithmetic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {