{
  "cases": [
    {
      "id": "psi-rounding-counterexample",
      "inputs": {
        "mode": "psi-bar",
        "value": "14.503773773020923"
      },
      "expected": {
        "binary64_hex": "3ff0000000000000"
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "Multiply the exact decimal by 8896443230521/129032000000000 before rounding."
    },
    {
      "id": "bar-to-psi",
      "inputs": {
        "mode": "bar-psi",
        "value": "1"
      },
      "expected": {
        "binary64_hex": "402d01eea2cf6a2e"
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "Divide one bar by the exact bar-per-psi factor."
    },
    {
      "id": "subnormal-positive",
      "inputs": {
        "mode": "bar-psi",
        "value": "5e-324"
      },
      "expected": {
        "binary64_hex": "000000000000000f"
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "Compute the reciprocal-factor product exactly before rounding to a nonzero subnormal."
    },
    {
      "id": "pressure-overflow",
      "inputs": {
        "mode": "bar-psi",
        "value": "1e308"
      },
      "expected": {
        "error": {
          "code": "NUMERIC_OVERFLOW",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "The exact result exceeds the finite binary64 range."
    },
    {
      "id": "pressure-underflow",
      "inputs": {
        "mode": "psi-bar",
        "value": "5e-324"
      },
      "expected": {
        "error": {
          "code": "NUMERIC_UNDERFLOW",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "The positive exact result rounds to zero in binary64."
    },
    {
      "id": "pressure-zero",
      "inputs": {
        "mode": "psi-bar",
        "value": "0"
      },
      "expected": {
        "error": {
          "code": "VALUE_MUST_BE_POSITIVE",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "The pressure converter contract requires a strictly positive input."
    },
    {
      "id": "pressure-negative",
      "inputs": {
        "mode": "bar-psi",
        "value": "-1e-300"
      },
      "expected": {
        "error": {
          "code": "VALUE_MUST_BE_POSITIVE",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "A negative value is outside the positive pressure contract."
    },
    {
      "id": "hex-value",
      "inputs": {
        "mode": "psi-bar",
        "value": "0x10"
      },
      "expected": {
        "error": {
          "code": "INVALID_NUMBER",
          "field": "value"
        }
      },
      "source": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors",
      "derivation": "Hexadecimal text is outside the decimal transport grammar."
    }
  ]
}
