Average Error: 0.1 → 0.1
Time: 32.4s
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(a - \frac{1.0}{3.0}\right) \cdot {\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{-1}{2}}\right) \cdot rand\]

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-lft-in0.1

    \[\leadsto \color{blue}{\left(a - \frac{1.0}{3.0}\right) \cdot 1 + \left(a - \frac{1.0}{3.0}\right) \cdot \left({\left(9 \cdot \left(a - \frac{1.0}{3.0}\right)\right)}^{\frac{-1}{2}} \cdot rand\right)}\]
  8. Using strategy rm
  9. Applied associate-*r*0.1

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

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

Reproduce

herbie shell --seed 2019002 +o rules:numerics
(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: 31.7s)Debug log

sample293.0ms

Algorithm
intervals

simplify226.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.1b

localize44.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)))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 81
Calls

4 calls. Slowest were:

8.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))
7.0ms
(* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)
4.0ms
(sqrt (* 9 (- a (/ 1.0 3.0))))

series210.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

76.0ms
(* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)
51.0ms
(/ 1 (sqrt (* 9 (- a (/ 1.0 3.0)))))
46.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))
37.0ms
(sqrt (* 9 (- a (/ 1.0 3.0))))

simplify7.9s

Counts
50 → 93
Calls

50 calls. Slowest were:

693.0ms
(* (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand)))
679.0ms
(/ 1 (sqrt (* 9 (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))))))
501.0ms
(+ (* 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))))

prune917.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize15.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)))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

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

series163.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

66.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
43.0ms
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
36.0ms
(* (- a (/ 1.0 3.0)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
17.0ms
(* 9 (- a (/ 1.0 3.0)))

simplify5.3s

Counts
49 → 87
Calls

49 calls. Slowest were:

758.0ms
(* (- (* a a) (* (/ 1.0 3.0) (/ 1.0 3.0))) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
408.0ms
(+ (* 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))))
385.0ms
(* (- (pow a 3) (pow (/ 1.0 3.0) 3)) (+ 1 (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))

prune980.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 4 expressions with local error:

6.6b
(* (- a (/ 1.0 3.0)) (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand))
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)))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series269.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

105.0ms
(* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)
68.0ms
(* (- a (/ 1.0 3.0)) (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand))
68.0ms
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
28.0ms
(* 9 (- a (/ 1.0 3.0)))

simplify3.0s

Counts
34 → 77
Calls

34 calls. Slowest were:

603.0ms
(* (* (* (- a (/ 1.0 3.0)) (- a (/ 1.0 3.0))) (- a (/ 1.0 3.0))) (* (* (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand) (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)) (* (pow (* 9 (- a (/ 1.0 3.0))) -1/2) rand)))
290.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))))
281.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))))))

prune736.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize8.0ms

Local error

Found 4 expressions with local error:

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

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

12.0ms
(* (* (- a (/ 1.0 3.0)) (pow (* 9 (- a (/ 1.0 3.0))) -1/2)) rand)
6.0ms
(* (- a (/ 1.0 3.0)) (pow (* 9 (- a (/ 1.0 3.0))) -1/2))
3.0ms
(* 9 (- a (/ 1.0 3.0)))

series186.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

74.0ms
(pow (* 9 (- a (/ 1.0 3.0))) -1/2)
59.0ms
(* (* (- a (/ 1.0 3.0)) (pow (* 9 (- a (/ 1.0 3.0))) -1/2)) rand)
29.0ms
(* 9 (- a (/ 1.0 3.0)))
25.0ms
(* (- a (/ 1.0 3.0)) (pow (* 9 (- a (/ 1.0 3.0))) -1/2))

simplify3.4s

Counts
39 → 80
Calls

39 calls. Slowest were:

462.0ms
(* (- (pow a 3) (pow (/ 1.0 3.0) 3)) (pow (* 9 (- a (/ 1.0 3.0))) -1/2))
375.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))))
322.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))))

prune767.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

regimes137.0ms

Accuracy

0% (0.1b remaining)

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

bsearch5.0ms

end0.0ms

sample7.1s

Algorithm
intervals