Skip to content

Commit

Permalink
Fix pow() derivative
Browse files Browse the repository at this point in the history
  • Loading branch information
davepagurek committed May 13, 2023
1 parent 91d581a commit d5725d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arithmetic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d5725d7

Please sign in to comment.