Compare commits
6 Commits
7ff3b2148e
...
a859f2572f
Author | SHA1 | Date | |
---|---|---|---|
a859f2572f | |||
af6ea91faa | |||
982be656bd | |||
7807165dbf | |||
be6df15ab5 | |||
28fd4f69aa |
|
@ -1,6 +1,6 @@
|
|||
# A minimalist calculator for fermi estimation
|
||||
|
||||
This project is a minimalist, stack-based DSL for fermi estimation. It can multiply, divide, add and substract scalars, lognormals and beta distributions.
|
||||
This project is a minimalist, calculator-style DSL for fermi estimation. It can multiply, divide, add and substract scalars, lognormals and beta distributions.
|
||||
|
||||
## Motivation
|
||||
|
||||
|
@ -120,6 +120,7 @@ help
|
|||
|
||||
- It's conceptually clearer to have all the multiplications first and then all the divisions
|
||||
- For things between 0 and 1, consider using a beta distribution
|
||||
- Because the model reads from standard input, you can pipe a model to it. For instance, try cat more/piano-tuners.f | fermi
|
||||
|
||||
## Different levels of complexity
|
||||
|
||||
|
@ -161,6 +162,7 @@ Done:
|
|||
|
||||
To (possibly) do:
|
||||
|
||||
- [ ] Specify number of samples as a command line option
|
||||
- [ ] Document parenthesis syntax
|
||||
- [ ] Add functions. Now easier to do with an explicit representation of the stakc
|
||||
- [ ] Think about how to draw a histogram from samples
|
||||
|
|
3
f.go
3
f.go
|
@ -364,6 +364,7 @@ replForLoop:
|
|||
|
||||
switch {
|
||||
case strings.TrimSpace(new_line_trimmed) == "": /* Empty line case */
|
||||
continue replForLoop
|
||||
/* Parenthesis */
|
||||
case len(words) == 2 && (words[0] == "*" || words[0] == "+" || words[0] == "-" || words[0] == "/") && words[1] == "(":
|
||||
new_stack := runRepl(Stack{old_dist: INIT_DIST, vars: stack.vars}, reader)
|
||||
|
@ -392,8 +393,6 @@ replForLoop:
|
|||
fmt.Printf("%s ", words[1])
|
||||
prettyPrintDist(stack.old_dist)
|
||||
stack.old_dist = INIT_DIST
|
||||
// fmt.Println()
|
||||
// continue replForLoop
|
||||
default:
|
||||
op, new_dist, err := parseWordsIntoOpAndDist(words, stack.vars)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user