BendMlTensorGpu.rng_ln_m: def of bend-ml-tensor-gpu@0.1.5.1 Import: import bend-ml-tensor-gpu@0.1.5.1/main.bend as BendMlTensorGpu Lines 620-628 of bend-ml-tensor-gpu@0.1.5.1/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-tensor-gpu@0.1.5.1/main.bend&start_line=620&end_line=628 import Base # ln m for m in [sqrt(1/2), sqrt(2)], from s = (m - 1) / (m + 1): ln m = 2 (s + s^3/3 + s^5/5 + s^7/7 + s^9/9) def rng_ln_m(+ex: F32, +m: F32) -> F32: +s = ((m - 1.0 : F32) / (m + 1.0 : F32) : F32) +z = (s * s : F32) +c3 = (0.14285715 + (z * 0.11111111 : F32) : F32) +c2 = (0.2 + (z * c3 : F32) : F32) +p = (z * (0.33333334 + (z * c2 : F32) : F32) : F32) +t = (s + s : F32) ((ex * 0.693145751953125 : F32) + ((t + (t * p : F32) : F32) + (ex * 0.0000014286067653 : F32) : F32) : F32) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub