From 8449f009b13d808c3f0655f98f664748eab24e4b Mon Sep 17 00:00:00 2001 From: Abhishek Sathiabalan Date: Thu, 26 Dec 2019 12:21:15 -0500 Subject: [PATCH] Fixed Incorrect Trig Derivative bug #31 --- AbMath/AbMath.dll | Bin 121344 -> 121344 bytes AbMath/Calculator/AST.cs | 58 +++++++++--------- .../Apportionment/Calculator/Derivative.cs | 8 +-- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/AbMath/AbMath.dll b/AbMath/AbMath.dll index a28caec84ec06c9b823454ed800023853887f237..6cc04e22f4240d819d9341fe78bfcf031e1a653e 100644 GIT binary patch delta 12539 zcmaKz30#y__s7q97-nbYnP-MY_I(f$ao#gFU#tW)!qwP(@{!Gc8?x(1=HPqANm+)yDfw7YKoiy zZd+c6JAJUfx5bbLQF0`@D~5);bBWzU{SdEuJ;SOI2Y4SC;gqDf81KYUI!OwR^8V-H zb0~F=a6gp&BW8KK=KL3NzxTs2QxLPgDPt*LQfdn!F>Pcpvd8x2+%)8{N;2 zZ-Hg*^e2Pe1qFH<4Ve)VSyq)0S(wohrd1_G8EiyR#=XU zlW_$*p}|JeRSC^(E8GuF35i^B-zkaye##Ye$`C0b)m=6vA!m7Zw> zpivLH)ct0DC@yjT(%z14_u2f={_d*6XX5^GkXM>=*j}kBOl|RxV!i6KF1fFs?)M8L zl>e!l$35<`&=E`jrJ~Dx74@)+F8h~?F2BE`%SA=if-ZIIruXi$N(x&<=fi}c!X3P1 z!M0UZ2_c31MEwXt3y(5L+ClYCno1>UVUh~Zq`HrdjS7FQX%lh$AqDm6)2rxOunoP& zswA(xe+w(!4b!u*(%pJSu))|$y+oC)5u+>FB?{tG)QFY;ST3>^TW;*@O|_G3umA7W zS>3c5+v{uttN*1U758ta;=YQkcI#%g#47iP!$R;4cg)ivG1XEMJxgdiFQU`gstYdA z(d_GOZ>WO}Qk2zweyAfTUmRpTtJNG1VYUtKw`MkTZQ!l;oO&#ijiI@4zKQ`h3W%~4 zmNUG+x+`glm-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)]/cos(x) -> f(x) * tan(x) + //sin(x)/[f(x) * cos(x)] -> tan(x)/f(x) + //[f(x) * sin(x)]/[g(x) * cos(x)] -> [f(x) * tan(x)]/g(x) + + //TODO: [1 + tan(f(x))^2] -> sec(f(x))^2 + //TODO: [cot(f(x))^2 + 1] -> csc(f(x))^2 + + //These will probably violate domain constraints ? + //TODO: sec(x)^2 - tan(x)^2 = 1 + //TODO: cot(x)^2 + 1 = csc(x)^2 + //TODO: csc(x)^2 - cot(x)^2 = 1 + + //TODO: Double Angle + //[cos(x)^2 - sin(x)^2] = cos(2x) + //1 - 2sin(x)^2 = cos(2x) + //2cos(x)^2 - 1 = cos(2x) + //2sin(x)cos(x) = sin(2x) + //[2tan(x)]/1 - tan(x)^2] = tan(2x) + + //TODO: Power Reducing + //[1 - cos(2x)]/2 = sin(x)^2 + //[1 + cos(2x)]/2 = cos(x)^2 + //[1 - cos(2x)]/[1 + cos(2x)] = tan(x)^2 + } @@ -637,32 +663,6 @@ private void Simplify(RPN.Node node, SimplificationMode mode) RPN.Node division = new RPN.Node(new[] { node[0, 1], cot }, new RPN.Token("/", 2, RPN.Type.Operator)); Assign(node, division); } - //TODO: - //[f(x) * cos(x)]/[g(x) * sin(x)] -> [f(x) * cot(x)]/g(x) - - //[f(x) * sin(x)]/cos(x) -> f(x) * tan(x) - //sin(x)/[f(x) * cos(x)] -> tan(x)/f(x) - //[f(x) * sin(x)]/[g(x) * cos(x)] -> [f(x) * tan(x)]/g(x) - - //TODO: [1 + tan(f(x))^2] -> sec(f(x))^2 - //TODO: [cot(f(x))^2 + 1] -> csc(f(x))^2 - - //These will probably violate domain constraints ? - //TODO: sec(x)^2 - tan(x)^2 = 1 - //TODO: cot(x)^2 + 1 = csc(x)^2 - //TODO: csc(x)^2 - cot(x)^2 = 1 - - //TODO: Double Angle - //[cos(x)^2 - sin(x)^2] = cos(2x) - //1 - 2sin(x)^2 = cos(2x) - //2cos(x)^2 - 1 = cos(2x) - //2sin(x)cos(x) = sin(2x) - //[2tan(x)]/1 - tan(x)^2] = tan(2x) - - //TODO: Power Reducing - //[1 - cos(2x)]/2 = sin(x)^2 - //[1 + cos(2x)]/2 = cos(x)^2 - //[1 - cos(2x)]/[1 + cos(2x)] = tan(x)^2 } else if (mode == SimplificationMode.Swap) { @@ -1943,8 +1943,9 @@ private void Derive(RPN.Node foo, RPN.Node variable) RPN.Node subtraction = new RPN.Node(new[] { new RPN.Node(1), exponent }, new RPN.Token("-", 2, RPN.Type.Operator)); RPN.Node sqrt = new RPN.Node(new[] { subtraction }, new RPN.Token("sqrt", 1, RPN.Type.Function)); + RPN.Node abs = new RPN.Node(new[] { body.Clone() }, new RPN.Token("abs", 1, RPN.Type.Function)); RPN.Node denominator = - new RPN.Node(new[] { sqrt, Clone(body) }, new RPN.Token("*", 2, RPN.Type.Operator)); + new RPN.Node(new[] { sqrt, abs }, new RPN.Token("*", 2, RPN.Type.Operator)); RPN.Node division = new RPN.Node(new[] { denominator, bodyDerive }, new RPN.Token("/", 2, RPN.Type.Operator)); @@ -1975,8 +1976,9 @@ private void Derive(RPN.Node foo, RPN.Node variable) RPN.Node subtraction = new RPN.Node(new[] { new RPN.Node(1), exponent }, new RPN.Token("-", 2, RPN.Type.Operator)); RPN.Node sqrt = new RPN.Node(new[] { subtraction }, new RPN.Token("sqrt", 1, RPN.Type.Function)); + RPN.Node abs = new RPN.Node(new[] { body.Clone() }, new RPN.Token("abs", 1, RPN.Type.Function)); RPN.Node denominator = - new RPN.Node(new[] { sqrt, Clone(body) }, new RPN.Token("*", 2, RPN.Type.Operator)); + new RPN.Node(new[] { sqrt, abs }, new RPN.Token("*", 2, RPN.Type.Operator)); RPN.Node multiplication = new RPN.Node(new[] { new RPN.Node(-1), bodyDerive }, new RPN.Token("*", 2, RPN.Type.Operator)); RPN.Node division = new RPN.Node(new[] { denominator, multiplication }, diff --git a/Unit Tester/Apportionment/Calculator/Derivative.cs b/Unit Tester/Apportionment/Calculator/Derivative.cs index 2d10eb0..a382df6 100644 --- a/Unit Tester/Apportionment/Calculator/Derivative.cs +++ b/Unit Tester/Apportionment/Calculator/Derivative.cs @@ -220,20 +220,20 @@ public void ArcCot() public void ArcSec() { RPN test = new RPN("derivative( arcsec(x), x)").Compute(); - Assert.AreEqual("1 x x 2 ^ 1 - sqrt * /", test.Polish.Print()); + Assert.AreEqual("1 x abs x 2 ^ 1 - sqrt * /", test.Polish.Print()); test.SetEquation("derivative( arcsec(x^2), x)").Compute(); - Assert.AreEqual("2 x * x 2 ^ x 4 ^ 1 - sqrt * /", test.Polish.Print()); + Assert.AreEqual("2 x * x 2 ^ abs x 4 ^ 1 - sqrt * /", test.Polish.Print()); } [Test] public void ArcCsc() { RPN test = new RPN("derivative( arccsc(x), x)").Compute(); - Assert.AreEqual("-1 x x 2 ^ 1 - sqrt * /", test.Polish.Print()); + Assert.AreEqual("-1 x abs x 2 ^ 1 - sqrt * /", test.Polish.Print()); test.SetEquation("derivative( arccsc(x^2), x)").Compute(); - Assert.AreEqual("-2 x * x 2 ^ x 4 ^ 1 - sqrt * /", test.Polish.Print()); + Assert.AreEqual("-2 x * x 2 ^ abs x 4 ^ 1 - sqrt * /", test.Polish.Print()); } [Test]