Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Scott’s rule #246

Merged
merged 1 commit into from
Apr 1, 2022
Merged

fix Scott’s rule #246

merged 1 commit into from
Apr 1, 2022

Conversation

mbostock
Copy link
Member

I’m not sure how this happened, but all the literature uses 3.49, but d3-array used 3.5 for some reason.

I also thought about switching to Math.cbrt(1 / count(values)) but I’m not sure if that’s an improvement.

@mbostock mbostock requested a review from Fil March 31, 2022 22:36
@Fil
Copy link
Member

Fil commented Apr 1, 2022

cbrt is more precise than pow(1/3), and faster on Chrome (but on Safari and Firefox the performance is almost identical). None of this matters here :)

Chrome

@mbostock
Copy link
Member Author

mbostock commented Apr 1, 2022

cbrt is more precise than pow(1/3)

Right, but is cbrt(1/x) more precise (or faster) than pow(x, -1/3)?

@mbostock mbostock merged commit f105a46 into main Apr 1, 2022
@mbostock mbostock deleted the mbostock/fix-scott branch April 1, 2022 15:11
@Fil
Copy link
Member

Fil commented Apr 1, 2022

I've added those to the test notebook, it doesn't seem to change anything in terms of speed. As for accuracy I don't know what would be relevant. https://observablehq.com/@fil/math-cbrt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants