~/bend-docscommunity

elem.bend checks

raw source on the hub · import element-math@0.1.0.0/elem.bend as Elem

4 imports
import Base
import element-ints@0.1.0.0/signed.bend as S
import ./f64.bend as F64
import ./consts.bend as C

Types

type Acc source · line 21 · raw

Data

type Sig source · line 311 · raw

Data

Definitions

def acc_pos source · line 24 · raw

@a:Acc -> List<&2, U32>

def acc_neg source · line 29 · raw

@a:Acc -> List<&2, U32>

def acc_k source · line 34 · raw

@a:Acc -> U32

def pw source · line 40 · raw

@+p:U32 -> List<&2, U32>

2^p

def mul_p source · line 44 · raw

@+a:List<&2, U32> -> @+b:List<&2, U32> -> @+p:U32 -> List<&2, U32>

a b / 2^p, truncated

def div_n source · line 47 · raw

@+a:List<&2, U32> -> @+d:U32 -> List<&2, U32>

def c_at source · line 51 · raw

@+c:List<&2, U32> -> @+p:U32 -> List<&2, U32>

a constant of math/consts.bend with p fraction bits

def add_if source · line 55 · raw

@c:Bool -> @+acc:List<&2, U32> -> @+t:List<&2, U32> -> List<&2, U32>

def sub_abs source · line 63 · raw

@ge:Bool -> @+a:List<&2, U32> -> @+b:List<&2, U32> -> List<&2, U32>

|a - b|, given whether a >= b (a match: n_sub wants a >= b)

def acc_val source · line 70 · raw

@+a:Acc -> List<&2, U32>

def alt_go source · line 75 · raw

@fuel:Nat -> @done:Bool -> @+t:List<&2, U32> -> @+r2:List<&2, U32> -> @+k:U32 -> @+pos:List<&2, U32> -> @+neg:List<&2, U32> -> @+nn:Bool -> @+p:U32 -> Acc

Taylor for sin (t = r, k = 1) or cos (t = 1, k = 0): the next term is t r^2 / ((k+1)(k+2)) with the other sign; nn: the next term is negative.

def exp_go source · line 92 · raw

@fuel:Nat -> @done:Bool -> @+t:List<&2, U32> -> @+r:List<&2, U32> -> @+i:U32 -> @+pos:List<&2, U32> -> @+neg:List<&2, U32> -> @+alt:Bool -> @+nn:Bool -> @+p:U32 -> Acc

Taylor for e^r (t = 1, i = 0): the next term is t r / (i+1); with r < 0 the signs alternate (alt), nn: the next term is negative.

def ath_go source · line 106 · raw

@fuel:Nat -> @done:Bool -> @+t:List<&2, U32> -> @+z2:List<&2, U32> -> @+j:U32 -> @+s:List<&2, U32> -> @+p:U32 -> Acc

atanh z = z + z^3/3 + z^5/5 ...: t is z^j, the sum in pos.

def same_f source · line 120 · raw

@a:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @b:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Bool

def decided source · line 127 · raw

@ok:Bool -> @+lo:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+hi:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def lo_of source · line 134 · raw

@ok:Bool -> @+neg:Bool -> @+mag:List<&2, U32> -> @+err:List<&2, U32> -> @+e:U32 -> 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F

def ziv_round source · line 142 · raw

@+neg:Bool -> @+mag:List<&2, U32> -> @+err:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

The double (-1)^neg (mag +- err) 2^e rounds to, when both ends agree.

def ziv_div source · line 147 · raw

@+neg:Bool -> @+num:List<&2, U32> -> @+den:List<&2, U32> -> @+err:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

The same for a quotient (num +- err) / (den -+ err).

def precisions source · line 151 · raw

List<&2, U32>

def absu source · line 154 · raw

@+k:U32 -> U32

def fix_sel source · line 158 · raw

@right:Bool -> @+m:List<&2, U32> -> @+s:U32 -> List<&2, U32>

|x| 2^p as a natural (x = m 2^e), truncated

def fix_of source · line 165 · raw

@+m:List<&2, U32> -> @+e:U32 -> @+p:U32 -> List<&2, U32>

def exp_try source · line 172 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> @+k:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

x = k ln 2 + r (k = trunc(x / ln 2)); e^x = 2^k e^r.

def exp_in source · line 191 · raw

@out:Bool -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def exp_dec source · line 199 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def exp source · line 210 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def div_q source · line 213 · raw

@+a:List<&2, U32> -> @+b:List<&2, U32> -> List<&2, U32>

def trig_try source · line 224 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+which:U32 -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

|x| = q pi/2 + r exactly enough: t = |x| 2/pi with p+64 fraction bits (2/pi to C.b() bits covers |x| up to 2^1024 at p = 512), q its nearest integer, r = (t - q) pi/2; sin r and cos r by Taylor. which: 0 sin, 1 cos, 2 tan.

def trig_fin source · line 268 · raw

@tiny:Bool -> @+which:U32 -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

|x| < 2^-30: sin x and tan x round to x, cos x to 1.

def trig_dec source · line 275 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+which:U32 -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def trig source · line 288 · raw

@+which:U32 -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def shl_if source · line 291 · raw

@c:Bool -> @+a:List<&2, U32> -> @+s:U32 -> List<&2, U32>

def add_or_sub source · line 299 · raw

@sub:Bool -> @+a:List<&2, U32> -> @+b:List<&2, U32> -> List<&2, U32>

a - b (a >= b) or a + b

def sig_neg source · line 314 · raw

@g:Sig -> Bool

def sig_mag source · line 319 · raw

@g:Sig -> List<&2, U32>

def sig_err source · line 324 · raw

@g:Sig -> U32

def ln_sig source · line 331 · raw

@+m:List<&2, U32> -> @+e:U32 -> @+p:U32 -> Sig

log(m 2^e) with p fraction bits (m > 0 of any size): the sign, the magnitude and an error bound, as log_try computes it.

def log_try source · line 361 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

log(m 2^e) for m of any size (log1p passes 1 + x, which can be far wider than a double's 53 bits)

def log_fin source · line 374 · raw

@one:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

log 1 is exactly +0 (Ziv cannot decide a value whose interval holds 0)

def log_dec source · line 381 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def log source · line 392 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def logb_try source · line 396 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+m:List<&2, U32> -> @+e:U32 -> @+c:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

log2 and log10: log x / log c (c = ln 2 or ln 10 at C.b() bits)

def logb_fin source · line 411 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+c:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def logb source · line 418 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+c:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def u_n source · line 423 · raw

@frac:Bool -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> List<&2, U32>

log1p x = log u, u = 1 + x exactly: (2^-e +- m) 2^e for e < 0 (x is not an integer), m 2^e + 1 otherwise (x >= 1 here: x > -1 and non-zero).

def log1p_fin source · line 431 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def log1p source · line 439 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def em1_sig source · line 443 · raw

@below:Bool -> @+s:List<&2, U32> -> @+ea:U32 -> @+err:U32 -> Sig

expm1: e^x = S 2^(k-p) as exp_try computes it, then minus 1 exactly

def expm1_try source · line 452 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> @+k:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def expm1_fin source · line 476 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def expm1 source · line 483 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def halve source · line 488 · raw

@+t:List<&2, U32> -> @+p:U32 -> List<&2, U32>

atan t for t in [0, 1] (p fraction bits): two half-angle steps t / (1 + sqrt(1 + t^2)), then Taylor; the final x4 scales every error.

def ats_go source · line 493 · raw

@fuel:Nat -> @done:Bool -> @+t:List<&2, U32> -> @+z2:List<&2, U32> -> @+j:U32 -> @+pos:List<&2, U32> -> @+neg:List<&2, U32> -> @+nn:Bool -> @+p:U32 -> Acc

def atan_fixed source · line 507 · raw

@+t:List<&2, U32> -> @+p:U32 -> Sig

def atan_side source · line 514 · raw

@le:Bool -> @+num:List<&2, U32> -> @+den:List<&2, U32> -> @+p:U32 -> Sig

atan(num / den) for num, den > 0: by 1/t past 1 (pi/2 - atan(den/num))

def atan_ratio source · line 525 · raw

@+num:List<&2, U32> -> @+den:List<&2, U32> -> @+p:U32 -> Sig

def num_sel source · line 529 · raw

@frac:Bool -> @+m:List<&2, U32> -> @+e:U32 -> List<&2, U32>

x = m 2^e as num / den

def den_sel source · line 536 · raw

@frac:Bool -> @+e:U32 -> List<&2, U32>

def num_of source · line 543 · raw

@+m:List<&2, U32> -> @+e:U32 -> List<&2, U32>

def den_of source · line 546 · raw

@+e:U32 -> List<&2, U32>

def atan_try source · line 549 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan_fin source · line 561 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan source · line 568 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan2_try source · line 573 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+yneg:Bool -> @+xneg:Bool -> @+num:List<&2, U32> -> @+den:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

atan2(y, x), both finite and non-zero: atan(|y| / |x|), or pi minus it for x < 0. A ratio below 2^-60 with x > 0 is |y| / |x| rounded once.

def atan2_go source · line 589 · raw

@tiny:Bool -> @+yneg:Bool -> @+xneg:Bool -> @+num:List<&2, U32> -> @+den:List<&2, U32> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan2_xy source · line 596 · raw

@+yneg:Bool -> @+ny:List<&2, U32> -> @+ey:U32 -> @+xneg:Bool -> @+nx:List<&2, U32> -> @+ex:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan2_x source · line 604 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+yneg:Bool -> @+ny:List<&2, U32> -> @+ey:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan2_y source · line 611 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def atan2 source · line 618 · raw

@+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def asin_try source · line 623 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+which:U32 -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

asin and acos for 0 < |x| < 1: asin |x| = atan(|x| / sqrt(1 - x^2)), acos x = pi/2 - asin x. which: 0 asin, 1 acos.

def asin_fin source · line 643 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+which:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def asin source · line 650 · raw

@+which:U32 -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def f32_q source · line 658 · raw

@right:Bool -> @+m:List<&2, U32> -> @+sh:U32 -> List<&2, U32>

Math.fround: the float32 nearest x (ties to even), as a double: m rounded to 24 bits, or to float32's subnormal step 2^-149; past its largest finite value, Infinity. Exact: no Ziv.

def fround_fin source · line 665 · raw

@+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F

def fround_dec source · line 676 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F

def fround source · line 683 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def f32_enc source · line 692 · raw

@k:Nat -> @+s:U32 -> @+e:U32 -> @+hi:U32 -> @+lo:U32 -> U32

A float32's bits from a double that is one already (fround's answer): class k 0 a zero, 1 a float32 subnormal (E < 897), 2 normal, 3 Infinity or NaN. A NaN is stored as 0x7FC00000, as Chrome stores it. (A match, not picks: the subnormal shift is only valid in its own class.)

def f32_cls source · line 709 · raw

@+e:U32 -> U32

def f32_of_f source · line 712 · raw

@f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> U32

def f32_bits source · line 721 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> U32

the bits of the float32 nearest x (ties to even)

def f32_dec source · line 726 · raw

@k:Nat -> @+neg:Bool -> @+w:U32 -> @+ex:U32 -> @+mt:U32 -> 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F

the double a float32's bits stand for (exact: every float32 is a double)

def f32_val source · line 739 · raw

@+w:U32 -> 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F

def cb_go source · line 749 · raw

@fuel:Nat -> @+n:List<&2, U32> -> @+r:List<&2, U32> -> @+b:U32 -> List<&2, U32>

cbrt: N = m 2^(3s + t) with e - t divisible by 3; r = floor(cbrt N) bit by bit; the value lies in [r, r+1) 2^((e - t)/3 - s): both ends round alike, or r^3 = N (exact). s grows when they do not.

def icbrt source · line 760 · raw

@+n:List<&2, U32> -> List<&2, U32>

def mod3 source · line 765 · raw

@+e:U32 -> U32

def cbrt_try source · line 771 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def cbrt_dec source · line 795 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def cbrt source · line 802 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def tanh_try source · line 808 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+neg:Bool -> @+m:List<&2, U32> -> @+e:U32 -> @+k:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

tanh |x| = (e^2|x| - 1) / (e^2|x| + 1), for 2^-30 <= |x| < 22 (the prelude answers the rest): e^2|x| = S 2^(k-p) with 0 <= k <= 63 < p, so S 2^k is it with p fraction bits.

def tanh_dec source · line 832 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def tanh source · line 840 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pad4 source · line 848 · raw

@+d:U32 -> String

The decimal digits of round(|x| 10^s), ties away from zero (ES's "the larger n"). x is m 2^e exactly, so this is one division of naturals: floor((2 num + den) / (2 den)). No double is rounded on the way.

def lo_limb source · line 852 · raw

@xs:List<&2, U32> -> U32

def dec_go source · line 862 · raw

@fuel:Nat -> @done:Bool -> @+n:List<&2, U32> -> @+acc:String -> String

four digits a step (a remainder below 10000 is one 16-bit limb), each padded to four: the caller drops the leading zeros. done is set once the quotient is 0; the fuel, a step per 13 bits, outlasts the digits.

def nat_dec source · line 876 · raw

@+n:List<&2, U32> -> String

def dec_round_d source · line 881 · raw

@d:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+s:U32 -> String

def dec_round source · line 896 · raw

@+f:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+s:U32 -> String

s is signed; the caller keeps |s| under 1200

def shift_up_sel source · line 916 · raw

@right:Bool -> @+a:List<&2, U32> -> @+s:U32 -> List<&2, U32>

a natural times 2^s (s signed); a right shift rounds up (an error bound). (a match, as fix_sel: a pick builds both sides, and a left shift by a negative s read unsigned is a shift by ~2^32 bits)

def shift_up source · line 923 · raw

@+a:List<&2, U32> -> @+s:U32 -> List<&2, U32>

def shift_down source · line 926 · raw

@+a:List<&2, U32> -> @+s:U32 -> List<&2, U32>

def pow_exp source · line 930 · raw

@+tneg:Bool -> @+tt:List<&2, U32> -> @+terr:List<&2, U32> -> @+q:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

e^(+-T 2^-q) with T's error terr (units of 2^-q), when |t| < 1024

def pow_range source · line 944 · raw

@out:Bool -> @+tneg:Bool -> @+tt:List<&2, U32> -> @+terr:List<&2, U32> -> @+q:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

|t| >= 1024: e^t is +Infinity or +0 (a match: the series never runs)

def pow_at source · line 951 · raw

@+mx:List<&2, U32> -> @+ex:U32 -> @+yneg:Bool -> @+my:List<&2, U32> -> @+ey:U32 -> @+p:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_try source · line 960 · raw

@ps:List<&2, U32> -> @prev:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> @+mx:List<&2, U32> -> @+ex:U32 -> @+yneg:Bool -> @+my:List<&2, U32> -> @+ey:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_dy source · line 971 · raw

@dy:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+mx:List<&2, U32> -> @+ex:U32 -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_dx source · line 978 · raw

@dx:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_frac source · line 987 · raw

@+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

x > 0 finite, x != 1, y finite and not an integer; None outside that domain, or when 512 bits do not decide the rounding

def pow_neg_int source · line 996 · raw

@odd:Bool -> @m:Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F> -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_fin source · line 1004 · raw

@+xneg:Bool -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+yint:Bool -> @+yodd:Bool -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

x finite and not zero: a negative x has a real power only for an integer y

def pow_xd source · line 1009 · raw

@dx:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+yneg:Bool -> @+yint:Bool -> @+yodd:Bool -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_yinf source · line 1022 · raw

@+c:U32 -> @+xnan:Bool -> @+yneg:Bool -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

an infinite y: |x| against 1 (0 less, 1 equal, 2 greater)

def pow_half source · line 1026 · raw

@half:Bool -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+yneg:Bool -> @+yint:Bool -> @+yodd:Bool -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_yd source · line 1033 · raw

@dy:0x280fb10bca5c5d06ed8109bb4300bab8/f64.Dec -> @+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>

def pow_js source · line 1047 · raw

@+x:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> @+y:0x280fb10bca5c5d06ed8109bb4300bab8/f64.F -> Maybe<&2, 0x280fb10bca5c5d06ed8109bb4300bab8/f64.F>