Average Error: 0.1 → 0.1
Time: 33.0s
Precision: 64
Internal Precision: 128
\[\left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)\]
\[\left(a - \frac{1.0}{3.0}\right) + \left({\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{-1}{2}} \cdot rand\right) \cdot \left(a - \frac{1.0}{3.0}\right)\]

Error

Bits error versus a

Bits error versus rand

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)\]
  2. Using strategy rm
  3. Applied pow1/20.1

    \[\leadsto \left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \frac{1}{\color{blue}{{\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{1}{2}}}} \cdot rand\right)\]
  4. Applied pow-flip0.1

    \[\leadsto \left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \color{blue}{{\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\left(-\frac{1}{2}\right)}} \cdot rand\right)\]
  5. Simplified0.1

    \[\leadsto \left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + {\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\color{blue}{\frac{-1}{2}}} \cdot rand\right)\]
  6. Using strategy rm
  7. Applied distribute-rgt-in0.1

    \[\leadsto \color{blue}{1 \cdot \left(a - \frac{1.0}{3.0}\right) + \left({\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{-1}{2}} \cdot rand\right) \cdot \left(a - \frac{1.0}{3.0}\right)}\]
  8. Final simplification0.1

    \[\leadsto \left(a - \frac{1.0}{3.0}\right) + \left({\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{-1}{2}} \cdot rand\right) \cdot \left(a - \frac{1.0}{3.0}\right)\]

Reproduce

herbie shell --seed 2019002 
(FPCore (a rand)
  :name "Octave 3.8, oct_fill_randg"
  (* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand))))

Details

Time bar (total: 32.3s)Debug log

sample297.0ms

Algorithm
intervals

simplify476.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

476.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.1b

localize22.0ms

Local error

Found 4 expressions with local error:

0.3b
(sqrt (* 9 (- a (/ 1.0 3.0))))
0.3b
(/ 1 (sqrt (* 9 (- a (/ 1.0 3.0)))))
0.2b
(* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)
0.1b
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 73
Calls

4 calls. Slowest were:

8.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))
5.0ms
(* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)
2.0ms
(/ 1 (sqrt (* 9 (- a (/ 1.0 3.0)))))

series188.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

65.0ms
(* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)
43.0ms
(/ 1 (sqrt (* 9 (- a (/ 1.0 3.0)))))
43.0ms
(sqrt (* 9 (- a (/ 1.0 3.0))))
37.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))

simplify6.6s

Counts
50 → 85
Calls

50 calls. Slowest were:

520.0ms
(* (+ a (/ 1.0 3.0)) (+ (* 1 1) (- (* (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand) (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)) (* 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))))
497.0ms
(* (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))
456.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))

prune841.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

0.4b
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
0.2b
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
0.1b
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
0.0b
(* 9 (- a (/ 1.0 3.0)))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 67
Calls

4 calls. Slowest were:

4.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
4.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
2.0ms
(* 9 (- a (/ 1.0 3.0)))

series219.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

84.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
78.0ms
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
38.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
19.0ms
(* 9 (- a (/ 1.0 3.0)))

simplify5.3s

Counts
49 → 79
Calls

49 calls. Slowest were:

468.0ms
(* (+ a (/ 1.0 3.0)) (+ (* 1 1) (- (* (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand) (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)) (* 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))))
443.0ms
(* (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
341.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))

prune901.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

6.6b
(* (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand) (- a (/ 1.0 3.0)))
0.4b
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
0.2b
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
0.0b
(* 9 (- a (/ 1.0 3.0)))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

17.0ms
(* (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand) (- a (/ 1.0 3.0)))
7.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
3.0ms
(* 9 (- a (/ 1.0 3.0)))

series237.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

83.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
81.0ms
(* (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand) (- a (/ 1.0 3.0)))
52.0ms
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
20.0ms
(* 9 (- a (/ 1.0 3.0)))

simplify2.8s

Counts
40 → 73
Calls

40 calls. Slowest were:

361.0ms
(- (+ (* 1/3 (* (sqrt (- 0.3333333333333333)) rand)) (* 1/6 (/ (* a rand) (sqrt (- 0.3333333333333333))))) (* 1/24 (/ (* (pow a 2) rand) (pow (sqrt (- 0.3333333333333333)) 3))))
333.0ms
(+ (* 0.041666666666666664 (/ (exp (* -1/2 (- (log 9) (log (/ 1 a))))) (pow a 2))) (+ (exp (* -1/2 (- (log 9) (log (/ 1 a))))) (* 0.16666666666666666 (/ (exp (* -1/2 (- (log 9) (log (/ 1 a))))) a))))
289.0ms
(- (* rand (sqrt -0.3333333333333333)) (+ (* 0.5 (/ (* a rand) (sqrt -0.3333333333333333))) (+ (* 0.125 (/ (* (pow a 2) rand) (pow (sqrt -0.3333333333333333) 3))) (* 1.5 (/ (* (pow a 2) rand) (sqrt -0.3333333333333333))))))

prune571.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0b

localize22.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))
0.3b
(* (pow (- a (/ 1.0 3.0)) -1/2) rand)
0.1b
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))))
0.0b
(pow (- a (/ 1.0 3.0)) -1/2)

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

7.0ms
(* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))
7.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))))
3.0ms
(* (pow (- a (/ 1.0 3.0)) -1/2) rand)

series250.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

81.0ms
(* (pow (- a (/ 1.0 3.0)) -1/2) rand)
66.0ms
(* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))
56.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))))
48.0ms
(pow (- a (/ 1.0 3.0)) -1/2)

simplify5.8s

Counts
49 → 81
Calls

49 calls. Slowest were:

790.0ms
(* (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))) (- (* 1 1) (* (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand)) (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand)))))
426.0ms
(+ (* 0.16666666666666666 (/ (exp (* -1/2 (- (log -1) (log (/ -1 a))))) a)) (+ (exp (* -1/2 (- (log -1) (log (/ -1 a))))) (* 0.041666666666666664 (/ (exp (* -1/2 (- (log -1) (log (/ -1 a))))) (pow a 2)))))
382.0ms
(* (+ a (/ 1.0 3.0)) (- 1 (* (pow 9 -1/2) (* (pow (- a (/ 1.0 3.0)) -1/2) rand))))

prune785.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

regimes167.0ms

Accuracy

0% (0.1b remaining)

Error of 0.1b against oracle of 0.0b and baseline of 0.1b

bsearch5.0ms

end0.0ms

sample6.6s

Algorithm
intervals