Average Error: 0.2 → 0.2
Time: 51.3s
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(2 \cdot \left|x\right| + \left(\sqrt{\frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}} \cdot \sqrt{\frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}} + \frac{2}{3} \cdot {\left(\left|x\right|\right)}^{3}\right)\right) + \frac{1}{5} \cdot {\left(\left|x\right|\right)}^{5}\right) \cdot \sqrt{\frac{1}{\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. Taylor expanded around inf 0.2

    \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\pi}} \cdot \left(\frac{1}{5} \cdot {\left(\left|x\right|\right)}^{5} + \left(2 \cdot \left|x\right| + \left(\frac{2}{3} \cdot {\left(\left|x\right|\right)}^{3} + \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}\right)\right)\right)}\right|\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.2

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

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

Reproduce

herbie shell --seed 2019008 
(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: 50.6s)Debug log

sample238.0ms

Algorithm
intervals

simplify174.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

174.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.0b

localize67.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
0.2b
(* (/ 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
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))

rewrite1.3s

Algorithm
rewrite-expression-head
Counts
4 → 94
Calls

4 calls. Slowest were:

1.1s
(* (/ 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)))))
171.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
25.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))

series355.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

280.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)))))
37.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
37.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
0.0ms
(sqrt PI)

simplify18.5s

Counts
72 → 104
Calls

72 calls. Slowest were:

796.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))))))
785.0ms
(* (+ (* (+ (* 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)))))) 21)
701.0ms
(* (/ 1 (sqrt PI)) (* (/ 1 21) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))))

prune2.0s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0b

localize53.0ms

Local error

Found 4 expressions with local error:

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

rewrite56.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

49.0ms
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7))))))
2.0ms
(* 2/3 (pow (fabs x) 3))
2.0ms
(* 1/5 (pow (fabs x) 5))

series354.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

255.0ms
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7))))))
36.0ms
(* 1/5 (pow (fabs x) 5))
34.0ms
(* 1/21 (pow (fabs x) 7))
29.0ms
(* 2/3 (pow (fabs x) 3))

simplify4.0s

Counts
56 → 87
Calls

56 calls. Slowest were:

435.0ms
(* (* (* (sqrt (/ 1 PI)) (sqrt (/ 1 PI))) (sqrt (/ 1 PI))) (* (* (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7))))) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7)))))) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7)))))))
396.0ms
(- (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7)))))
353.0ms
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* 1/21 (pow (fabs x) 7))))))

prune1.5s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

localize39.0ms

Local error

Found 4 expressions with local error:

7.8b
(sqrt (* 1/21 (pow (fabs x) 7)))
7.8b
(sqrt (* 1/21 (pow (fabs x) 7)))
0.2b
(* 2/3 (pow (fabs x) 3))
0.1b
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7))))))))

rewrite56.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

48.0ms
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7))))))))
4.0ms
(* 2/3 (pow (fabs x) 3))
2.0ms
(sqrt (* 1/21 (pow (fabs x) 7)))

series463.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

286.0ms
(* (sqrt (/ 1 PI)) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7))))))))
79.0ms
(sqrt (* 1/21 (pow (fabs x) 7)))
70.0ms
(sqrt (* 1/21 (pow (fabs x) 7)))
27.0ms
(* 2/3 (pow (fabs x) 3))

simplify4.1s

Counts
46 → 77
Calls

46 calls. Slowest were:

469.0ms
(* (* (* (sqrt (/ 1 PI)) (sqrt (/ 1 PI))) (sqrt (/ 1 PI))) (* (* (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7))))))) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7)))))))) (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (sqrt (* 1/21 (pow (fabs x) 7))) (sqrt (* 1/21 (pow (fabs x) 7)))))))))
382.0ms
(* (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (pow (fabs x) 7) (pow (sqrt 1/21) 2))))) (sqrt (/ 1 PI)))
335.0ms
(* (+ (* 1/5 (pow (fabs x) 5)) (+ (* 2 (fabs x)) (+ (* 2/3 (pow (fabs x) 3)) (* (pow (fabs x) 7) (pow (sqrt 1/21) 2))))) (sqrt (/ 1 PI)))

prune1.7s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize73.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
0.3b
(* (fabs x) 1/21)
0.3b
(* (fabs x) 2/3)
0.1b
(* (* (/ 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))))

rewrite87.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

80.0ms
(* (* (/ 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))))
2.0ms
(* (fabs x) 1/21)
2.0ms
(* (fabs x) 2/3)

series324.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

296.0ms
(* (* (/ 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))))
14.0ms
(* (fabs x) 1/21)
13.0ms
(* (fabs x) 2/3)
0.0ms
(sqrt PI)

simplify8.4s

Counts
42 → 70
Calls

42 calls. Slowest were:

548.0ms
(* (* (* (* (/ 1 (sqrt PI)) 1) (* (/ 1 (sqrt PI)) 1)) (* (/ 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))) (+ (* (* (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)))) (+ (* (* (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)))))
533.0ms
(* (* 1 1) (- (* (* (* (fabs x) (pow (fabs x) 4)) (+ 1/5 (* (fabs x) (* (fabs x) 1/21)))) (* (* (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)) (+ (* (* (fabs x) 2/3) (* (fabs x) (fabs x))) (* (fabs x) 2)))))
525.0ms
(* (* 1 1) (+ (* (* (* (fabs x) (pow (fabs x) 4)) (- (* 1/5 1/5) (* (* (fabs x) (* (fabs x) 1/21)) (* (fabs x) (* (fabs x) 1/21))))) (+ (* (* (* (fabs x) 2/3) (* (fabs x) (fabs x))) (* (* (fabs x) 2/3) (* (fabs x) (fabs x)))) (- (* (* (fabs x) 2) (* (fabs x) 2)) (* (* (* (fabs x) 2/3) (* (fabs x) (fabs x))) (* (fabs x) 2))))) (* (- 1/5 (* (fabs x) (* (fabs x) 1/21))) (+ (pow (* (* (fabs x) 2/3) (* (fabs x) (fabs x))) 3) (pow (* (fabs x) 2) 3)))))

prune1.3s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

regimes124.0ms

Accuracy

0% (0.2b remaining)

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

bsearch6.0ms

end0.0ms

sample5.3s

Algorithm
intervals