|
1 | 1 |
|
2 | 2 | package org.drip.specialfunction.property;
|
3 | 3 |
|
| 4 | +import org.drip.function.definition.R1ToR1; |
4 | 5 | import org.drip.function.definition.R1ToR1Property;
|
5 | 6 | import org.drip.function.definition.R2ToR1;
|
6 | 7 | import org.drip.function.definition.R2ToR1Property;
|
7 | 8 | import org.drip.function.definition.RxToR1Property;
|
8 | 9 | import org.drip.numerical.common.NumberUtil;
|
9 | 10 | import org.drip.specialfunction.bessel.FirstFrobeniusSeriesEstimator;
|
| 11 | +import org.drip.specialfunction.bessel.SecondNISTSeriesEstimator; |
| 12 | +import org.drip.specialfunction.definition.BesselFirstKindEstimator; |
| 13 | +import org.drip.specialfunction.definition.BesselSecondKindEstimator; |
| 14 | +import org.drip.specialfunction.digamma.BinetFirstIntegral; |
10 | 15 | import org.drip.specialfunction.gamma.EulerIntegralSecondKind;
|
11 | 16 |
|
12 | 17 | /*
|
@@ -200,75 +205,59 @@ public static final R2ToR1Property MirrorIdentity()
|
200 | 205 | * @return The Bessel First Kind Half-Integer Identity Verifier
|
201 | 206 | */
|
202 | 207 |
|
203 |
| - public static final org.drip.function.definition.R2ToR1Property HalfIntegerIdentity() |
| 208 | + public static final R2ToR1Property HalfIntegerIdentity() |
204 | 209 | {
|
205 |
| - org.drip.function.definition.R1ToR1 gammaEstimator = new |
206 |
| - org.drip.specialfunction.gamma.EulerIntegralSecondKind (null); |
| 210 | + R1ToR1 gammaEstimator = new EulerIntegralSecondKind (null); |
207 | 211 |
|
208 |
| - final org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstKindEstimator = |
209 |
| - org.drip.specialfunction.bessel.FirstFrobeniusSeriesEstimator.Standard ( |
| 212 | + final BesselFirstKindEstimator besselFirstKindEstimator = FirstFrobeniusSeriesEstimator.Standard ( |
| 213 | + gammaEstimator, |
| 214 | + 50 |
| 215 | + ); |
| 216 | + |
| 217 | + try { |
| 218 | + final BesselSecondKindEstimator besselSecondKindEstimator = SecondNISTSeriesEstimator.Standard ( |
| 219 | + new BinetFirstIntegral (null), |
210 | 220 | gammaEstimator,
|
211 |
| - 50 |
| 221 | + FirstFrobeniusSeriesEstimator.Standard (gammaEstimator, 40), |
| 222 | + 40 |
212 | 223 | );
|
213 | 224 |
|
214 |
| - try |
215 |
| - { |
216 |
| - final org.drip.specialfunction.definition.BesselSecondKindEstimator besselSecondKindEstimator = |
217 |
| - org.drip.specialfunction.bessel.SecondNISTSeriesEstimator.Standard ( |
218 |
| - new org.drip.specialfunction.digamma.BinetFirstIntegral (null), |
219 |
| - gammaEstimator, |
220 |
| - org.drip.specialfunction.bessel.FirstFrobeniusSeriesEstimator.Standard ( |
221 |
| - gammaEstimator, |
222 |
| - 40 |
223 |
| - ), |
224 |
| - 40 |
225 |
| - ); |
226 |
| - |
227 |
| - return new org.drip.function.definition.R2ToR1Property ( |
228 |
| - org.drip.function.definition.RxToR1Property.EQ, |
229 |
| - new org.drip.function.definition.R2ToR1() |
230 |
| - { |
| 225 | + return new R2ToR1Property ( |
| 226 | + RxToR1Property.EQ, |
| 227 | + new R2ToR1() { |
231 | 228 | @Override public double evaluate (
|
232 | 229 | final double alpha,
|
233 | 230 | final double z)
|
234 |
| - throws java.lang.Exception |
| 231 | + throws Exception |
235 | 232 | {
|
236 |
| - if (!org.drip.numerical.common.NumberUtil.IsInteger (alpha)) |
237 |
| - { |
238 |
| - throw new java.lang.Exception |
239 |
| - ("BesselFirstEqualityLemma::HalfIntegerIdentity => Invalid Inputs"); |
| 233 | + if (!NumberUtil.IsInteger (alpha)) { |
| 234 | + throw new Exception ( |
| 235 | + "BesselFirstEqualityLemma::HalfIntegerIdentity => Invalid Inputs" |
| 236 | + ); |
240 | 237 | }
|
241 | 238 |
|
242 |
| - return besselFirstKindEstimator.bigJ ( |
243 |
| - -1. * (alpha + 0.5), |
244 |
| - z |
245 |
| - ); |
| 239 | + return besselFirstKindEstimator.bigJ (-1. * (alpha + 0.5), z); |
246 | 240 | }
|
247 | 241 | },
|
248 |
| - new org.drip.function.definition.R2ToR1() |
249 |
| - { |
| 242 | + new R2ToR1() { |
250 | 243 | @Override public double evaluate (
|
251 | 244 | final double alpha,
|
252 | 245 | final double z)
|
253 |
| - throws java.lang.Exception |
| 246 | + throws Exception |
254 | 247 | {
|
255 |
| - if (!org.drip.numerical.common.NumberUtil.IsInteger (alpha)) |
256 |
| - { |
257 |
| - throw new java.lang.Exception |
258 |
| - ("BesselFirstEqualityLemma::HalfIntegerIdentity => Invalid Inputs"); |
| 248 | + if (!NumberUtil.IsInteger (alpha)) { |
| 249 | + throw new Exception ( |
| 250 | + "BesselFirstEqualityLemma::HalfIntegerIdentity => Invalid Inputs" |
| 251 | + ); |
259 | 252 | }
|
260 | 253 |
|
261 |
| - return (0 == ((int) (alpha + 1)) % 2 ? 1. : -1.) * besselSecondKindEstimator.bigY ( |
262 |
| - alpha + 0.5, |
263 |
| - z |
264 |
| - ); |
| 254 | + return (0 == ((int) (alpha + 1)) % 2 ? 1. : -1.) * |
| 255 | + besselSecondKindEstimator.bigY (alpha + 0.5, z); |
265 | 256 | }
|
266 | 257 | },
|
267 |
| - org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE |
| 258 | + R1ToR1Property.MISMATCH_TOLERANCE |
268 | 259 | );
|
269 |
| - } |
270 |
| - catch (java.lang.Exception e) |
271 |
| - { |
| 260 | + } catch (Exception e) { |
272 | 261 | e.printStackTrace();
|
273 | 262 | }
|
274 | 263 |
|
|
0 commit comments