@@ -28,7 +28,7 @@ public static partial class FunctionMath {
2828 /// </remarks>
2929 public static IntegrationResult Integrate ( Func < double , double > integrand , double start , double end ) {
3030 IntegrationSettings settings = new IntegrationSettings ( ) ;
31- return ( Integrate ( integrand , start , end , settings ) ) ;
31+ return Integrate ( integrand , start , end , settings ) ;
3232 }
3333
3434 /// <summary>
@@ -50,7 +50,7 @@ public static IntegrationResult Integrate(Func<double, double> integrand, double
5050 /// </remarks>
5151 public static IntegrationResult Integrate ( Func < double , double > integrand , Interval range ) {
5252 IntegrationSettings settings = new IntegrationSettings ( ) ;
53- return ( Integrate ( integrand , range , settings ) ) ;
53+ return Integrate ( integrand , range , settings ) ;
5454 }
5555
5656 internal static IntegrationSettings SetIntegrationDefaults ( IntegrationSettings settings ) {
@@ -76,7 +76,7 @@ internal static IntegrationSettings SetIntegrationDefaults (IntegrationSettings
7676 /// <para>For information, see <see cref="Integrate(Func{double, double}, double, double, IntegrationSettings)"/>.</para>
7777 /// </remarks>
7878 public static IntegrationResult Integrate ( Func < double , double > integrand , Interval range , IntegrationSettings settings ) {
79- return ( Integrate ( integrand , range . LeftEndpoint , range . RightEndpoint , settings ) ) ;
79+ return Integrate ( integrand , range . LeftEndpoint , range . RightEndpoint , settings ) ;
8080 }
8181
8282 /// <summary>
@@ -117,8 +117,8 @@ public static IntegrationResult Integrate (Func<double, double> integrand, Inter
117117 /// could be determined to the required precision.</exception>
118118 public static IntegrationResult Integrate ( Func < double , double > integrand , double start , double end , IntegrationSettings settings ) {
119119
120- if ( integrand == null ) throw new ArgumentNullException ( nameof ( integrand ) ) ;
121- if ( settings == null ) throw new ArgumentNullException ( nameof ( settings ) ) ;
120+ if ( integrand is null ) throw new ArgumentNullException ( nameof ( integrand ) ) ;
121+ if ( settings is null ) throw new ArgumentNullException ( nameof ( settings ) ) ;
122122
123123 // Deal with right-to-left integrals
124124 if ( end < start ) {
@@ -130,29 +130,29 @@ public static IntegrationResult Integrate (Func<double,double> integrand, double
130130 if ( Double . IsNegativeInfinity ( start ) && Double . IsPositiveInfinity ( end ) ) {
131131 // -\infty to +\infty
132132 // remap to (-\pi/2,\pi/2)
133- Func < double , double > f1 = delegate ( double t ) {
133+ Func < double , double > f1 = ( double t ) => {
134134 double x = Math . Tan ( t ) ;
135- return ( integrand ( x ) * ( 1.0 + x * x ) ) ;
135+ return integrand ( x ) * ( 1.0 + x * x ) ;
136136 } ;
137- return ( Integrate ( f1 , - Global . HalfPI , + Global . HalfPI , settings ) ) ;
137+ return Integrate ( f1 , - Math . PI / 2.0 , + Math . PI / 2.0 , settings ) ;
138138 } else if ( Double . IsPositiveInfinity ( end ) ) {
139139 // finite to +\infty
140140 // remap to interval (-1,1)
141- Func < double , double > f1 = delegate ( double t ) {
141+ Func < double , double > f1 = ( double t ) => {
142142 double q = 1.0 / ( 1.0 - t ) ;
143143 double x = start + ( 1.0 + t ) * q ;
144- return ( integrand ( x ) * 2.0 * q * q ) ;
144+ return integrand ( x ) * 2.0 * q * q ;
145145 } ;
146- return ( Integrate ( f1 , - 1.0 , + 1.0 , settings ) ) ;
146+ return Integrate ( f1 , - 1.0 , + 1.0 , settings ) ;
147147 } else if ( Double . IsNegativeInfinity ( start ) ) {
148148 // -\infty to finite
149149 // remap to interval (-1,1)
150- Func < double , double > f1 = delegate ( double t ) {
150+ Func < double , double > f1 = ( double t ) => {
151151 double q = t + 1.0 ;
152152 double x = end + ( t - 1.0 ) / q ;
153- return ( integrand ( x ) * ( 2.0 / q / q ) ) ;
153+ return integrand ( x ) * ( 2.0 / q / q ) ;
154154 } ;
155- return ( Integrate ( f1 , - 1.0 , + 1.0 , settings ) ) ;
155+ return Integrate ( f1 , - 1.0 , + 1.0 , settings ) ;
156156 }
157157
158158 // Fix settings.
@@ -162,7 +162,7 @@ public static IntegrationResult Integrate (Func<double,double> integrand, double
162162 Debug . Assert ( end >= start ) ;
163163 IAdaptiveIntegrator integrator = new GaussKronrodIntegrator ( integrand , Interval . FromEndpoints ( start , end ) ) ;
164164 IntegrationResult result = Integrate_Adaptive ( integrator , settings ) ;
165- return ( result ) ;
165+ return result ;
166166 }
167167
168168 // the drivers
0 commit comments