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!
========================================================================= Methods ranked by typical performance: # Curvature (0xfaded) - ~20-25 ns - NO TRIG, 3 sqrt/iter, fixed 3 iters # Model G (Eberly 2) - ~25-35 ns - NO TRIG, 2 div/iter, but less accurate # Model O (Eberly 2) - ~30-40 ns - NO TRIG, better init, still 2 iter # Model O (Eberly 3) - ~35-45 ns - NO TRIG, 3 iter for better accuracy # Model C (rotation) - ~35-50 ns - NO TRIG in loop, 4 iters, sqrt/iter # Newton Standard - ~80-120ns - TRIG every iteration Key insight: * Curvature method uses 3 sqrt per iteration = 9 sqrt total * Eberly methods use 2-3 div per iteration = 4-9 div total * Both avoid trig, but curvature has simpler iteration structure For GAMES: Model G/O with 2 iterations is often "good enough" and fastest. For ACCURACY: Curvature 3-iter or Model O 3-iter are best choices. Whoa! The Model G and Model O methods have terrible accuracy (errors in the millions!). That means there's a bug in those implementations or the algorithms don't work correctly for all cases. Let me look at the accuracy numbers: Curvature: 4.77e-07 (good - float precision) Newton Standard: 1.19e-07 (good) Model G (2): 1.31e+06 (TERRIBLE - completely wrong!) Model O (2): 6.65e+10 (TERRIBLE - completely wrong!) Model O (3): 2.96e+10 (TERRIBLE - completely wrong!) The Eberly t-equation methods are completely broken! The Model C (rotation trick) doesn't have accuracy listed because it needs special handling. Let me fix this benchmark to properly compare only working methods. Looking at the Eberly method more carefully, the issue is that t=0 initialization doesn't work for all points. The method needs more careful handling. Let me fix the implementations. Actually, looking at the original code from Models G and O, there are issues: Model G starts t=0 which doesn't converge for many cases Model O has issues with inside/outside handling Let me create a proper version of the Eberly method that actually works, and then do a fair comparison. Whoa! The Eberly-style methods (Model G/O) have catastrophic accuracy failures - errors in the millions! Those implementations are broken. Let me fix them and re-run: bash cd /home/claude && g++ -O3 -march=native -ffast-math -std=c++17 ellipse_benchmark_fixed.cpp -o bench_fixed -lm && ./bench_fixed Output
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)