Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add arb_log_base, arb_bits, acb_bits #160

Merged
merged 5 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/flint/flintlib/arb.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ cdef extern from "flint/arb.h":
void arb_log_ui(arb_t z, ulong x, long prec)
void arb_log_fmpz(arb_t z, const fmpz_t x, long prec)
void arb_log1p(arb_t z, const arb_t x, long prec)
void arb_log_base_ui(arb_t z, const arb_t x, ulong b, long prec)
void arb_exp(arb_t z, const arb_t x, long prec)
void arb_expm1(arb_t z, const arb_t x, long prec)
void arb_sin(arb_t s, const arb_t x, long prec)
Expand Down
3 changes: 3 additions & 0 deletions src/flint/types/acb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,9 @@ cdef class acb(flint_scalar):
def rel_one_accuracy_bits(self):
return acb_rel_one_accuracy_bits(self.val)

def bits(self):
return acb_bits(self.val)

def ei(s):
r"""
Exponential integral `\operatorname{Ei}(s)`.
Expand Down
13 changes: 13 additions & 0 deletions src/flint/types/arb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,16 @@ cdef class arb(flint_scalar):
arb_log1p((<arb>u).val, (<arb>s).val, getprec())
return u

def log_base_ui(s, ulong b):
roos-j marked this conversation as resolved.
Show resolved Hide resolved
r"""Returns `\log_b(s)`, computed exactly when possible.

>>> arb(2048).log_base_ui(2)
11.0000000000000
"""
u = arb.__new__(arb)
arb_log_base_ui((<arb>u).val, (<arb>s).val, b, getprec())
return u

def sin(s):
r"""
Sine function `\sin(s)`.
Expand Down Expand Up @@ -2416,6 +2426,9 @@ cdef class arb(flint_scalar):
def rel_one_accuracy_bits(self):
return arb_rel_one_accuracy_bits(self.val)

def bits(self):
return arb_bits(self.val)
roos-j marked this conversation as resolved.
Show resolved Hide resolved

def lambertw(s, int branch=0):
r"""
Lambert *W* function, `W_k(s)`. Either the principal
Expand Down
Loading