88using System . Windows . Forms ;
99using System . IO ;
1010using GOLD ;
11- using MathExpressions . NET . GUI . Properties ;
11+ using MathExpressionsNET . GUI . Properties ;
1212using System . Globalization ;
1313using System . Threading ;
1414
15- namespace MathExpressions . NET . GUI
15+ namespace MathExpressionsNET . GUI
1616{
1717 public partial class frmMain : Form
1818 {
@@ -130,10 +130,11 @@ private void UpdateResult()
130130
131131 var variable = string . IsNullOrEmpty ( tbVar . Text ) ? null : new VarNode ( tbVar . Text . ToLowerInvariant ( ) ) ;
132132
133+ string input = tbInput . Text . Replace ( Environment . NewLine , "" ) ;
133134 MathFunc simplifiedFunc = null ;
134135 try
135136 {
136- simplifiedFunc = new MathFunc ( tbInput . Text , tbVar . Text ) . Simplify ( ) ;
137+ simplifiedFunc = new MathFunc ( input , tbVar . Text ) . Simplify ( ) ;
137138 tbSimplification . Text = simplifiedFunc . ToString ( ) ;
138139 tbSimplifiedOpt . Text = simplifiedFunc . GetPrecompilied ( ) . ToString ( ) ;
139140 }
@@ -152,7 +153,7 @@ private void UpdateResult()
152153
153154 try
154155 {
155- var compileFunc = new MathFunc ( tbInput . Text , tbVar . Text , true , true ) ;
156+ var compileFunc = new MathFunc ( input , tbVar . Text , true , true ) ;
156157 compileFunc . Compile ( Assembly , "Func" ) ;
157158
158159 var sb = new StringBuilder ( ) ;
@@ -170,7 +171,7 @@ private void UpdateResult()
170171 MathFunc derivativeFunc = null ;
171172 try
172173 {
173- derivativeFunc = new MathFunc ( tbInput . Text , tbVar . Text ) . GetDerivative ( ) ;
174+ derivativeFunc = new MathFunc ( input , tbVar . Text ) . GetDerivative ( ) ;
174175 tbDerivative . Text = derivativeFunc . ToString ( ) ;
175176 tbDerivativeOpt . Text = derivativeFunc . GetPrecompilied ( ) . ToString ( ) ;
176177 }
@@ -187,7 +188,6 @@ private void UpdateResult()
187188 try
188189 {
189190 var compileDerivativeFunc = new MathFunc ( tbDerivative . Text , tbVar . Text , true , true ) ;
190- compileDerivativeFunc . DerivativeDelta = double . Parse ( tbDerivativeDelta . Text ) ;
191191 compileDerivativeFunc . Compile ( Assembly , "FuncDerivative" ) ;
192192 var sb = new StringBuilder ( ) ;
193193 compileDerivativeFunc . Instructions . ToList ( ) . ForEach ( instr => sb . AppendLine ( instr . ToString ( ) . Replace ( "IL_0000: " , "" ) ) ) ;
0 commit comments