IntersectMBO / IntersectMBO/plutus
Optimize `ScaleValue` for special factors
Open
Builtins
Internal
status: triaged
- Dominant language
- Haskell
- Stars
- 1.6k
- Forks
- 508
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
As shown in #7402, special factors for `ScaleValue` like scaling by `-1` can be pretty significantly optimized because for negation boundary checks can be done by a single equality check instead of two inequalities. `ScaleValue` can handle these special factors like `-1` differently and give cheaper cost. Cost model should be able to have different "branches" for different coefficient(or so was I told, @kwxm can you confirm here?).
Also check factors like `2`. `x + x` might be cheaper than `2 * x`.
Contributor guide
Assessment
This issue has not been assessed yet.