Engineering functions

BESSELJ

Close: 1 of 1,240 recorded answers differ in the last bits, worst 1 ULP

Everything else matches (946 in the answer bank and 294 workbook cells). Last-bit means a finite number within 16 ULP of Excel's. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicBESSELJ
BulgarianBESSELJ
CzechBESSELJ
DanishBESSELJ
GermanBESSELJ
GreekBESSELJ
English (Australia)BESSELJ
English (United Kingdom)BESSELJ
English (United States)BESSELJ
SpanishBESSELJ
EstonianBESSELJ
FinnishBESSELJ
FrenchBESSELJ
HebrewBESSELJ
CroatianBESSELJ
HungarianBESSELJ
IndonesianBESSELJ
ItalianBESSELJ
JapaneseBESSELJ
KoreanBESSELJ
LithuanianBESSELJ
LatvianBESSELJ
NorwegianBESSELJ
DutchBESSELJ
PolishBESSEL.J
Portuguese (Brazil)BESSELJ
Portuguese (Portugal)BESSELJ
RomanianBESSELJ
RussianБЕССЕЛЬ.J
SlovakBESSELJ
SlovenianBESSELJ
Serbian (Latin)BESSELJ
SwedishBESSELJ
ThaiBESSELJ
TurkishBESSELJ işlevi
UkrainianBESSELJ
VietnameseBESSELJ
Chinese (Simplified)BESSELJ
Chinese (Hong Kong)BESSELJ
Chinese (Traditional)BESSELJ

Names from Microsoft's support site.

What it does

BESSELJ(x, n)

BESSELJ(x,n) evaluates the order-n Bessel function of the first kind. It is a special function used in radial and oscillatory problems, rather than an elementary trigonometric function. The order is truncated to an integer.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

The recorded =BESSELJ(0,0) returns 1.00000000283141 (0x3ff0000000c292b1). The mathematical value is exactly one; this example exposes the approximation in the seed rather than an input-rounding issue. FN-BESSELJ-001 retains the captured answer and its environment.

=BESSELJ(0,3) returns zero under the current route. For a nonzero example, the order-two value at x=3 comes from the recurrence J2(3)=(2/3)*J1(3)-J0(3), so both order-zero and order-one seeds contribute.

Quirks

Nonnumeric arguments give #VALUE!. A negative order is rejected before truncation, so n=-0.5 gives #NUM!; a nonnegative fractional order truncates toward zero. The current limit after truncation is 10,000,000.

Negative x uses integer-order parity: an odd order changes sign and an even order does not. The order-zero approximation at zero is slightly high in the recorded capture. Do not insert a mathematical J0(0)=1 shortcut into a compatibility implementation.

The current large-argument admission compares the stored phase with 2^27-1. Its order-zero phase constant is 0.785398164, order-one 2.356194491; a forward recurrence needs both seed admissions. These are measured scope limits, separately from the remaining numerical-body discrepancies.

BESSELJ at zero and order zero is slightly above one

In the retained catalogue capture, BESSELJ(0,0) returns 1.00000000283141 (0x3ff0000000c292b1), while the mathematical Bessel function J0(0) is exactly 1. The raw answer, saved workbook cache and answer after reopening retain that same value. This is one captured input on the named Excel environment, not a general accuracy statement.

Explanation (inferred): The current published small-J0 implementation evaluates its constant coefficients as 57568490574/57568490411 at x=0, which produces the recorded bits. That source-level explanation does not prove that Microsoft uses the same private program.

FormulaExcelMathematical value
=BESSELJ(0,0)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, workbook Compatibility Version 1
Inputs and reference value

Typed formula.

Exact identity J0(0)=1: in the defining series in NIST DLMF 10.2.2 (https://dlmf.nist.gov/10.2#E2), only the constant term remains at order zero and x=0.

1.00000000283141
0x3ff0000000c292b1
1
0x3ff0000000000000

Inputs, build details and evidence

How to implement

Validate the numeric input and order before selecting a route. The current implementation uses licensed fixed rational seeds for J0 and J1, a forward recurrence when abs(x)>n, and a published adaptive backward program otherwise. For negative x, evaluate at its magnitude and apply the order's parity.

For forward order n, set tox=2/abs(x), previous=J0(abs(x)), current=J1(abs(x)). For j from one through n-1, compute next=(j*tox)*current-previous, then advance the two states. The current J/Y outer recurrence uses ordinary binary64 operations with subnormal operands/results flushed to zero. K's stored-PC64 recurrence is a separate choice; do not transfer it automatically.

Worked seed at zero: the small-J0 numerator's constant is 57568490574 and its denominator's is 57568490411. Their binary64 quotient is 1.00000000283141, the recorded result. For mathematical J0 the defining series instead has constant one and every higher term vanishes at zero.

The fixed seed/backward helpers credit SheetJS/bessel under Apache-2.0, with project changes and measured phase controls. The generic J/Y body remains a published-method candidate with residual differences. Its coefficient choices, phase grouping and boundaries do not amount to an identification of Microsoft's private code or a whole-domain equality claim.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

BESSELJ · 1 lines · calc-func/src/catalogue/engineering.rs on GitHub
61 besselj "BESSELJ" (2, 2) [V "x", V "n"] |s, a, sv| { bessel(s, a, k::bessel::besselj_kernel, true) }
j0 · 9 lines · calc-func/src/ported/bessel.rs on GitHub
fn j0(x: D) -> R {
    admit_phase(x, 0.785398164)?;
    if x.0.abs() < 8.0 {
        let value = super::bessel_rational::j0(x.0);
        return if value.is_finite() { Ok(D::new(value)) } else { Err(WorksheetErrorCode::Num) };
    }
    let value = super::bessel_rational::j0_large(x.0);
    if value.is_finite() { Ok(D::new(value)) } else { Err(WorksheetErrorCode::Num) }
}
j1 · 9 lines · calc-func/src/ported/bessel.rs on GitHub
fn j1(x: D) -> R {
    admit_phase(x, 2.356194491)?;
    if x.0.abs() < 8.0 {
        let value = super::bessel_rational::j1(x.0);
        return if value.is_finite() { Ok(D::new(value)) } else { Err(WorksheetErrorCode::Num) };
    }
    let value = super::bessel_rational::j1_large(x.0);
    if value.is_finite() { Ok(D::new(value)) } else { Err(WorksheetErrorCode::Num) }
}
besselj_kernel · 16 lines · calc-func/src/ported/bessel.rs on GitHub
/// `BESSELJ(x, n)`.
pub fn besselj_kernel(x: f64, n: f64) -> Result<f64, WorksheetErrorCode> {
    if !x.is_finite() { return Err(WorksheetErrorCode::Num); }
    let n = order(n)?;
    let x = D::new(x);
    finish(match n {
        0 => j0(x),
        1 => j1(x),
        _ if x.0 == 0.0 => Ok(D(0.0)),
        _ => {
            let ax = x.abs();
            let v = if ax.0 > n as f64 { forward(ax, n, j0(ax)?, j1(ax)?, false) } else { D::new(super::bessel_rational::jn(n as i32, ax.0)) };
            Ok(odd_sign(x, n, v))
        }
    })
}
jn · 39 lines · calc-func/src/ported/bessel_rational.rs on GitHub
pub(super) fn jn(order: i32, x: f64) -> f64 {
    if x == 0.0 {
        return 0.0;
    }
    let magnitude = x.abs();
    let n = f64::from(order);
    let start = 2.0 * ((n + (40.0 * n).sqrt().floor()) / 2.0).floor();
    let twice_over_x = 2.0 / magnitude;
    let mut result = 0.0;
    let mut current = 1.0;
    let mut next = 0.0;
    let mut total = 0.0;
    let mut add_to_total = false;
    for index in (1..=start as i32).rev() {
        let previous = f64::from(index) * twice_over_x * current - next;
        next = current;
        current = previous;
        if current.abs() > 1E10 {
            current *= 1E-10;
            next *= 1E-10;
            result *= 1E-10;
            total *= 1E-10;
        }
        if add_to_total {
            total += current;
        }
        add_to_total = !add_to_total;
        if index == order {
            result = next;
        }
    }
    total = 2.0 * total - current;
    result /= total;
    if x < 0.0 && order % 2 != 0 {
        -result
    } else {
        result
    }
}
j_large · 11 lines · calc-func/src/ported/bessel_rational.rs on GitHub
fn j_large(x: f64, offset: f64, amplitude: &[f64], correction: &[f64]) -> f64 {
    let square = x * x;
    let phase = x - offset;
    let reduction = 64.0 / square;
    let amplitude = polynomial(reduction, amplitude);
    let correction = polynomial(reduction, correction);
    let leading = excel_cos(phase) * amplitude;
    let trailing = ((8.0 / x) * excel_sin(phase)) * correction;
    let scale = (W / x).sqrt();
    scale * (leading - trailing)
}
j0_large · 3 lines · calc-func/src/ported/bessel_rational.rs on GitHub
pub(super) fn j0_large(x: f64) -> f64 {
    j_large(x.abs(), 0.785398164, AMP_J0, PHASE_J0)
}
j1_large · 4 lines · calc-func/src/ported/bessel_rational.rs on GitHub
pub(super) fn j1_large(x: f64) -> f64 {
    let value = j_large(x.abs(), 2.356194491, AMP_J1, PHASE1);
    if x < 0.0 { -value } else { value }
}

Kernels shared with other functions

Argument and result plumbing

  • fail catalogue/kit
  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20228Windows, 64-bit, CPU not recorded794

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

A later catalogue capture on Excel 16.0.20527.20088, Windows 64-bit, AMD Ryzen 7 4800H, en-ZA, workbook Compatibility Version 1 records BESSELJ(0,0)=1.00000000283141 (0x3ff0000000c292b1). The raw, saved and reopened views are from one capture. This is not a matched-input comparison with the earlier build.

Excel 16.0 build 20228

Windows, 64-bit, CPU not recorded

794 captured inputs are indexed for this environment. Capture dates: 2026-08-09 to 2026-08-09. This is a reading count, not a comparison with another build.

Excel 16.0.20527.20088

Windows 64-bit, AMD Ryzen 7 4800H, en-ZA, workbook Compatibility Version 1

A later catalogue capture on Excel 16.0.20527.20088, Windows 64-bit, AMD Ryzen 7 4800H, en-ZA, workbook Compatibility Version 1 records BESSELJ(0,0)=1.00000000283141 (0x3ff0000000c292b1). The raw, saved and reopened views are from one capture. This is not a matched-input comparison with the earlier build.

Alternatives

BESSELI and BESSELK are modified Bessel functions. BESSELY supplies the other ordinary kind.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents