Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/rc/gauss.rc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

. /bin/maths.rc

e = 2.71828
pi = 3.14159

sd = 0.84
scale = 5

fn gauss {
	div `{exp `{div -`{mul $1 $1} `{mul $sd $sd} }}  `{sqrt `{mul 2 $pi $sd}}
}

gauss 0
gauss 0.5
gauss 2

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.