Average Error: 1.5 → 0.6
Time: 1.1m
Precision: 64
Internal Precision: 128
\[\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)\]
\[(\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{(e^{\log_* (1 + \sqrt{\pi})} - 1)^*}\right) \cdot \left((\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{3}{4}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{\left|x\right|} \cdot \frac{1}{2}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left({\left(\left|x\right|\right)}^{-4} \cdot \frac{1}{{\left(\left|x\right|\right)}^{3}}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*\]

Error

Bits error versus x

Derivation

  1. Initial program 1.5

    \[\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)\]
  2. Simplified1.1

    \[\leadsto \color{blue}{(\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{\sqrt{\pi}}\right) \cdot \left((\left(\left(\frac{3}{4} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{2} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot {\left(\frac{1}{\left|x\right|}\right)}^{4}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*}\]
  3. Using strategy rm
  4. Applied inv-pow1.1

    \[\leadsto (\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{\sqrt{\pi}}\right) \cdot \left((\left(\left(\frac{3}{4} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{2} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot {\color{blue}{\left({\left(\left|x\right|\right)}^{-1}\right)}}^{4}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*\]
  5. Applied pow-pow0.6

    \[\leadsto (\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{\sqrt{\pi}}\right) \cdot \left((\left(\left(\frac{3}{4} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{2} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot \color{blue}{{\left(\left|x\right|\right)}^{\left(-1 \cdot 4\right)}}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*\]
  6. Using strategy rm
  7. Applied expm1-log1p-u0.6

    \[\leadsto (\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{\color{blue}{(e^{\log_* (1 + \sqrt{\pi})} - 1)^*}}\right) \cdot \left((\left(\left(\frac{3}{4} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{2} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot {\left(\left|x\right|\right)}^{\left(-1 \cdot 4\right)}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*\]
  8. Final simplification0.6

    \[\leadsto (\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{(e^{\log_* (1 + \sqrt{\pi})} - 1)^*}\right) \cdot \left((\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{3}{4}\right)\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left((\left(\frac{1}{\left|x\right|} \cdot \frac{1}{2}\right) \cdot \left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) + \left(\frac{1}{\left|x\right|}\right))_*\right))_*\right) + \left(\left({\left(\left|x\right|\right)}^{-4} \cdot \frac{1}{{\left(\left|x\right|\right)}^{3}}\right) \cdot \left(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right)\right))_*\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x)
  :name "Jmat.Real.erfi, branch x greater than or equal to 5"
  (* (* (/ 1 (sqrt PI)) (exp (* (fabs x) (fabs x)))) (+ (+ (+ (/ 1 (fabs x)) (* (/ 1 2) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))) (* (/ 3 4) (* (* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))))) (* (/ 15 8) (* (* (* (* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x)))))))

Details

Time bar (total: 1.1m)Debug log

sample3.2s

Algorithm
intervals

simplify666.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

665.0ms
(* (* (/ 1 (sqrt PI)) (exp (* (fabs x) (fabs x)))) (+ (+ (+ (/ 1 (fabs x)) (* (/ 1 2) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))) (* (/ 3 4) (* (* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))))) (* (/ 15 8) (* (* (* (* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))) (/ 1 (fabs x))))))

prune34.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.0b

localize82.0ms

Local error

Found 4 expressions with local error:

1.0b
(pow (/ 1 (fabs x)) 4)
1.0b
(sqrt PI)
1.0b
(sqrt PI)
0.6b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

9.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
3.0ms
(pow (/ 1 (fabs x)) 4)
0.0ms
(sqrt PI)

series51.0ms

Counts
4 → 8
Calls

4 calls. Slowest were:

33.0ms
(pow (/ 1 (fabs x)) 4)
17.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify702.0ms

Counts
48 → 84
Calls

48 calls. Slowest were:

219.0ms
(fma (/ (exp (* (fabs x) (fabs x))) (sqrt PI)) (fma (* (* 3/4 (/ 1 (fabs x))) (* (/ 1 (fabs x)) (/ 1 (fabs x)))) (* (/ 1 (fabs x)) (/ 1 (fabs x))) (fma (* 1/2 (/ 1 (fabs x))) (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x)))) (* (* (/ 1 (pow (fabs x) 3)) (pow (/ 1 (fabs x)) 4)) (* (exp (* (fabs x) (fabs x))) (* (/ 1 (sqrt PI)) 15/8))))
166.0ms
(fma (/ (exp (* (fabs x) (fabs x))) (sqrt PI)) (fma (* (* 3/4 (/ 1 (fabs x))) (* (/ 1 (fabs x)) (/ 1 (fabs x)))) (* (/ 1 (fabs x)) (/ 1 (fabs x))) (fma (* 1/2 (/ 1 (fabs x))) (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x)))) (* (* (/ 1 (pow (fabs x) 3)) (pow (/ 1 (fabs x)) 4)) (* (exp (* (fabs x) (fabs x))) (* (/ 1 (sqrt PI)) 15/8))))
148.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))

prune1.9s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.2b

localize23.0ms

Local error

Found 4 expressions with local error:

1.0b
(sqrt PI)
1.0b
(sqrt PI)
0.6b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.6b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 94
Calls

4 calls. Slowest were:

5.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
4.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)

series36.0ms

Counts
4 → 8
Calls

4 calls. Slowest were:

22.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
14.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify593.0ms

Counts
70 → 102
Calls

70 calls. Slowest were:

197.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
119.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
22.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))

prune2.5s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.1b

localize20.0ms

Local error

Found 4 expressions with local error:

1.0b
(expm1 (log1p (sqrt PI)))
1.0b
(sqrt PI)
1.0b
(sqrt PI)
0.6b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

5.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(expm1 (log1p (sqrt PI)))
0.0ms
(sqrt PI)

series18.0ms

Counts
4 → 6
Calls

4 calls. Slowest were:

18.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(expm1 (log1p (sqrt PI)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify325.0ms

Counts
34 → 74
Calls

34 calls. Slowest were:

166.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
36.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))
20.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))

prune1.9s

Pruning

12 alts after pruning (11 fresh and 1 done)

Merged error: 0.1b

localize21.0ms

Local error

Found 4 expressions with local error:

1.0b
(expm1 (log1p (* (sqrt (sqrt PI)) (sqrt (sqrt PI)))))
1.0b
(sqrt PI)
1.0b
(sqrt PI)
1.0b
(sqrt PI)

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
4 → 41
Calls

4 calls. Slowest were:

0.0ms
(expm1 (log1p (* (sqrt (sqrt PI)) (sqrt (sqrt PI)))))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series0.0ms

Counts
4 → 4
Calls

4 calls. Slowest were:

0.0ms
(expm1 (log1p (* (sqrt (sqrt PI)) (sqrt (sqrt PI)))))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify3.0ms

Counts
1 → 45
Calls

1 calls. Slowest were:

1.0ms
(sqrt (sqrt PI))

prune1.1s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.1b

regimes333.0ms

Accuracy

0% (0.4b remaining)

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

bsearch5.0ms

end0.0ms

sample51.6s

Algorithm
intervals