Average Error: 0.0 → 0.0
Time: 9.8s
Precision: 64
Internal Precision: 128
\[e^{-\left(1 - x \cdot x\right)}\]
\[(e^{\log_* (1 + e^{(x \cdot x + -1)_*})} - 1)^*\]

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Initial simplification0.0

    \[\leadsto e^{(x \cdot x + -1)_*}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.0

    \[\leadsto \color{blue}{(e^{\log_* (1 + e^{(x \cdot x + -1)_*})} - 1)^*}\]
  5. Final simplification0.0

    \[\leadsto (e^{\log_* (1 + e^{(x \cdot x + -1)_*})} - 1)^*\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  (exp (- (- 1 (* x x)))))

Details

Time bar (total: 7.8s)Debug log

start61.0ms

Algorithm
intervals

setup96.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 1 expressions with local error:

0.0b
(exp (fma x x -1))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 14
Calls

1 calls. Slowest were:

1.0ms
(exp (fma x x -1))

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

19.0ms
(exp (fma x x -1))

simplify221.0ms

Counts
8 → 17
Calls

8 calls. Slowest were:

180.0ms
(+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/2 (* (pow x 4) (exp -1)))))
26.0ms
(exp (* (cbrt (fma x x -1)) (cbrt (fma x x -1))))
4.0ms
(exp (sqrt (fma x x -1)))

prune155.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 3 expressions with local error:

1.0b
(expm1 (log1p (exp (fma x x -1))))
1.0b
(log1p (exp (fma x x -1)))
0.0b
(exp (fma x x -1))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
3 → 36
Calls

3 calls. Slowest were:

1.0ms
(exp (fma x x -1))
0.0ms
(log1p (exp (fma x x -1)))
0.0ms
(expm1 (log1p (exp (fma x x -1))))

series361.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

192.0ms
(expm1 (log1p (exp (fma x x -1))))
142.0ms
(log1p (exp (fma x x -1)))
27.0ms
(exp (fma x x -1))

simplify970.0ms

Counts
16 → 45
Calls

16 calls. Slowest were:

427.0ms
(- (+ (* 1/2 (/ (* (pow x 4) (exp -1)) (+ (exp -1) 1))) (+ (/ (* (pow x 2) (exp -1)) (+ (exp -1) 1)) (log (+ (exp -1) 1)))) (* 1/2 (/ (* (pow x 4) (pow (exp -1) 2)) (pow (+ (exp -1) 1) 2))))
232.0ms
(+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/2 (* (pow x 4) (exp -1)))))
156.0ms
(+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/2 (* (pow x 4) (exp -1)))))

prune603.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 1 expressions with local error:

0.0b
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 27
Calls

1 calls. Slowest were:

6.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))

series97.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

97.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))

simplify460.0ms

Counts
20 → 30
Calls

20 calls. Slowest were:

166.0ms
(- (+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/4 (* (pow x 4) (exp -1))))) (* 1/4 (/ (* (pow x 4) (exp -1)) (pow (sqrt -1) 2))))
73.0ms
(exp (* (cbrt (sqrt (fma x x -1))) (cbrt (sqrt (fma x x -1)))))
45.0ms
(pow (* (cbrt (exp (sqrt (fma x x -1)))) (cbrt (exp (sqrt (fma x x -1))))) (sqrt (fma x x -1)))

prune243.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 4 expressions with local error:

0.0b
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
0.0b
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
0.0b
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
0.0b
(* (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1))))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))))

rewrite58.0ms

Algorithm
rewrite-expression-head
Counts
4 → 116
Calls

4 calls. Slowest were:

36.0ms
(* (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1))))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))))
7.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
7.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))

series391.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

106.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
99.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
98.0ms
(pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))
87.0ms
(* (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1))))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))))

simplify2.7s

Counts
92 → 128
Calls

92 calls. Slowest were:

201.0ms
(* (* (* (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1))))) (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))))) (* (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))) (cbrt (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1)))))) (pow (exp (sqrt (fma x x -1))) (sqrt (fma x x -1))))
188.0ms
(- (+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/4 (* (pow x 4) (exp -1))))) (* 1/4 (/ (* (pow x 4) (exp -1)) (pow (sqrt -1) 2))))
157.0ms
(- (+ (exp -1) (+ (* (pow x 2) (exp -1)) (* 1/4 (* (pow x 4) (exp -1))))) (* 1/4 (/ (* (pow x 4) (exp -1)) (pow (sqrt -1) 2))))

prune1.2s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0.0b

regimes28.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms