bessel/bits/30_iter.js
SheetJS 73ee33e402 version bump 0.3.0: cleanup
- eliminated array reduce (performance improvement)
- explicit treatment of divergent values
- better handling of non-integral order (fixes #3, h/t @vron)
- reorganized source, removed voc dependency (fixes #2, h/t @hmalphettes)
- new browser demo
- more detailed test suite and coverage tests
- updated travis versions for test
- miscellaneous adjustments to tooling
2016-09-24 02:15:52 -04:00

11 lines
295 B
JavaScript

function _bessel_iter(x/*:number*/, n/*:number*/, f0/*:number*/, f1/*:number*/, sign/*:number*/)/*:number*/ {
if(n === 0) return f0;
if(n === 1) return f1;
var tdx = 2 / x, f2 = f1;
for(var o = 1; o < n; ++o) {
f2 = f1 * o * tdx + sign * f0;
f0 = f1; f1 = f2;
}
return f2;
}