Skip to content

Commit

Permalink
update Hypot() plot
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Apr 17, 2024
1 parent 6ef4c0c commit 75fa088
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion RunHypot.py → Hypot.py
Expand Up @@ -77,14 +77,14 @@ def plotspeed(N, pyrat, fortrat):
ax.plot(N, fortrat, label="Fortran")

ax.set_title(
"timeit(sqrt(a**2+b**2)) / timeit(hypot(a,b))\n"
f"Numpy {np.__version__} Python {pyver} Gfortran {fortver}\n"
f"{platform.system()} {platform.machine()}"
)
ax.set_xscale("log")
ax.legend(loc="best")
ax.grid(True, which="both")
ax.set_xlabel("N length of vectors a,b")
ax.set_ylabel("timeit(sqrt($a^2+b^2$)) / timeit(hypot(a,b))")

figfn = bdir / "hypot.png"
print("saved figure to", figfn)
Expand Down
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -61,14 +61,10 @@ inf
Execute the Hypot speed test by:

```sh
python RunHypot.py
python Hypot.py
```

![Python 3.6 hypot() vs rsq()](.gfx/py36hypot.png)

![Python 2.7 hypot() vs rsq()](./gfx/py27hypot.png)

![Python 3.5 hypot() vs rsq()](./gfx/py35hypot.png)
![hypot() vs rsq()](.gfx/hypot.png)

## Notes

Expand Down
Binary file added gfx/hypot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 75fa088

Please sign in to comment.