Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Nov 19, 2025

@ana-pantilie
Copy link
Contributor Author

ana-pantilie commented Nov 19, 2025

InsertCoin

Screenshot 2025-11-19 at 23 10 13

f$t - time
f$u - size of Value
Black circles - amount inserted is zero (so insertCoin behaves like deleteCoin)
Red circles - amount inserted is maxBound

@ana-pantilie
Copy link
Contributor Author

ana-pantilie commented Nov 20, 2025

UnionValue

Linear model in sum of total sizes: not very good.

Screenshot 2025-11-20 at 19 54 09 Screenshot 2025-11-20 at 19 57 46

Quadratic model in square of sum of total sizes: pretty good!

Screenshot 2025-11-20 at 19 55 14 Screenshot 2025-11-20 at 19 55 30 Screenshot 2025-11-20 at 19 58 04

@ana-pantilie ana-pantilie changed the title Value costing: insertCoin, unionValue Value costing: insertCoin, unionValue, scaleValue Nov 20, 2025
@ana-pantilie
Copy link
Contributor Author

ana-pantilie commented Nov 21, 2025

ScaleValue

With randomized quantities and scalars and randomized total size of value

Screenshot 2025-11-21 at 22 59 18

@ana-pantilie ana-pantilie force-pushed the ana/value-costing-final branch 2 times, most recently from a892843 to 1e44958 Compare December 5, 2025 13:18
@ana-pantilie ana-pantilie force-pushed the ana/value-costing-final branch from 1e44958 to abdc6ed Compare December 5, 2025 14:15
| QuadraticInY OneVariableQuadraticFunction
| QuadraticInZ OneVariableQuadraticFunction
| QuadraticInXAndY TwoVariableQuadraticFunction
| SquareOfSum SquareOfTwoVariableSumFunction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This most likely won't be needed - a + bx + cy should be good enough.

Copy link
Contributor Author

@ana-pantilie ana-pantilie Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SquareOfSum stuff is from before the recent experimentation for unionValue, so it's outdated.

a + bx + cy should be good enough.

I would assume a, b and c are the coefficients we are trying to determine while x and y are the sizes of the inputs, right? Then, as far as I understand, this translates to running R's linear regression algorithm for the t ~ x + y formula. @kwxm am I understanding what @zliu41 is suggesting correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, just to be sure, I(x + y) means "find a coefficient for (x + y)" while x + y means "find a coefficient for x and a coefficient for y", right?

)
| pId <- policyIds
]
amt = mkQuantity 10000000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to use smaller integers at all - just always use maxBound / 2.

Copy link
Contributor Author

@ana-pantilie ana-pantilie Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep getting errors when using integers close to the maxBound, not sure why yet. This is the same issue I ran into when working on the scaleValue generator. These errors appear despite taking precautions to not allow the additions/multiplications to overflow. Since for unionValue the size of the integers doesn't matter I have postponed the investigation for a bit later, but it's on my TODO list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants