AssemblyScript:
export function sigmoid(x: f64): f64 {
return 1 / (1 + Math.exp(-x))
}
output:
(module
(type $t0 (func (param f64) (result f64)))
(type $t1 (func))
(import "Math" "exp" (func $Math.exp (type $t0)))
(func $sigmoid (export "sigmoid") (type $t0) (param $p0 f64) (result f64)
f64.const 0x1p+0 (;=1;)
f64.const 0x1p+0 (;=1;)
get_local $p0
f64.neg
call $Math.exp
f64.add
f64.div)
(func $f2 (type $t1)
nop)
(memory $memory (export "memory") 0))
https://webassembly.studio/?f=497rvcd5qbi