/** * Returns the exponentially scaled modified Bessel function * of order 0 of the argument. * <p> * The function is defined as <tt>i0e(x) = exp(-|x|) j0( ix )</tt>. * * * @param x the value to compute the bessel function of. */ static public double i0e(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the exponentially scaled modified Bessel function * of order 0 of the argument. * <p> * The function is defined as <tt>i0e(x) = exp(-|x|) j0( ix )</tt>. * * * @param x the value to compute the bessel function of. */ static public double i0e(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the modified Bessel function of order 0 of the * argument. * <p> * The function is defined as <tt>i0(x) = j0( ix )</tt>. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double i0(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Math.exp(x) * Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Math.exp(x) * Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the exponentially scaled modified Bessel function * of order 1 of the argument. * <p> * The function is defined as <tt>i1(x) = -i exp(-|x|) j1( ix )</tt>. * * @param x the value to compute the bessel function of. */ static public double i1e(double x) throws ArithmeticException { double y, z; z = Math.abs(x); if( z <= 8.0 ) { y = (z/2.0) - 2.0; z = Arithmetic.chbevl( y, A_i1, 29 ) * z; } else { z = Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z); } if( x < 0.0 ) z = -z; return( z ); } /**
/** * Returns the exponentially scaled modified Bessel function * of order 1 of the argument. * <p> * The function is defined as <tt>i1(x) = -i exp(-|x|) j1( ix )</tt>. * * @param x the value to compute the bessel function of. */ static public double i1e(double x) throws ArithmeticException { double y, z; z = Math.abs(x); if( z <= 8.0 ) { y = (z/2.0) - 2.0; z = Arithmetic.chbevl( y, A_i1, 29 ) * z; } else { z = Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z); } if( x < 0.0 ) z = -z; return( z ); } /**
/** * Returns the modified Bessel function of order 0 of the * argument. * <p> * The function is defined as <tt>i0(x) = j0( ix )</tt>. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double i0(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Math.exp(x) * Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Math.exp(x) * Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the exponentially scaled modified Bessel function * of the third kind of order 0 of the argument. * * @param x the value to compute the bessel function of. */ static public double k0e(double x) throws ArithmeticException { double y; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x); return( y * Math.exp(x) ); } y = Arithmetic.chbevl( 8.0/x - 2.0, B_k0, 25 ) / Math.sqrt(x); return(y); } /**
/** * Returns the exponentially scaled modified Bessel function * of the third kind of order 0 of the argument. * * @param x the value to compute the bessel function of. */ static public double k0e(double x) throws ArithmeticException { double y; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x); return( y * Math.exp(x) ); } y = Arithmetic.chbevl( 8.0/x - 2.0, B_k0, 25 ) / Math.sqrt(x); return(y); } /**
/** * Returns the modified Bessel function of order 1 of the * argument. * <p> * The function is defined as <tt>i1(x) = -i j1( ix )</tt>. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double i1(double x) throws ArithmeticException { double y, z; z = Math.abs(x); if( z <= 8.0 ) { y = (z/2.0) - 2.0; z = Arithmetic.chbevl( y, A_i1, 29 ) * z * Math.exp(z); } else { z = Math.exp(z) * Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z); } if( x < 0.0 ) z = -z; return( z ); } /**
/** * Returns the exponentially scaled modified Bessel function * of the third kind of order 1 of the argument. * <p> * <tt>k1e(x) = exp(x) * k1(x)</tt>. * * @param x the value to compute the bessel function of. */ static public double k1e(double x) throws ArithmeticException { double y; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Math.log( 0.5 * x ) * i1(x) + Arithmetic.chbevl( y, A_k1, 11 ) / x; return( y * Math.exp(x) ); } return( Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the modified Bessel function of order 1 of the * argument. * <p> * The function is defined as <tt>i1(x) = -i j1( ix )</tt>. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double i1(double x) throws ArithmeticException { double y, z; z = Math.abs(x); if( z <= 8.0 ) { y = (z/2.0) - 2.0; z = Arithmetic.chbevl( y, A_i1, 29 ) * z * Math.exp(z); } else { z = Math.exp(z) * Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z); } if( x < 0.0 ) z = -z; return( z ); } /**
/** * Returns the exponentially scaled modified Bessel function * of the third kind of order 1 of the argument. * <p> * <tt>k1e(x) = exp(x) * k1(x)</tt>. * * @param x the value to compute the bessel function of. */ static public double k1e(double x) throws ArithmeticException { double y; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Math.log( 0.5 * x ) * i1(x) + Arithmetic.chbevl( y, A_k1, 11 ) / x; return( y * Math.exp(x) ); } return( Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the modified Bessel function of the third kind * of order 0 of the argument. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double k0(double x) throws ArithmeticException { double y, z; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x); return( y ); } z = 8.0/x - 2.0; y = Math.exp(-x) * Arithmetic.chbevl( z, B_k0, 25 ) / Math.sqrt(x); return(y); } /**
/** * Returns the modified Bessel function of the third kind * of order 1 of the argument. * <p> * The range is partitioned into the two intervals [0,2] and * (2, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double k1(double x) throws ArithmeticException { double y, z; z = 0.5 * x; if( z <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Math.log(z) * i1(x) + Arithmetic.chbevl( y, A_k1, 11 ) / x; return( y ); } return( Math.exp(-x) * Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the modified Bessel function of the third kind * of order 1 of the argument. * <p> * The range is partitioned into the two intervals [0,2] and * (2, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double k1(double x) throws ArithmeticException { double y, z; z = 0.5 * x; if( z <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Math.log(z) * i1(x) + Arithmetic.chbevl( y, A_k1, 11 ) / x; return( y ); } return( Math.exp(-x) * Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the modified Bessel function of the third kind * of order 0 of the argument. * <p> * The range is partitioned into the two intervals [0,8] and * (8, infinity). Chebyshev polynomial expansions are employed * in each interval. * * @param x the value to compute the bessel function of. */ static public double k0(double x) throws ArithmeticException { double y, z; if( x <= 0.0 ) throw new ArithmeticException(); if( x <= 2.0 ) { y = x * x - 2.0; y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x); return( y ); } z = 8.0/x - 2.0; y = Math.exp(-x) * Arithmetic.chbevl( z, B_k0, 25 ) / Math.sqrt(x); return(y); } /**