josdejong / josdejong/mathjs

simplify `sqrt(x)*sqrt(x)`

Open
#3,231 4 comments 0 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I asked it to simplify sqrt(x)*sqrt(x) and it couldn't do it. Nor could it do really anything with sqrt. As soon as I added the following single rule, it works perfectly and does all the things you would hope it should know how to do!

```
const simpRules = [...(math.simplify.rules)];
simpRules.push('sqrt(n1) -> n1^0.5');
math.simplify(exp,simpRules);
```

I suggest adding 'sqrt(n1) -> n1^0.5' to simplify.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.