nerdamer
nerdamer copied to clipboard
Simplification of sqrt
Input | My Answer | Algebrite (@website) | Nerdamer (@demo, expand option) | Nerdamer (@dev, expand option) |
---|---|---|---|---|
4sqrt(24) | 8sqrt(6) | 8 2^(1/2) 3^(1/2) | 8*sqrt(6) | 8*sqrt(6) |
sqrt(128/49) | 8sqrt(2)/7 | 8/7 2^(1/2) | (1/7)*sqrt(128) | (1/7)*sqrt(128) |
sqrt(360)/sqrt(162) | 2/3sqrt(5) | 2/3 5^(1/2) | (2/3)*sqrt(10)*sqrt(2)^(-1) | (2/3)*sqrt(10)*sqrt(2)^(-1) |
3sqrt(6)+5sqrt(6)-7sqrt(6) | sqrt(6) | 2^(1/2) 3^(1/2) | sqrt(6) | sqrt(6) |
sqrt(252)-sqrt(28) | 4sqrt(7) | 4 7^(1/2) | 4*sqrt(7) | 4*sqrt(7) |
sqrt(72)-sqrt(288)+sqrt(576) | -6sqrt(2)+24 | 24 - 6 2^(1/2) | -6*sqrt(2)+24 | -6*sqrt(2)+24 |
3sqrt(2)*2sqrt(6) | 12sqrt(3) | 12 3^(1/2) | 6*sqrt(2)*sqrt(6) | 6*sqrt(2)*sqrt(6) |
sqrt(125)sqrt(18) | 15sqrt(10) | 15 2^(1/2) 5^(1/2) | 15*sqrt(2)*sqrt(5) | 15*sqrt(2)*sqrt(5) |
sqrt(24)(sqrt(12)+sqrt(18)) | 12sqrt(2)+12sqrt(3) | 2 | 4*sqrt(3)*sqrt(6)+6*sqrt(2)*sqrt(6) | 4*sqrt(3)*sqrt(6)+6*sqrt(2)*sqrt(6) |
(sqrt(7)+3sqrt(2))(sqrt(7)-3sqrt(2)) | -11 | -9 nil | 0 | 0 |
(3sqrt(5)-5sqrt(2))^2 | 95-30sqrt(10) | 95 - 30 2^(1/2) 5^(1/2) | -30*sqrt(2)*sqrt(5)+95 | -30*sqrt(2)*sqrt(5)+95 |
x sqrt(x)+x^2sqrt(x^3) | x sqrt(x)+x^3sqrt(x) | x^(3/2) + x^2 (x^3)^(1/2) | x^(3/2)+x^(5/2) | x^(3/2)+x^(5/2) |
sqrt(3a^3)sqrt(6a^5) | 3a^4sqrt(2) | (3 a^3)^(1/2) (6 a^5)^(1/2) | sqrt(3)*sqrt(6)*sqrt(a^3)*sqrt(a^5) | sqrt(3)*sqrt(6)*sqrt(a^3)*sqrt(a^5) |
(sqrt(3x)-sqrt(32y))(sqrt(3x)-sqrt(2y)) | 3x-5sqrt(6x y)+8y | (-nil)^(1/2) | -5*sqrt(2)*sqrt(3)*sqrt(x)*sqrt(y)+3*x+8*y | -5*sqrt(2)*sqrt(3)*sqrt(x)*sqrt(y)+3*x+8*y |
Correction: (sqrt(7)+3sqrt(2))(sqrt(7)-3sqrt(2)) gives (-3sqrt(2)+sqrt(7))(3*sqrt(2)+sqrt(7)) not 0.
I guess some of these can be simplified a bit more but it's going to break quite a few tests. Out of curiosity, why do you keep mentioning Algebrite in your issues?
Correction: (sqrt(7)+3sqrt(2))(sqrt(7)-3sqrt(2)) gives (-3sqrt(2)+sqrt(7))(3sqrt(2)+sqrt(7)) not 0.
Might be a change after I have posted this. I don't know.
I guess some of these can be simplified a bit more but it's going to break quite a few tests.
Tests prevent bugs, not block enhancements 😅
Out of curiosity, why do you keep mentioning Algebrite in your issues?
I didn't keep mentioning it, just here and there. (See https://github.com/jiggzson/nerdamer/issues?q=Algebrite+author%3AHappypig375, just 14 compared to like what, 100s of issues?)
Ok, I will still talk about this.
I first saw Algebrite on the Nerdamer website. Since these two basically do the same thing, I thought it would be interesting to compare these two and see what could be improved (e.g. #164, #196, #209, #210). (Well, I settled with Nerdamer now because of https://github.com/jiggzson/nerdamer/issues/137#issuecomment-326726092, but comparing can still help improve things)
During my initial speed-posting of issues, I started a mini-series of issues labelled "Nerdamer vs Algebrite" to just make these issues be different (thus interesting). Those were:
- #216
- #219
- #239
Then I stopped the sub-series since creating issues like those take a long time, needing to copy/paste to/from Nerdamer demo and Algebrite website, plus converting function names.
Nowadays when I return to one of these three, I continue to use the format from above because I wanted to keep consistent inside the issue.
Maybe when I feel like it I will make another one, but not right now.
Tests prevent bugs, not block enhancements :sweat_smile:
Agreed but who's going to do the updating and verification of accuracy? If this breaks enough tests I can live with the current results.
As I mentioned I was just curious what the motivation was behind creating those. Now I know. :smile:
Agreed but who's going to do the updating and verification of accuracy? If this breaks enough tests I can live with the current results.
Maybe I will do this myself when 0.8 is here then.
As I mentioned I was just curious what the motivation was behind creating those. Now I know.
The more you know... ( ͡° ͜ʖ ͡°)
(sqrt(7)+3sqrt(2))(sqrt(7)-3sqrt(2))
is clearly a bug. Thanks to the bug I found 2 more deeply hidden bugs. For both 6*sqrt(2)*sqrt(6)
and x^(3/2)+x^(5/2)
it requires me to keep looking at the result which is not ideal so I'm leaving those two as-is for now.