Average Error: 1.5 → 0.7
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|}}{\sqrt{\pi}}\right) \cdot \left((\left(\left(\frac{1}{\left|x\right|} \cdot \frac{3}{4}\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}{\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(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right) \cdot \left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot {\left(\left|x\right|\right)}^{-4}\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.7

    \[\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. Final simplification0.7

    \[\leadsto (\left(\frac{e^{\left|x\right| \cdot \left|x\right|}}{\sqrt{\pi}}\right) \cdot \left((\left(\left(\frac{1}{\left|x\right|} \cdot \frac{3}{4}\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}{\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(e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\frac{1}{\sqrt{\pi}} \cdot \frac{15}{8}\right)\right) \cdot \left(\frac{1}{{\left(\left|x\right|\right)}^{3}} \cdot {\left(\left|x\right|\right)}^{-4}\right)\right))_*\]

Reproduce

herbie shell --seed 2019016 +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.0s

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

simplify650.0ms

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

prune28.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.9b

localize97.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
17×pow1
14×add-exp-log
inv-pow
pow-flip
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-cbrt-cube
pow-prod-up
rec-exp
add-log-exp
log1p-expm1-u
prod-exp
associate-*l*
associate-*r*
unpow-prod-down
expm1-log1p-u
div-inv
pow-prod-down
pow-pow
pow-exp
pow1/2
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
associate-*l/
pow-plus
pow-to-exp
frac-times
pow2
Counts
4 → 76
Calls
4 calls:
Slowest
8.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
2.0ms
(pow (/ 1 (fabs x)) 4)
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series66.0ms

Counts
4 → 8
Calls
4 calls:
Slowest
45.0ms
(pow (/ 1 (fabs x)) 4)
20.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify667.0ms

Counts
48 → 84
Calls
48 calls:
Slowest
155.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))))
153.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))))
143.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
42.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))
38.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))

prune2.1s

Pruning

11 alts after pruning (11 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.5b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.5b
(* (/ 1 (fabs x)) (/ 1 (fabs x)))

rewrite17.0ms

Algorithm
rewrite-expression-head
Rules
26×pow1
20×add-exp-log
12×inv-pow
12×pow-flip
10×pow-prod-up
add-cube-cbrt
prod-exp
associate-*l*
associate-*r*
add-cbrt-cube
*-un-lft-identity
rec-exp
add-sqr-sqrt
pow-prod-down
add-log-exp
div-inv
log1p-expm1-u
expm1-log1p-u
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
associate-*l/
pow1/2
pow-plus
frac-times
pow2
Counts
4 → 94
Calls
4 calls:
Slowest
9.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
6.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series48.0ms

Counts
4 → 8
Calls
4 calls:
Slowest
24.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
24.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify706.0ms

Counts
70 → 102
Calls
70 calls:
Slowest
196.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
189.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
38.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))
26.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))
26.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))

prune2.5s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.2b

localize33.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
26×pow1
20×add-exp-log
12×inv-pow
12×pow-flip
10×pow-prod-up
add-cube-cbrt
prod-exp
associate-*l*
associate-*r*
add-cbrt-cube
*-un-lft-identity
rec-exp
add-sqr-sqrt
pow-prod-down
add-log-exp
div-inv
log1p-expm1-u
expm1-log1p-u
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
associate-*l/
pow1/2
pow-plus
frac-times
pow2
Counts
4 → 94
Calls
4 calls:
Slowest
5.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
5.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

series47.0ms

Counts
4 → 8
Calls
4 calls:
Slowest
24.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
22.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)

simplify605.0ms

Counts
70 → 102
Calls
70 calls:
Slowest
147.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
144.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))))
36.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))
35.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))

prune2.5s

Pruning

11 alts after pruning (9 fresh and 2 done)

Merged error: 0.2b

localize57.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
15×pow1
12×add-exp-log
inv-pow
pow-flip
add-cube-cbrt
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
pow-prod-up
add-log-exp
log1p-expm1-u
prod-exp
associate-*l*
associate-*r*
rec-exp
expm1-log1p-u
pow-prod-down
div-inv
pow1/2
expm1-udef
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
associate-*l/
pow-plus
expm1-log1p
frac-times
pow2
Counts
4 → 68
Calls
4 calls:
Slowest
10.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
0.0ms
(sqrt PI)
0.0ms
(sqrt PI)
0.0ms
(expm1 (log1p (sqrt PI)))

series14.0ms

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

simplify339.0ms

Counts
34 → 74
Calls
34 calls:
Slowest
159.0ms
(* (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))) (* (* (/ 1 (fabs x)) (/ 1 (fabs x))) (/ 1 (fabs x))))
32.0ms
(+ (- (log (fabs x))) (log (/ 1 (fabs x))))
30.0ms
(+ (log (/ 1 (fabs x))) (log (/ 1 (fabs x))))
21.0ms
(* (/ 1 (fabs x)) (/ 1 (fabs x)))
8.0ms
(/ 1 (pow (fabs x) 2))

prune1.9s

Pruning

13 alts after pruning (10 fresh and 3 done)

Merged error: 0.2b

regimes573.0ms

Accuracy

0% (0.5b remaining)

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

bsearch8.0ms

end0.0ms

sample50.3s

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