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

    \[\leadsto \color{blue}{\left|(\left(\frac{1}{\sqrt{\pi}}\right) \cdot \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) + \left(\left(\frac{\frac{1}{21}}{\sqrt{\pi}} \cdot \left|x\right|\right) \cdot {\left(\left|x\right| \cdot \left|x\right|\right)}^{3}\right))_*\right|}\]
  3. 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(\left|x\right| \cdot \frac{1}{5}\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(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \frac{\frac{1}{21}}{\sqrt{\pi}}\right) \cdot {\left(\left|x\right|\right)}^{5}\right))_*\right|}\]
  4. Simplified0.2

    \[\leadsto \color{blue}{\left|(\left(\frac{1}{\sqrt{\pi}}\right) \cdot \left((\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) \cdot \left(\left|x\right| \cdot \left|x\right|\right) + \left(\left|x\right| \cdot 2\right))_*\right) + \left(\left({\left(\left|x\right|\right)}^{6} \cdot \left|x\right|\right) \cdot \frac{\frac{1}{21}}{\sqrt{\pi}}\right))_*\right|}\]
  5. Final simplification0.2

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

Reproduce

herbie shell --seed 2019016 +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: 33.5s)Debug log

sample204.0ms

Algorithm
intervals
Results
470×(pre true 80)
470×(body real 80)

simplify402.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
402.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))))))

prune42.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize109.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 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
0.1b
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))

rewrite350.0ms

Algorithm
rewrite-expression-head
Rules
67×pow1
42×add-exp-log
42×add-cbrt-cube
27×cbrt-unprod
27×prod-exp
27×pow-prod-down
17×pow-prod-up
17×pow-plus
associate-*l*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-*r*
add-log-exp
log1p-expm1-u
expm1-log1p-u
pow2
*-commutative
div-inv
associate-*l/
pow3
pow1/2
Counts
4 → 103
Calls
4 calls:
Slowest
248.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
52.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
46.0ms
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

series105.0ms

Counts
4 → 10
Calls
4 calls:
Slowest
48.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
35.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
21.0ms
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

simplify9.3s

Counts
76 → 113
Calls
76 calls:
Slowest
675.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))))
608.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
(* (* (* (/ 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))))
555.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))))
539.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

localize49.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 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
0.1b
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))

rewrite273.0ms

Algorithm
rewrite-expression-head
Rules
67×pow1
42×add-exp-log
42×add-cbrt-cube
27×cbrt-unprod
27×prod-exp
27×pow-prod-down
17×pow-prod-up
17×pow-plus
associate-*l*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-*r*
add-log-exp
log1p-expm1-u
expm1-log1p-u
pow2
*-commutative
div-inv
associate-*l/
pow3
pow1/2
Counts
4 → 103
Calls
4 calls:
Slowest
196.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
48.0ms
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))
25.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
0.0ms
(sqrt PI)

series106.0ms

Counts
4 → 10
Calls
4 calls:
Slowest
46.0ms
(* (/ 1 5) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
36.0ms
(* (/ 2 3) (* (* (fabs x) (fabs x)) (fabs x)))
24.0ms
(* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x))
0.0ms
(sqrt PI)

simplify8.6s

Counts
76 → 113
Calls
76 calls:
Slowest
576.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))))
564.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))))
559.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))))
556.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))))
546.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.4s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

localize79.0ms

Local error

Found 4 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
associate-*r*
associate-/r*
pow1/2
div-inv
*-commutative
frac-2neg
clear-num
Counts
4 → 48
Calls
4 calls:
Slowest
2.0ms
(* 1/5 (fabs x))
1.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series14.0ms

Counts
4 → 6
Calls
4 calls:
Slowest
14.0ms
(* 1/5 (fabs x))
0.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify906.0ms

Counts
12 → 54
Calls
12 calls:
Slowest
357.0ms
(fabs (fma (/ 1 (sqrt PI)) (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/21 (sqrt PI)) (fabs x)) (pow (* (fabs x) (fabs x)) 3))))
279.0ms
(fabs (fma (/ 1 (sqrt PI)) (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/21 (sqrt PI)) (fabs x)) (pow (* (fabs x) (fabs x)) 3))))
258.0ms
(fabs (fma (/ 1 (sqrt PI)) (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/21 (sqrt PI)) (fabs x)) (pow (* (fabs x) (fabs x)) 3))))
2.0ms
(* 1/5 (fabs x))
2.0ms
(* 1/5 (fabs x))

prune1.1s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.1b

localize31.0ms

Local error

Found 4 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
associate-*l*
associate-/r*
pow1/2
div-inv
*-commutative
frac-2neg
clear-num
Counts
4 → 48
Calls
4 calls:
Slowest
3.0ms
(* (fabs x) 1/5)
0.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series9.0ms

Counts
4 → 6
Calls
4 calls:
Slowest
8.0ms
(* (fabs x) 1/5)
0.0ms
(sqrt PI)
0.0ms
(/ 1/21 (sqrt PI))
0.0ms
(sqrt PI)

simplify709.0ms

Counts
11 → 54
Calls
11 calls:
Slowest
251.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* (fabs x) 1/5) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* 2 (fabs x))) (* (* (* (fabs x) (fabs x)) (/ 1/21 (sqrt PI))) (pow (fabs x) 5))))
240.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* (fabs x) 1/5) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* 2 (fabs x))) (* (* (* (fabs x) (fabs x)) (/ 1/21 (sqrt PI))) (pow (fabs x) 5))))
206.0ms
(fabs (fma (/ 1 (sqrt PI)) (fma (* (fabs x) (fabs x)) (fma (* (fabs x) 1/5) (* (fabs x) (fabs x)) (* 2/3 (fabs x))) (* 2 (fabs x))) (* (* (* (fabs x) (fabs x)) (/ 1/21 (sqrt PI))) (pow (fabs x) 5))))
2.0ms
(* 1/5 (fabs x))
1.0ms
(* 1/5 (fabs x))

prune1.0s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.1b

regimes110.0ms

Accuracy

0% (0.1b remaining)

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

bsearch3.0ms

end0.0ms

sample5.5s

Algorithm
intervals
Results
14038×(pre true 80)
14038×(body real 80)