Average Error: 0.0 → 0.0
Time: 16.7s
Precision: 64
Internal Precision: 576
\[\Re(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]
\[\Re(\left(\frac{\left(\left(e^{\left(\left(-xre\right) + \left(-xim\right) i\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]

Error

Bits error versus xre

Bits error versus xim

Derivation

  1. Initial program 0.0

    \[\Re(\left(\frac{\left(\left(e^{\left(xre + xim i\right)}\right) + \left(e^{\left(-\left(xre + xim i\right)\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]
  2. Initial simplification0.0

    \[\leadsto \Re(\left(\frac{\left(\left(e^{\left(\left(-xre\right) + \left(-xim\right) i\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]
  3. Final simplification0.0

    \[\leadsto \Re(\left(\frac{\left(\left(e^{\left(\left(-xre\right) + \left(-xim\right) i\right)}\right) + \left(e^{\left(xre + xim i\right)}\right)\right)}{\left(2 + 0 i\right)}\right))\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (xre xim)
  :name "exp with complex power real part (p55)"
  (re (/.c (+.c (exp.c (complex xre xim)) (exp.c (neg.c (complex xre xim)))) (complex 2 0))))

Details

Time bar (total: 782.0ms)Debug log

start504.0ms

Algorithm
halfpoints

setup47.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize80.0ms

Local error

Found 4 expressions with local error:

18.9b
(+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim)))
0.0b
(exp.c (complex (- xre) (- xim)))
0.0b
(exp.c (complex xre xim))
0.0b
(/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 2
Calls

4 calls. Slowest were:

5.0ms
(+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim)))
5.0ms
(/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0))
0.0ms
(exp.c (complex (- xre) (- xim)))

series1.0ms

Counts
4 → 4
Calls

4 calls. Slowest were:

0.0ms
(+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim)))
0.0ms
(exp.c (complex (- xre) (- xim)))
0.0ms
(/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0))
0.0ms
(exp.c (complex xre xim))

simplify66.0ms

Counts
4 → 6
Calls

4 calls. Slowest were:

33.0ms
(re (/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0)))
11.0ms
(re (/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0)))
10.0ms
(re (/.c (+.c (exp.c (complex (- xre) (- xim))) (exp.c (complex xre xim))) (complex 2 0)))

prune71.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b