Skip to content

Misc fixes#870

Merged
skirpichev merged 5 commits intompmath:masterfrom
skirpichev:misc
Sep 25, 2024
Merged

Misc fixes#870
skirpichev merged 5 commits intompmath:masterfrom
skirpichev:misc

Conversation

@skirpichev
Copy link
Copy Markdown
Collaborator

@skirpichev skirpichev commented Sep 24, 2024

  • properly support 'A' format option, amends 40c16e9
  • optimize format_hexadecimal() like format_binary()
  • don't use normalize() in format_* helpers
  • enable trap_complex for MDNewton, closes hang in findroot #869
  • put coverage report to build/coverage/html/

Test code:
```py
import pyperf

from mpmath import pi
from mpmath.libmp.libmpf import format_hexadecimal as fd

runner = pyperf.Runner()
pi = pi._mpf_
runner.bench_func('fd(pi, -1)', fd, pi)
runner.bench_func('fd(pi, +5)', fd, pi, 5)
```

Results:
| Benchmark      | master  | patch                 |
|----------------|:-------:|:---------------------:|
| fd(pi, -1)     | 38.9 us | 17.1 us: 2.27x faster |
| fd(pi, +5)     | 39.7 us | 18.7 us: 2.13x faster |
| Geometric mean | (ref)   | 2.20x faster          |
@skirpichev skirpichev marked this pull request as ready for review September 24, 2024 05:17
@skirpichev skirpichev merged commit 4bee0fc into mpmath:master Sep 25, 2024
@skirpichev skirpichev deleted the misc branch September 25, 2024 04:09
@skirpichev skirpichev added this to the 1.4 milestone May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hang in findroot

1 participant