Skip to content

Commit

Permalink
Merge branch 'master' into update-gethpin-v1.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi authored Aug 1, 2024
2 parents 15834ae + ef80384 commit 619c621
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nitro-testnode
Submodule nitro-testnode updated 1 files
+1 −1 blockscout
8 changes: 4 additions & 4 deletions util/arbmath/math.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func DivCeil[T Unsigned](value, divisor T) T {

// ApproxExpBasisPoints return the Maclaurin series approximation of e^x, where x is denominated in basis points.
// The quartic polynomial will underestimate e^x by about 5% as x approaches 20000 bips.
func ApproxExpBasisPoints(value Bips, degree uint64) Bips {
func ApproxExpBasisPoints(value Bips, accuracy uint64) Bips {
input := value
negative := value < 0
if negative {
Expand All @@ -396,9 +396,9 @@ func ApproxExpBasisPoints(value Bips, degree uint64) Bips {
x := uint64(input)
bips := uint64(OneInBips)

res := bips + x/degree
for i := uint64(1); i < degree; i++ {
res = bips + SaturatingUMul(res, x)/((degree-i)*bips)
res := bips + x/accuracy
for i := uint64(1); i < accuracy; i++ {
res = bips + SaturatingUMul(res, x)/((accuracy-i)*bips)
}

if negative {
Expand Down

0 comments on commit 619c621

Please sign in to comment.