Average Error: 43.6 → 31.1
Time: 46.2s
Precision: 64
Internal Precision: 1344
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
\[x \cdot y\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.6

    \[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
  2. Initial simplification43.7

    \[\leadsto \frac{e^{x} \cdot \sin y - \frac{\sin y}{e^{x}}}{2}\]
  3. Taylor expanded around 0 31.1

    \[\leadsto \color{blue}{x \cdot y}\]
  4. Final simplification31.1

    \[\leadsto x \cdot y\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (x y)
  :name "Euler formula imaginary part (p55)"
  (im (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y)))))

Details

Time bar (total: 31.1s)Debug log

start315.0ms

Algorithm
halfpoints

setup147.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 44.5b

localize64.0ms

Local error

Found 4 expressions with local error:

44.5b
(- (* (exp x) (sin y)) (/ (sin y) (exp x)))
0.0b
(* (exp x) (sin y))
0.0b
(/ (- (* (exp x) (sin y)) (/ (sin y) (exp x))) 2)
0.0b
(/ (sin y) (exp x))

rewrite33.0ms

Algorithm
rewrite-expression-head
Counts
4 → 94
Calls

4 calls. Slowest were:

15.0ms
(/ (- (* (exp x) (sin y)) (/ (sin y) (exp x))) 2)
7.0ms
(- (* (exp x) (sin y)) (/ (sin y) (exp x)))
6.0ms
(/ (sin y) (exp x))

series300.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(/ (- (* (exp x) (sin y)) (/ (sin y) (exp x))) 2)
98.0ms
(- (* (exp x) (sin y)) (/ (sin y) (exp x)))
45.0ms
(/ (sin y) (exp x))
43.0ms
(* (exp x) (sin y))

simplify5.2s

Counts
78 → 106
Calls

78 calls. Slowest were:

484.0ms
(fma (exp x) (sin y) (- (* (/ (cbrt (sin y)) (cbrt (exp x))) (/ (* (cbrt (sin y)) (cbrt (sin y))) (* (cbrt (exp x)) (cbrt (exp x)))))))
366.0ms
(- (pow (* (exp x) (sin y)) 3) (pow (/ (sin y) (exp x)) 3))
321.0ms
(+ (* x y) (+ (* 1/2 (* (pow x 2) y)) y))

prune1.1s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 27.0b

localize5.0ms

Local error

Found 0 expressions with local error:

rewrite0.0ms

Algorithm
rewrite-expression-head
Counts
0 → 0
Calls

0 calls. Slowest were:

series0.0ms

Counts
0 → 0
Calls

0 calls. Slowest were:

simplify0.0ms

Counts
0 → 0
Calls

0 calls. Slowest were:

prune94.0ms

Pruning

15 alts after pruning (14 fresh and 1 done)

Merged error: 27.0b

localize26.0ms

Local error

Found 4 expressions with local error:

44.5b
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
0.0b
(* (sqrt (exp x)) (sin y))
0.0b
(* (sqrt (exp x)) (* (sqrt (exp x)) (sin y)))
0.0b
(/ (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))) 2)

rewrite83.0ms

Algorithm
rewrite-expression-head
Counts
4 → 91
Calls

4 calls. Slowest were:

34.0ms
(/ (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))) 2)
33.0ms
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
10.0ms
(* (sqrt (exp x)) (* (sqrt (exp x)) (sin y)))

series354.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

126.0ms
(/ (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))) 2)
117.0ms
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
62.0ms
(* (sqrt (exp x)) (* (sqrt (exp x)) (sin y)))
49.0ms
(* (sqrt (exp x)) (sin y))

simplify6.4s

Counts
68 → 103
Calls

68 calls. Slowest were:

470.0ms
(* (* (* (sqrt (exp x)) (sqrt (exp x))) (sqrt (exp x))) (* (* (* (sqrt (exp x)) (sin y)) (* (sqrt (exp x)) (sin y))) (* (sqrt (exp x)) (sin y))))
359.0ms
(fma (sqrt (exp x)) (* (sqrt (exp x)) (sin y)) (- (* (/ (sin y) (cbrt (exp x))) (/ 1 (* (cbrt (exp x)) (cbrt (exp x)))))))
353.0ms
(* (* (* (sqrt (exp x)) (sqrt (exp x))) (sqrt (exp x))) (* (* (* (sqrt (exp x)) (sqrt (exp x))) (sqrt (exp x))) (* (* (sin y) (sin y)) (sin y))))

prune1.4s

Pruning

16 alts after pruning (15 fresh and 1 done)

Merged error: 27.0b

localize34.0ms

Local error

Found 4 expressions with local error:

44.5b
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
44.5b
(- (* (sin y) (exp x)) (/ (sin y) (exp x)))
44.5b
(- (* (sin y) (exp x)) (/ (sin y) (exp x)))
14.4b
(cbrt (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))))

rewrite83.0ms

Algorithm
rewrite-expression-head
Counts
4 → 101
Calls

4 calls. Slowest were:

28.0ms
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
23.0ms
(cbrt (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))))
15.0ms
(- (* (sin y) (exp x)) (/ (sin y) (exp x)))

series491.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

170.0ms
(cbrt (- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x))))
143.0ms
(- (* (sqrt (exp x)) (* (sqrt (exp x)) (sin y))) (/ (sin y) (exp x)))
92.0ms
(- (* (sin y) (exp x)) (/ (sin y) (exp x)))
86.0ms
(- (* (sin y) (exp x)) (/ (sin y) (exp x)))

simplify12.8s

Counts
105 → 113
Calls

105 calls. Slowest were:

539.0ms
(fma (sin y) (exp x) (- (* (/ (cbrt (sin y)) (cbrt (exp x))) (/ (* (cbrt (sin y)) (cbrt (sin y))) (* (cbrt (exp x)) (cbrt (exp x)))))))
404.0ms
(fma (- (/ (sin y) (cbrt (exp x)))) (/ 1 (* (cbrt (exp x)) (cbrt (exp x)))) (* (/ (sin y) (cbrt (exp x))) (/ 1 (* (cbrt (exp x)) (cbrt (exp x))))))
397.0ms
(fma (sin y) (exp x) (- (* (/ (cbrt (sin y)) (cbrt (exp x))) (/ (* (cbrt (sin y)) (cbrt (sin y))) (* (cbrt (exp x)) (cbrt (exp x)))))))

prune1.9s

Pruning

16 alts after pruning (15 fresh and 1 done)

Merged error: 27.0b

regimes244.0ms

Accuracy

0% (2.7b remaining)

Error of 31.1b against oracle of 28.3b and baseline of 31.1b

bsearch1.0ms