{
  "category": "Compatibility",
  "display_name": "POISSON",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.POISSON",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 5 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 5 recorded answers",
    "workbook_corpus": {
      "cells": 5,
      "matched": 5
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L286-L289"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::nums",
        "ported/discrete_dist::stirling_error",
        "ported/discrete_dist::deviance",
        "ported/discrete_dist::poisson_mass",
        "ported/discrete_dist::finite",
        "ported/discrete_dist::poisson_dist_kernel",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_expm1_internal",
        "ported/excel_numeric::expm1_internal_graph",
        "ported/excel_numeric::excel_x87_add",
        "ported/excel_numeric::excel_x87_sub",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric::excel_x87_temme_finish",
        "ported/excel_numeric::excel_x87_div",
        "ported/excel_numeric/x87::mul",
        "ported/excel_numeric/x87::add",
        "ported/excel_numeric/x87::sub",
        "ported/excel_numeric/x87::div",
        "ported/excel_numeric/x87_chains::pow2_positive",
        "ported/excel_numeric/x87_chains::pow2",
        "ported/excel_numeric/x87_chains::exp_ext",
        "ported/excel_numeric/x87_chains::exp_with",
        "ported/excel_numeric/x87_chains::excel_exp",
        "ported/excel_numeric/x87_chains::log_with",
        "ported/excel_numeric/x87_chains::excel_log",
        "ported/special_math_common::gratio_norm_gamma",
        "ported/special_math_common::gratio_rexp",
        "ported/special_math_common::gratio_rlog",
        "ported/special_math_common::gratio_gam1",
        "ported/special_math_common::gratio",
        "ported/special_math_common::series_prefactor",
        "ported/special_math_common::gratio_after40",
        "ported/special_math_common::gratio_cf",
        "ported/special_math_common::gratio_temme_270",
        "ported/special_math_common::gratio_temme_340",
        "ported/special_math_common::gratio_temme_330",
        "ported/special_math_common::gratio_temme_finish",
        "ported/special_math_common::regularized_gamma_q"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L286-L289",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 5 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.POISSON.json",
  "name": "POISSON",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[BINOM.DIST](FUNC.BINOM.DIST.md) models a fixed number of independent trials. [CHISQ.DIST.RT](FUNC.CHISQ.DIST.RT.md) exposes the related gamma-tail family; [EXP](FUNC.EXP.md) supplies the zero-count stage.\n\n\n",
    "how-to-implement": "\nUse [D, E and R](../model/09-staged-arithmetic.md#retain-an-extended-intermediate-when-the-recipe-requires-it) for binary64 storage, resident 64-bit-significand arithmetic and a 64-bit operation followed by a binary64 store. The following finite-input recipe describes the newer cited implementation.\n\n1. Reject an original negative count before truncation. Set k to its truncated value. If k=0, return the measured public `EXP(-mean)` result before the positive-count mean checks. This route retains its subnormal exponential.\n2. For k>0 reject a negative mean. At mean zero, return zero for a mass or one for a cumulative probability.\n3. For cumulative probability evaluate the generic upper gamma ratio `Q(k+1,mean)`. It is the sum through k, despite being an upper gamma ratio. This avoids starting a recurrence at a mass that has already underflowed.\n4. For a mass with k=1 or `mean<1.1`, form `t=R(k*LN(mean))` and obtain the stored internal/public GAMMALN result G at k+1. Subtract mean and G with the compensated-exponential recipe below.\n5. For other positive-count masses, compute Stirling correction s(k) and deviance d(k,mean). Store `exponent=R(-s-d)`, obtain stored public EXP(exponent), and divide it with R by `D(sqrt(D(D(2*pi)*k)))`, using the stored binary64 pi. The source uses an ordinary binary64 square root at this normalizer.\n6. The current positive-count publisher flushes subnormal results to zero and rejects nonfinite results. Keep this policy distinct from the k=0 return.\n\n### Exponential of two subtractions\n\nStart `a=t`. For each term in the ordered list `[mean,G]`, form the resident difference `e=E(a-term)`, store `a=D(e)`, store `lost=D(E(e-a))`, and keep `factor=R(1+lost)`. After both subtractions, obtain public EXP(a), then multiply successively by the two factors using R at each multiplication. A single call to EXP of an algebraically combined difference loses these stores and corrections. GAMMALN’s inner approximation remains a separate open leaf.\n\n### Stirling correction\n\nFor integer k=0 through six, the current table is:\n\n| k | Stored decimal coefficient |\n|---:|---:|\n| 0 | 0 |\n| 1 | 0.0810614667953272 |\n| 2 | 0.0413406959554092 |\n| 3 | 0.0276779256849983 |\n| 4 | 0.0207906721037650 |\n| 5 | 0.0166446911898211 |\n| 6 | 0.0138761288230707 |\n\nConvert each decimal to nearest binary64. The source describes these as values cut to sixteen decimal places; its observed k=4 value is one representable step above the table entry and remains unexplained.\n\nFor k>=7, first round each of these ten coefficients to binary64, in ascending power order:\n\n```text\n1/12, -1/360, 1/1260, -1/1680, 1/1188,\n-691/360360, 1/156, -3617/122400, 43867/244188, -174611/125400\n```\n\nForm `u=E(1/E(k*k))`. Starting with the last coefficient, run Horner with resident multiplication and addition, `v=E(E(v*u)+coefficient)`. Return `D(E(v/k))`. Intermediate polynomial values are retained in E; storing each one to binary64 is a different model.\n\n### Deviance\n\nThe mathematical quantity is `d(x,m)=x*ln(x/m)+m-x`. Outside the current series condition `abs(D(x-m))<D(0.2*D(x+m))`, form `ratio=R(x/m)`, obtain stored LN(ratio), then return `R(R(x*LN(ratio))+R(m-x))`.\n\nInside that condition, the current finite reconstruction is:\n\n```text\ndelta = R(x-m)\nv = E(delta / R(x+m))\nw = E(v*v)\npower = v; tail = 0; j = 1\nrepeat:\n    power = E(power*w)\n    next = E(tail + E(power/(2*j+1)))\n    if next == tail: stop\n    tail = next; j = j+1\nV = D(v)\nS = D(E(V+tail))\ntwice_x = D(2*x)\nA = E(R(m-x) + R(twice_x*S))\nA = E(A - R(twice_x*V))\nA = E(D(A) + delta)\nreturn D(E(A + R(delta*V)))\n```\n\nThe series condition is the implementation’s floating comparison. Its mathematical ratio interval is `(2/3,3/2)`, wider than the published starting method’s interval. Do not change the threshold or intermediate stores solely from that algebraic equivalence.\n\nWorked mass at k=4, mean three: the deviance reconstruction gives `0.15072828980712366`; the table supplies s(4) about `0.020790672103765`. The stored exponent is about `-0.17151896191088867`, and the normalizer is the binary64 square root of `8*pi`. This recipe gives about `0.16803135574154085`. These are worked reconstruction values, rather than additional Excel captures.\n\nThe mathematical starting point is Loader’s published saddle-point method; the project then isolates arithmetic sites from recorded answers. The source records 1,000 of 1,000 series controls at x=100 and 1,199 of 1,200 at x=1024. The latter remaining disagreement, the small-table exception, GAMMALN and other report failures are still open. The 1.1 split is recorded at x=2,3,7 and does not establish every global route boundary. The separately pinned interactive calculator can predate these later stages. No published Handbook suite establishes whole-function agreement.\n\n\n",
    "quirks": "\nThe count is truncated, but an original negative fraction is rejected before it can become zero. The mean must be nonnegative in Microsoft’s documented domain. Nonnumeric count or mean gives `#VALUE!`.\n\nMean zero is a point mass: zero events has probability one and positive counts have mass zero. For a positive mean, a cumulative result includes the requested count. “More than k” therefore uses `1-CDF(k)`, while “at least k” uses the CDF at k-1.\n\nThe current k=0 branch runs before its negative-mean check and can return EXP of a positive number for that otherwise invalid argument. This is the code’s branch order, separate from Microsoft’s stated negative-mean error. It also retains a subnormal exponential where the positive-count routes flush below normal.\n\n\n",
    "sources": "\n- [Microsoft: POISSON function](https://support.microsoft.com/en-us/excel/functions/poisson-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [R31 discrete distribution implementation](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/crates/calc-func/src/ported/discrete_dist.rs); guards, route split, Stirling table, deviance and mass composition.\n- [Resident series and compensated exponential](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/crates/calc-func/src/ported/excel_numeric/x87_chains.rs); explicit operation and store order.\n- [Loader, Fast and Accurate Computation of Binomial Probabilities](https://www.r-project.org/doc/reports/CLoader-dbinom-2002.pdf), opened 6 November 2026; published saddle-point starting method and Poisson extension. The implementation’s measured stages are a separate claim.\n- [Remaining numerical failures](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/docs/generated/problem-functions.md); source-specific counts, including still unresolved Poisson answers.\n\n",
    "try-it": "\n`=POISSON(0,2,FALSE)` is about `0.1353352832`, the probability of no events when two are expected. The cumulative call at zero has the same value. `=POISSON(4,3,FALSE)` is about `0.1680313557`; the corresponding cumulative call also includes counts zero through three.\n\n\n",
    "version-differences": "\nNo same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.\n\n\n",
    "what-it-does": "\n`POISSON(x,mean,cumulative)` evaluates a Poisson event count with the supplied expected count mean. FALSE returns the mass for exactly x events; TRUE returns the probability of zero through x events, inclusive. POISSON is the compatibility spelling. The mathematical mass at nonnegative integer k is `exp(-mean)*mean^k/k!`.\n\n\n"
  },
  "signature": {
    "display": "POISSON(x, mean, cumulative)",
    "parameters": [
      {
        "description": null,
        "name": "x",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "mean",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "cumulative",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 3,
        "min": 3
      },
      "category": "Compatibility",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Poisson probability (older form of POISSON.DIST)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the Poisson distribution",
        "microsoft_url": "https://support.microsoft.com/en-us/office/poisson-function-d81f7294-9d7c-4f75-bc23-80aa8624173a"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "POISSON"
        },
        {
          "locale": "bg-BG",
          "name": "POISSON"
        },
        {
          "locale": "cs-CZ",
          "name": "POISSON"
        },
        {
          "locale": "da-DK",
          "name": "POISSON"
        },
        {
          "locale": "de-DE",
          "name": "POISSON"
        },
        {
          "locale": "el-GR",
          "name": "POISSON"
        },
        {
          "locale": "en-AU",
          "name": "POISSON"
        },
        {
          "locale": "en-GB",
          "name": "POISSON"
        },
        {
          "locale": "en-US",
          "name": "POISSON"
        },
        {
          "locale": "es-ES",
          "name": "POISSON"
        },
        {
          "locale": "et-EE",
          "name": "POISSON"
        },
        {
          "locale": "fi-FI",
          "name": "POISSON"
        },
        {
          "locale": "fr-FR",
          "name": "LOI.POISSON*"
        },
        {
          "locale": "he-IL",
          "name": "POISSON"
        },
        {
          "locale": "hr-HR",
          "name": "POISSON"
        },
        {
          "locale": "hu-HU",
          "name": "POISSON"
        },
        {
          "locale": "id-ID",
          "name": "POISSON"
        },
        {
          "locale": "it-IT",
          "name": "POISSON"
        },
        {
          "locale": "ja-JP",
          "name": "POISSON"
        },
        {
          "locale": "ko-KR",
          "name": "POISSON"
        },
        {
          "locale": "lt-LT",
          "name": "POISSON"
        },
        {
          "locale": "lv-LV",
          "name": "POISSON"
        },
        {
          "locale": "nb-NO",
          "name": "POISSON"
        },
        {
          "locale": "nl-NL",
          "name": "POISSON"
        },
        {
          "locale": "pl-PL",
          "name": "ROZKŁAD.POISSON"
        },
        {
          "locale": "pt-BR",
          "name": "POISSON"
        },
        {
          "locale": "pt-PT",
          "name": "POISSON"
        },
        {
          "locale": "ro-RO",
          "name": "POISSON"
        },
        {
          "locale": "ru-RU",
          "name": "ПУАССОН"
        },
        {
          "locale": "sk-SK",
          "name": "POISSON"
        },
        {
          "locale": "sl-SI",
          "name": "POISSON"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "POISSON"
        },
        {
          "locale": "sv-SE",
          "name": "POISSON"
        },
        {
          "locale": "th-TH",
          "name": "POISSON"
        },
        {
          "locale": "tr-TR",
          "name": "POISSON işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "POISSON"
        },
        {
          "locale": "vi-VN",
          "name": "POISSON"
        },
        {
          "locale": "zh-CN",
          "name": "POISSON"
        },
        {
          "locale": "zh-HK",
          "name": "POISSON"
        },
        {
          "locale": "zh-TW",
          "name": "POISSON"
        }
      ],
      "signature": {
        "display": "POISSON(x, mean, cumulative)",
        "parameters": [
          {
            "description": null,
            "name": "x",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "mean",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "cumulative",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "POISSON",
      "version_marker": null,
      "xlcall": {
        "code": "300",
        "symbol": "xlfPoisson"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/poisson-function-d81f7294-9d7c-4f75-bc23-80aa8624173a"
  },
  "try_it": {
    "formula": "=POISSON(0,2,FALSE)"
  },
  "url": "https://handbook.dnacalc.com/functions/POISSON.html",
  "variants": [],
  "versions": []
}