{"id":34924817,"url":"https://github.com/nelsond/dilogarithm","last_synced_at":"2026-04-13T07:37:11.004Z","repository":{"id":83383517,"uuid":"147079256","full_name":"nelsond/dilogarithm","owner":"nelsond","description":"Fairly fast implementation of the Dilogarithm (Polylogarithm order 2) for Python/numpy","archived":false,"fork":false,"pushed_at":"2018-09-02T13:23:46.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-13T07:37:08.424Z","etag":null,"topics":["math","numpy","physics","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nelsond.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-02T11:31:20.000Z","updated_at":"2023-09-21T13:18:59.000Z","dependencies_parsed_at":"2023-03-12T18:12:22.046Z","dependency_job_id":null,"html_url":"https://github.com/nelsond/dilogarithm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nelsond/dilogarithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsond%2Fdilogarithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsond%2Fdilogarithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsond%2Fdilogarithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsond%2Fdilogarithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nelsond","download_url":"https://codeload.github.com/nelsond/dilogarithm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsond%2Fdilogarithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31744404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["math","numpy","physics","python"],"created_at":"2025-12-26T14:21:45.530Z","updated_at":"2026-04-13T07:37:10.994Z","avatar_url":"https://github.com/nelsond.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dilogarithm [![Build Status](https://travis-ci.org/nelsond/dilogarithm.svg?branch=master)](https://travis-ci.org/nelsond/dilogarithm)\n\nThis module contains a Python implementation of the\n[Dilogarithm](https://en.wikipedia.org/wiki/Spence%27s_function) as a\n[numpy ufunc](https://docs.scipy.org/doc/numpy/reference/ufuncs.html)\nusing a C extension. Note that only real valued arguments are supported\nat the moment.\n\nThe implementation in the C extension is adapted from the Fortran\nimplementation in [CERNLIB](http://cernlib.web.cern.ch). See the\n[CERNLIB\nmanual](http://cmd.inp.nsk.su/old/cmd2/manuals/cernlib/shortwrups/node64.html)\nfor more details. CERNLIB is licensed under the [GNU GPL](http://cernlib.web.cern.ch/cernlib/conditions.html).\n\n**Note:** [`scipy.special.spence`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.spence.html) is equivalent to the `rdilog` implementation in this module when changing the argument accordingly.\n\n```python\nfrom scipy.special import spence\n\ndef rdilog(x):\n\treturn spence(1-x)\n```\n\n## Requirements\n\nThis module requires Python \u003e= 3.4.\n\n* `numpy` \u003e= 1.12\n\n## Install\n\nInstall with pip\n\n```shell\n$ pip install git+git://github.com/nelsond/dilogarithm.git\n```\n\n## Example usage\n\n```python\nfrom dilogarithm import rdilog\nimport numpy as np\n\nrdilog(-100) # =\u003e -12.23875517731494\n\nxx = np.linspace(-100, -1, 100)\nrdilog(xx) # =\u003e array([-12.23875518, -12.19242167, ... ])\n```\n\n## Performance\n\nThe performance of this module is comparable to `scipy.special.spence` and faster than `mpmath.fp.polylogy`.\n\n```python\nIn [1]: from random import random\n   ...: from dilogarithm import rdilog\n   ...: from scipy.special import spence\n   ...: import mpmath as mp\n\nIn [2]: %timeit rdilog(random()*1e6)\n779 ns ± 22.3 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)\n\nIn [3]: %timeit spence(random()*1e6)\n794 ns ± 19.1 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)\n\nIn [4]: %timeit mp.fp.polylog(2, random()*1e6)\n14.7 µs ± 757 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n```\n\n(MacBook Pro/2.6 GHz Intel Core i7)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsond%2Fdilogarithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelsond%2Fdilogarithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsond%2Fdilogarithm/lists"}