SciDart

Special functions

Error functions and the modified Bessel function of order zero.

Like scipy.special

Special functionsError function, complementary error function and the modified Bessel function I0.
import 'package:scidart/scidart.dart';

void main() {
  print('erf(0.5) = ${erf(0.5)}');
  print('erfc(3) = ${erfc(3)}');
  // erfc keeps precision deep in the tail
  print('erfc(26.6) = ${erfc(26.6)}');
  print('I0(1) = ${besselI0(1)}');
}
Output
erf(0.5) = 0.5204998778130465
erfc(3) = 0.000022090496998585438
erfc(26.6) = 1.088512588544237e-309
I0(1) = 1.2660658480342601
  • erf and erfc use W. J. Cody's rational approximations and agree with scipy.special to about 1e-14 relative error. erfc keeps relative precision far into the tail, down to subnormal results.
  • besselI0 is the modified Bessel function of the first kind and order zero, used by the Kaiser window.
  • Array versions: arrayErf, arrayErfc, arrayBesselI0.

Edit this guide on GitHub