Average Error: 0.2 → 0.1
Time: 32.9s
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(\frac{1}{\sqrt{\pi}}\right) \cdot \left((\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left((\left(\frac{1}{5} \cdot \left|x\right|\right) \cdot \left(\left|x\right| \cdot \left|x\right|\right) + \left(\frac{2}{3} \cdot \left|x\right|\right))_*\right) + \left(2 \cdot \left|x\right|\right))_*\right) + \left(\left|x\right| \cdot \left(\frac{\frac{1}{21}}{\sqrt{\pi}} \cdot {\left(\left|x\right|\right)}^{6}\right)\right))_*\right|\]

Error

Bits error versus x

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 pow10.2

    \[\leadsto \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 \color{blue}{{\left(\left|x\right|\right)}^{1}}\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  4. Applied pow10.2

    \[\leadsto \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 \color{blue}{{\left(\left|x\right|\right)}^{1}}\right) \cdot {\left(\left|x\right|\right)}^{1}\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  5. Applied pow10.2

    \[\leadsto \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(\color{blue}{{\left(\left|x\right|\right)}^{1}} \cdot {\left(\left|x\right|\right)}^{1}\right) \cdot {\left(\left|x\right|\right)}^{1}\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  6. Applied pow-prod-up0.2

    \[\leadsto \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(\color{blue}{{\left(\left|x\right|\right)}^{\left(1 + 1\right)}} \cdot {\left(\left|x\right|\right)}^{1}\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  7. Applied pow-prod-up0.2

    \[\leadsto \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(\color{blue}{{\left(\left|x\right|\right)}^{\left(\left(1 + 1\right) + 1\right)}} \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  8. Simplified0.2

    \[\leadsto \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|x\right|\right)}^{\color{blue}{3}} \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|\]
  9. Simplified0.2

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

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

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

Reproduce

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

sample231.0ms

Algorithm
intervals

simplify733.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune31.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize86.0ms

Local error

Found 4 expressions with local error:

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

rewrite235.0ms

Algorithm
rewrite-expression-head
Counts
4 → 93
Calls

4 calls. Slowest were:

191.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
27.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
14.0ms
(* (* (fabs x) (fabs x)) (fabs x))

series104.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

46.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
36.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
23.0ms
(* (* (fabs x) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

simplify8.6s

Counts
62 → 103
Calls

62 calls. Slowest were:

646.0ms
(* (* (* (/ 2 3) (/ 2 3)) (/ 2 3)) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))))
591.0ms
(* (* (* (/ 1 5) (/ 1 5)) (/ 1 5)) (* (* (* (* (* (* (fabs x) (fabs x)) (* (fabs x) (fabs x))) (* (fabs x) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))))
579.0ms
(* (* (* (/ 2 3) (/ 2 3)) (/ 2 3)) (* (* (* (* (fabs x) (fabs x)) (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: 0.1b

localize29.0ms

Local error

Found 4 expressions with local error:

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

rewrite230.0ms

Algorithm
rewrite-expression-head
Counts
4 → 93
Calls

4 calls. Slowest were:

174.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
30.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
22.0ms
(* (* (fabs x) (fabs x)) (fabs x))

series101.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

49.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
36.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
16.0ms
(* (* (fabs x) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

simplify8.6s

Counts
62 → 103
Calls

62 calls. Slowest were:

540.0ms
(* (* (* (/ 1 5) (/ 1 5)) (/ 1 5)) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))))
537.0ms
(* (* (* (/ 2 3) (/ 2 3)) (/ 2 3)) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))))
536.0ms
(* (* (* (/ 1 5) (/ 1 5)) (/ 1 5)) (* (* (* (* (* (* (fabs x) (fabs x)) (* (fabs x) (fabs x))) (* (fabs x) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))) (* (* (fabs x) (fabs x)) (fabs x))))

prune2.1s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize44.0ms

Local error

Found 4 expressions with local error:

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

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

1.0ms
(* 1/5 (fabs x))
1.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)

series12.0ms

Counts
4 → 6
Calls

4 calls. Slowest were:

12.0ms
(* 1/5 (fabs x))
0.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify373.0ms

Counts
12 → 54
Calls

12 calls. Slowest were:

141.0ms
(fabs (fma (fma (* (* 1/5 (fabs x)) (* (fabs x) (fabs x))) (* (fabs x) (fabs x)) (fma (* 2/3 (fabs x)) (* (fabs x) (fabs x)) (* (fabs x) 2))) (/ 1 (sqrt PI)) (* (* (pow (fabs x) 5) (* (fabs x) (fabs x))) (/ 1/21 (sqrt PI)))))
120.0ms
(fabs (fma (fma (* (* 1/5 (fabs x)) (* (fabs x) (fabs x))) (* (fabs x) (fabs x)) (fma (* 2/3 (fabs x)) (* (fabs x) (fabs x)) (* (fabs x) 2))) (/ 1 (sqrt PI)) (* (* (pow (fabs x) 5) (* (fabs x) (fabs x))) (/ 1/21 (sqrt PI)))))
93.0ms
(fabs (fma (fma (* (* 1/5 (fabs x)) (* (fabs x) (fabs x))) (* (fabs x) (fabs x)) (fma (* 2/3 (fabs x)) (* (fabs x) (fabs x)) (* (fabs x) 2))) (/ 1 (sqrt PI)) (* (* (pow (fabs x) 5) (* (fabs x) (fabs x))) (/ 1/21 (sqrt PI)))))

prune979.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

localize26.0ms

Local error

Found 4 expressions with local error:

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

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

1.0ms
(* 1/5 (fabs x))
1.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)

series9.0ms

Counts
4 → 6
Calls

4 calls. Slowest were:

9.0ms
(* 1/5 (fabs x))
0.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify554.0ms

Counts
12 → 54
Calls

12 calls. Slowest were:

190.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* 1/5 (fabs x)) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* (fabs x) 2)) (* (* (/ 1/21 (sqrt PI)) (pow (fabs x) 6)) (fabs x))))
184.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* 1/5 (fabs x)) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* (fabs x) 2)) (* (* (/ 1/21 (sqrt PI)) (pow (fabs x) 6)) (fabs x))))
168.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* 1/5 (fabs x)) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* (fabs x) 2)) (* (* (/ 1/21 (sqrt PI)) (pow (fabs x) 6)) (fabs x))))

prune1.5s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

regimes99.0ms

Accuracy

0% (0.1b remaining)

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

bsearch3.0ms

end0.0ms

sample5.3s

Algorithm
intervals