{
  "category": "Math and trigonometry functions",
  "display_name": "SIN",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.SIN",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "20228",
        "20430",
        "20527",
        "?"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 2129,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 2129,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 2,129 in the answer bank and 27 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 2,156 recorded answers",
    "workbook_corpus": {
      "cells": 27,
      "matched": 27
    }
  },
  "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/math.rs#L72-L74",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/sin.rs#L3-L7"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/math::raw",
        "ported/excel_numeric::sin_with",
        "ported/excel_numeric::excel_sin",
        "ported/excel_numeric/soft87::pack_raw",
        "ported/excel_numeric/soft87::zero",
        "ported/excel_numeric/soft87::inf",
        "ported/excel_numeric/soft87::pack",
        "ported/excel_numeric/soft87::ext_pi",
        "ported/excel_numeric/soft87::ext_chs"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L72-L74",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 2,156 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.SIN.json",
  "name": "SIN",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n- **`COS` and `TAN`** — the other two primaries. `TAN = SIN/COS`; `COS(x) = SIN(x + pi/2)`.\n- **`ASIN`** — the inverse on the principal branch `[-pi/2, pi/2]`. `ASIN(SIN(x))` recovers `x`\n  only inside that interval; outside it the composition folds.\n- **`SINH`** — the hyperbolic sibling, related by `sin(ix) = i sinh(x)`. Bounded versus\n  unbounded is the practical difference, and it is why the two have completely different\n  overflow stories.\n- **`RADIANS` / `DEGREES` / `PI`** — the conversion apparatus Microsoft's remark points at.\n- **Confused with**: nothing in Excel, but frequently confused with *itself in degrees*. There\n  is no degree-mode sine.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nEverything hard about `SIN` is argument reduction. The kernel — a minimax polynomial in `x`\nover roughly `[-pi/4, pi/4]` — is a solved problem and has been since Cody & Waite. The\ndifficulty is getting `x` into that interval.\n\n**Why reduction is hard.** To evaluate `sin x` you need `r = x - n*(pi/2)` accurately, where\n`n = round(2x/pi)`. The cancellation in that subtraction is total: when `x` is large, `x` and\n`n*(pi/2)` agree in most of their leading bits, and every bit of accuracy in `r` has to come\nfrom bits of `pi` that were not in the working precision to begin with. The number of bits of\n`pi` required grows with the exponent of `x`; near the top of the binary64 range it runs into\nthe low thousands. This is the content of Payne & Hanek's method: keep `2/pi` to enough bits,\nmultiply, and discard the integer part exactly.\n\n**The three regimes.**\n\n1. Small `x` (below about `pi/4`): no reduction, evaluate the kernel directly.\n2. Moderate `x`: Cody-Waite reduction, subtracting a two- or three-part split of `pi/2` whose\n   high parts have trailing zero bits so that the products are exact.\n3. Huge `x`: Payne-Hanek, or an equivalent exact reduction against a stored many-bit `2/pi`.\n   `fdlibm`'s `__rem_pio2` and `__kernel_rem_pio2` are the canonical readable implementation;\n   Boost.Math and the Sun-derived libms in wide use follow it.\n\n**The philosophical trap.** For huge `x`, the \"right\" answer is a matter of definition. The\ndouble `x` is an exact rational; `sin` of *that* rational is a well-defined real number, and an\nexact reduction computes it. But the user's `x` was almost certainly a rounded stand-in for\nsomething else, and the sine of the intended value is unrelated. Both positions are defensible:\nsome libraries reduce exactly and return the mathematically correct value for the argument they\nwere handed; others refuse. A library that refuses is making a usability argument, not a\nnumerical one, and a page like this one should say which position an implementation has taken\nrather than treat one as correct.\n\n**What the attached evidence record says about substrate.** `EV-MATH-0004` is a\nsubstrate-identification record covering the trig six. It names, for the family, the x87\n`FSIN`/`FPTAN` chain with `FPREM1` argument reduction against the x87 ROM value of `pi`, and it\ncarries a host-CPU microcode caveat on those instructions. The consequence a reader should take\nfrom it is structural, not numeric: an x87-`FPREM1`-based reduction uses a fixed, finite\napproximation to `pi`, so the reduction is not exact, and the error it introduces grows with\nthe magnitude of the argument. That is a different failure mode from a Payne-Hanek library, and\nit is the mechanism by which two implementations that agree perfectly on small angles can\ndisagree wildly on large ones. The record explicitly rules out Cody-Waite reduction against an\nextended `pi` as the substrate. **Read the record itself for what was counted and how; this page\ndeliberately states none of its figures.**\n\n**The residual sensitivity.** Near a zero of sine — that is, near a multiple of `pi` — the\nrelative error of any implementation is dominated by the reduction, because `sin` is locally\nlinear through zero and the absolute error in `r` becomes the whole answer. Test vectors that\nonly sample away from multiples of `pi` will not see the difference between a good reduction\nand a bad one.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number`.\n\nTwo edges deserve naming:\n\n- **Small arguments.** For arguments below the point where `x^3/6` underflows relative to `x`,\n  the correctly rounded sine of `x` is `x` itself. Subnormal inputs therefore round-trip.\n\n\nEmpty, missing and error arguments follow the shared call model; see\n[The value universe](../model/01-value-universe.md).\n\n\n",
    "sources": "\n- Microsoft, \"SIN function\" —\n  <https://support.microsoft.com/en-us/office/sin-function-cf0e3432-8b9e-483c-bc55-a76651c95602>\n  (signature, the radian convention, and the degrees-conversion remark; no error conditions are\n  listed there).\n- Abramowitz & Stegun, *Handbook of Mathematical Functions*, chapter 4 section 4.3 — the\n  circular functions: series, identities, periodicity, zeros.\n- Cody & Waite, *Software Manual for the Elementary Functions* — the classical split-constant\n  argument reduction.\n- Payne & Hanek, \"Radian reduction for trigonometric functions\", 1983 — exact reduction for\n  huge arguments.\n- `fdlibm` `__rem_pio2`, `__kernel_rem_pio2`, `__kernel_sin`; Boost.Math's trigonometric\n  documentation — the canonical readable implementations of the three-regime scheme.\n- Muller, *Elementary Functions: Algorithms and Implementation* — range reduction and worst\n  cases.\n- Handbook evidence record `EV-MATH-0004` (subjects include `FUNC.SIN`) — substrate\n  identification for the trig six, with its own reader warning.\n- Handbook projections `data/functions/FUNC.SIN.json` (arity, classification,\n  `real_result_policy` with `arg_domain_guard=circular_trig_overflow` and `non_finite=num`) and\n  `data/presence/FUNC.SIN.json` (implementing module).\n- Handbook [The value universe](../model/01-value-universe.md) and\n  [Coercion and lifting](../model/02-coercion-and-lifting.md).\n\n",
    "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.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 19929 | Windows, bitness not recorded, CPU not recorded | 35 |\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 890 |\n| 20228 | Windows, 64-bit, CPU not recorded | 9 |\n| 20430 | Windows, 64-bit, CPU not recorded | 1,224 |\n\n- XC-SIN-001: build 19929 versus build 20430; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n- XC-SIN-002: build 20131 versus build 20228; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n- XC-SIN-003: build 20131 versus build 20430; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n\nAgreement on these compared inputs does not establish agreement on unmeasured inputs.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.SIN.json).",
    "what-it-does": "\n`SIN(number)` is the circular sine of an angle measured in **radians**.\n\nThe defining power series, entire over the whole complex plane and convergent for every real\nargument, is\n\n    sin x  =  x - x^3/3! + x^5/5! - x^7/7! + ...  =  SUM over k>=0 of (-1)^k x^(2k+1) / (2k+1)!\n\nequivalently, in exponential form,\n\n    sin x  =  (e^(ix) - e^(-ix)) / (2i)\n\n- **Domain**: all real numbers. There is no argument at which the mathematical function is\n  undefined, and there are no poles and no branch cuts — sine is entire.\n- **Range**: the closed interval `[-1, 1]`.\n- **Parity and period**: odd (`sin(-x) = -sin x`), periodic with period `2*pi`, and\n  antiperiodic with period `pi` (`sin(x + pi) = -sin x`).\n- **Zeros**: exactly the integer multiples of `pi`. Note the consequence for a spreadsheet:\n  the only *representable* double at which `SIN` is mathematically zero is `0` itself, because\n  no other multiple of `pi` is a binary64 number.\n- **Limiting behaviour**: `sin x / x -> 1` as `x -> 0`; the leading error of the approximation\n  `sin x ~ x` is `-x^3/6`. There is no limit as `x -> +/-infinity`; sine oscillates forever.\n\nThe identities a reader is most likely to want, in Abramowitz & Stegun's numbering region 4.3:\n`sin^2 x + cos^2 x = 1`, `sin(x +/- y) = sin x cos y +/- cos x sin y`, `sin 2x = 2 sin x cos x`,\nand the half-angle and product-to-sum forms that follow from them.\n\nMicrosoft's page states the calling convention in one remark: the argument is in radians, and\ndegrees must be converted, either by multiplying by `PI()/180` or by passing the argument\nthrough `RADIANS`. That remark is the whole of the documented semantics.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Default |\n|---|---|---|\n| `number` | The angle, in radians. Required. | — |\n\nThe commonly misunderstood position is the only position: readers who type `SIN(30)` expecting\none half are asking for the sine of thirty radians, and get a legitimate answer to a different\nquestion. Nothing in the function can detect the mistake.\n\n\n"
  },
  "signature": {
    "display": "SIN(number)",
    "parameters": [
      {
        "description": null,
        "name": "number",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "UnaryNumericScalarOrArrayElementwise",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "NumToNum",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Sine of an angle in radians",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the sine of the given angle",
        "microsoft_url": "https://support.microsoft.com/en-us/office/sin-function-cf0e3432-8b9e-483c-bc55-a76651c95602"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "SIN"
        },
        {
          "locale": "bg-BG",
          "name": "SIN"
        },
        {
          "locale": "cs-CZ",
          "name": "SIN"
        },
        {
          "locale": "da-DK",
          "name": "SIN"
        },
        {
          "locale": "de-DE",
          "name": "SIN"
        },
        {
          "locale": "el-GR",
          "name": "SIN"
        },
        {
          "locale": "en-AU",
          "name": "SIN"
        },
        {
          "locale": "en-GB",
          "name": "SIN"
        },
        {
          "locale": "en-US",
          "name": "SIN"
        },
        {
          "locale": "es-ES",
          "name": "SEN"
        },
        {
          "locale": "et-EE",
          "name": "SIN"
        },
        {
          "locale": "fi-FI",
          "name": "SIN"
        },
        {
          "locale": "fr-FR",
          "name": "SIN"
        },
        {
          "locale": "he-IL",
          "name": "SIN"
        },
        {
          "locale": "hr-HR",
          "name": "SIN"
        },
        {
          "locale": "hu-HU",
          "name": "SIN"
        },
        {
          "locale": "id-ID",
          "name": "SIN"
        },
        {
          "locale": "it-IT",
          "name": "SEN"
        },
        {
          "locale": "ja-JP",
          "name": "SIN"
        },
        {
          "locale": "ko-KR",
          "name": "SIN"
        },
        {
          "locale": "lt-LT",
          "name": "SIN"
        },
        {
          "locale": "lv-LV",
          "name": "SIN"
        },
        {
          "locale": "nb-NO",
          "name": "SIN"
        },
        {
          "locale": "nl-NL",
          "name": "SIN"
        },
        {
          "locale": "pl-PL",
          "name": "SIN"
        },
        {
          "locale": "pt-BR",
          "name": "SEN"
        },
        {
          "locale": "pt-PT",
          "name": "SEN"
        },
        {
          "locale": "ro-RO",
          "name": "SIN"
        },
        {
          "locale": "ru-RU",
          "name": "SIN"
        },
        {
          "locale": "sk-SK",
          "name": "SIN"
        },
        {
          "locale": "sl-SI",
          "name": "SIN"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "SIN"
        },
        {
          "locale": "sv-SE",
          "name": "SIN"
        },
        {
          "locale": "th-TH",
          "name": "SIN"
        },
        {
          "locale": "tr-TR",
          "name": "SİN"
        },
        {
          "locale": "uk-UA",
          "name": "SIN"
        },
        {
          "locale": "vi-VN",
          "name": "SIN"
        },
        {
          "locale": "zh-CN",
          "name": "SIN"
        },
        {
          "locale": "zh-HK",
          "name": "SIN"
        },
        {
          "locale": "zh-TW",
          "name": "SIN"
        }
      ],
      "signature": {
        "display": "SIN(number)",
        "parameters": [
          {
            "description": null,
            "name": "number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "SIN",
      "version_marker": null,
      "xlcall": {
        "code": "15",
        "symbol": "xlfSin"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/sin-function-cf0e3432-8b9e-483c-bc55-a76651c95602"
  },
  "try_it": {
    "formula": "=SIN(30)"
  },
  "url": "https://handbook.dnacalc.com/functions/SIN.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "35 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 19929",
      "platform": "Windows, bitness not recorded, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.SIN.json"
      ]
    },
    {
      "behaviour": "890 captured inputs are indexed for this environment. Capture dates: 2026-07-11 to 2026-07-11. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20131",
      "platform": "Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.SIN.json"
      ]
    },
    {
      "behaviour": "9 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_build": "16.0 build 20228",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.SIN.json"
      ]
    },
    {
      "behaviour": "1,224 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.SIN.json"
      ]
    }
  ]
}