Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/6959ed27-accc-800e-8e87-21aa81e93c07
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: Yeah — I double-checked it, and Claude’s “faster” result is an artifact of the reference being wrong, not an actually-b… === Yeah — I double-checked it, and Claude’s “faster” result is an artifact of the reference being wrong, not an actually-better closest-point solver. ===== I took the same set of methods and timing harness style, but replaced the “reference” with a robust closest-point reference (Eberly’s monotonic t-equation with bracketing), which has a unique root → unique closest point for any ellipse/point. ===== Claude’s file uses as “reference” a Newton solve on the angle equation starting from atan2(a|y|, b|x|) — that can converge to the wrong stationary point (still on the ellipse, but not the closest), especially for interior points and high eccentricity. ===== With the robust reference, claude_rotation is fast but wildly incorrect for real ellipses (except the circle case): ===== Example (this environment, -O3 -march=native -ffast-math, N=20k): Moderate (150,100): * claude_rot(2) ≈ 43.9 ns/call, but p99 distance error ~31 and max error ~43 (not closest point). * faded_opt(2) ≈ 50.6 ns/call, p99 ~1.2e-3, max ~0.20 (close). * faded_opt(3) ≈ 84.1 ns/call, p99 ~3e-5, max ~1.3e-2 (very close). High ecc (200,50): * claude_rot(2) ≈ 39.1 ns/call, but p99 ~120 (!!) * faded_opt(3) ≈ 91.0 ns/call, p99 ~2.4e-3 Circle (100,100): * claude_rot(2) is fine (projection is trivial-ish), errors ~1e-5. ===== Because his “reference” is essentially the same Newton basin as claude_rotation, so they often converge to the same wrong stationary point and therefore agree—making the reported “distance error vs reference” look small even when both are wrong. ===== ===== - Yes, Claude found something faster in ns/call. ===== * No, it’s not a correct closest-point solver for ellipses (it’s returning the wrong stationary point a lot). * If you want “fast and correct”, stick with faded_opt(3) (or a carefully validated hybrid), and validate against a monotonic/bracketed reference like Eberly. If you want, I can paste the exact double-check harness I ran (the one producing those numbers) so you can compile it on your target machine.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)