Baseline Flop Count Update, New Float Baseline

This commit is contained in:
[Quy Anh] «Elliot» Nguyen
2026-05-23 20:50:59 +02:00
committed by Ahmed Kallala
parent 40f4421d60
commit 43e54871df
18 changed files with 241860 additions and 68 deletions
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <math.h>
struct Vector2d {
float x, y;
Vector2d(float a, float b) : x(a), y(b) {}
Vector2d() : x(.0), y(.0) {}
Vector2d operator+(Vector2d v) const { return Vector2d(v.x + x, v.y + y); }
Vector2d operator-(Vector2d v) const { return Vector2d(x - v.x, y - v.y); }
Vector2d operator-(float a) const { return Vector2d(x - a, y - a); }
Vector2d operator+(float a) const { return Vector2d(x + a, y + a); }
Vector2d operator/(float a) const { return Vector2d(x / a, y / a); }
Vector2d operator*(float a) const { return Vector2d(x * a, y * a); }
Vector2d operator+=(const Vector2d &v) {
*this = *this + v;
return *this;
}
Vector2d operator-=(const Vector2d &v) {
*this = *this - v;
return *this;
}
Vector2d reverse_sign() { return Vector2d(-x, -y); }
// # 1 ADD, 2 MULTs, 1 SQRT
float norm() { return sqrt(x * x + y * y); }
// # 1 ADD, 2 MULTs
float dot(Vector2d v) { return x * v.x + y * v.y; }
void reset() {
x = 0;
y = 0;
}
};