Average Error: 0.2 → 0.2
Time: 1.2m
Precision: 64
Internal Precision: 128
\[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
\[\left|\left(\left(\left(\frac{1}{21} \cdot \left|x\right|\right) \cdot \left|x\right| + \frac{1}{5}\right) \cdot \left(\left|x\right| \cdot {\left(\left|x\right|\right)}^{4}\right) + \left(\left|x\right| \cdot 2 + \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left(\left|x\right| \cdot \frac{2}{3}\right)\right)\right) \cdot \frac{1}{\sqrt{\pi}}\right|\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.2

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \color{blue}{\left(1 \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right)}\right|\]
  4. Applied associate-*r*0.2

    \[\leadsto \left|\color{blue}{\left(\frac{1}{\sqrt{\pi}} \cdot 1\right) \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)}\right|\]
  5. Simplified0.2

    \[\leadsto \left|\left(\frac{1}{\sqrt{\pi}} \cdot 1\right) \cdot \color{blue}{\left(\left(\left|x\right| \cdot {\left(\left|x\right|\right)}^{4}\right) \cdot \left(\frac{1}{5} + \left|x\right| \cdot \left(\left|x\right| \cdot \frac{1}{21}\right)\right) + \left(\left(\left|x\right| \cdot \frac{2}{3}\right) \cdot \left(\left|x\right| \cdot \left|x\right|\right) + \left|x\right| \cdot 2\right)\right)}\right|\]
  6. Final simplification0.2

    \[\leadsto \left|\left(\left(\left(\frac{1}{21} \cdot \left|x\right|\right) \cdot \left|x\right| + \frac{1}{5}\right) \cdot \left(\left|x\right| \cdot {\left(\left|x\right|\right)}^{4}\right) + \left(\left|x\right| \cdot 2 + \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left(\left|x\right| \cdot \frac{2}{3}\right)\right)\right) \cdot \frac{1}{\sqrt{\pi}}\right|\]

Reproduce

herbie shell --seed 2019002 
(FPCore (x)
  :name "Jmat.Real.erfi, branch x less than or equal to 0.5"
  (fabs (* (/ 1 (sqrt PI)) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))

Details

Time bar (total: 1.2m)Debug log

sample290.0ms

Algorithm
intervals

simplify283.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

283.0ms
(fabs (* (/ 1 (sqrt PI)) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))

prune24.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize103.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
0.1b
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
0.1b
(* (/ 1 (sqrt PI)) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))
0.1b
(* (* (fabs x) (fabs x)) (fabs x))

rewrite1.4s

Algorithm
rewrite-expression-head
Counts
4 → 90
Calls

4 calls. Slowest were:

1.4s
(* (/ 1 (sqrt PI)) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))
41.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
16.0ms
(* (* (fabs x) (fabs x)) (fabs x))

series277.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

229.0ms
(* (/ 1 (sqrt PI)) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))
28.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
20.0ms
(* (* (fabs x) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

simplify13.9s

Counts
73 → 100
Calls

73 calls. Slowest were:

1.0s
(+ (* (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (- (* (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))
818.0ms
(* (* (* (/ 1 (sqrt PI)) (/ 1 (sqrt PI))) (/ 1 (sqrt PI))) (* (* (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))
810.0ms
(* 1 (+ (* (+ (pow (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) 3) (pow (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))) 3)) 21) (* (+ (* (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x))))) (- (* (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))) (* 1 (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))

prune2.0s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0b

localize44.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
1.0b
(sqrt PI)
0.4b
(* 1/21 (/ (fabs x) (sqrt PI)))
0.2b
(/ (fabs x) (sqrt PI))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

3.0ms
(/ (fabs x) (sqrt PI))
2.0ms
(* 1/21 (/ (fabs x) (sqrt PI)))
0.0ms
(sqrt PI)

series286.0ms

Counts
4 → 8
Calls

4 calls. Slowest were:

149.0ms
(* 1/21 (/ (fabs x) (sqrt PI)))
136.0ms
(/ (fabs x) (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify820.0ms

Counts
47 → 73
Calls

47 calls. Slowest were:

275.0ms
(/ (* (* (fabs x) (fabs x)) (fabs x)) (* (* (sqrt PI) (sqrt PI)) (sqrt PI)))
200.0ms
(fabs (+ (* (/ 1 (sqrt PI)) (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (* (* 1/21 (/ (fabs x) (sqrt PI))) (* (pow (fabs x) 3) (pow (fabs x) 3)))))
196.0ms
(fabs (+ (* (/ 1 (sqrt PI)) (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (* (* 1/21 (/ (fabs x) (sqrt PI))) (* (pow (fabs x) 3) (pow (fabs x) 3)))))

prune1.5s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize85.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
0.4b
(* (fabs x) 1/21)
0.3b
(* (fabs x) 2/3)
0.2b
(* (fabs x) (* (fabs x) 1/21))

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
4 → 45
Calls

4 calls. Slowest were:

13.0ms
(* (fabs x) (* (fabs x) 1/21))
5.0ms
(* (fabs x) 2/3)
5.0ms
(* (fabs x) 1/21)

series35.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

16.0ms
(* (fabs x) (* (fabs x) 1/21))
11.0ms
(* (fabs x) 1/21)
8.0ms
(* (fabs x) 2/3)
0.0ms
(sqrt PI)

simplify670.0ms

Counts
19 → 55
Calls

19 calls. Slowest were:

444.0ms
(* (* (* (fabs x) (fabs x)) (fabs x)) (* (* (* (fabs x) 1/21) (* (fabs x) 1/21)) (* (fabs x) 1/21)))
152.0ms
(fabs (* (* (/ 1 (sqrt PI)) 1) (+ (* (* (fabs x) (pow (fabs x) 4)) (+ 1/5 (* (fabs x) (* (fabs x) 1/21)))) (+ (* (* (fabs x) 2/3) (* (fabs x) (fabs x))) (* (fabs x) 2)))))
11.0ms
(* 1/21 (pow (fabs x) 2))

prune864.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

localize29.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
1.0b
(sqrt PI)
0.3b
(* (sqrt (/ 1 (sqrt PI))) (* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))
0.3b
(* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))

rewrite5.0s

Algorithm
rewrite-expression-head
Counts
4 → 105
Calls

4 calls. Slowest were:

3.8s
(* (sqrt (/ 1 (sqrt PI))) (* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))
1.2s
(* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))
0.0ms
(sqrt PI)

series885.0ms

Counts
4 → 8
Calls

4 calls. Slowest were:

618.0ms
(* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))
266.0ms
(* (sqrt (/ 1 (sqrt PI))) (* (sqrt (/ 1 (sqrt PI))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify31.6s

Counts
98 → 113
Calls

98 calls. Slowest were:

993.0ms
(* (* (sqrt (/ 1 (sqrt PI))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (sqrt (/ 1 (sqrt PI))))
962.0ms
(* (* (* (sqrt (/ 1 (sqrt PI))) (sqrt (/ 1 (sqrt PI)))) (sqrt (/ 1 (sqrt PI)))) (* (* (* (sqrt (/ 1 (sqrt PI))) (sqrt (/ 1 (sqrt PI)))) (sqrt (/ 1 (sqrt PI)))) (* (* (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (+ (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))
845.0ms
(* (sqrt (sqrt PI)) (+ (* (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))))) (- (* (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (+ (+ (* 2 (fabs x)) (* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))

prune3.1s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

regimes174.0ms

Accuracy

0% (0.1b remaining)

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

bsearch3.0ms

end0.0ms

sample5.6s

Algorithm
intervals