Average Error: 43.7 → 0.8
Time: 36.0s
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))\]
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\left(\frac{1}{60} \cdot {x}^{5} + \frac{1}{3} \cdot {x}^{3}\right) + 2 \cdot x}{2} \cdot \sin y i\right))\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.7

    \[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
  2. Taylor expanded around 0 0.8

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\color{blue}{2 \cdot x + \left(\frac{1}{3} \cdot {x}^{3} + \frac{1}{60} \cdot {x}^{5}\right)}}{2} \cdot \sin y i\right))\]
  3. Final simplification0.8

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\left(\frac{1}{60} \cdot {x}^{5} + \frac{1}{3} \cdot {x}^{3}\right) + 2 \cdot x}{2} \cdot \sin y i\right))\]

Reproduce

herbie shell --seed 323378853 
(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: 32.4s)Debug log

sample638.0ms

Algorithm
halfpoints
Results

simplify174.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
174.0ms
(im (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y))))

prune29.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 44.5b

localize162.0ms

Local error

Found 3 expressions with local error:

57.8b
(- (exp x) (exp (- x)))
0.1b
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
0.0b
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))

rewrite58.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-sqr-sqrt
associate-*l*
add-cube-cbrt
add-exp-log
add-cbrt-cube
pow1
associate-*r*
add-log-exp
div-inv
cbrt-unprod
*-commutative
prod-exp
associate-*l/
pow-prod-down
difference-of-squares
distribute-lft-out--
flip--
diff-log
flip3--
sub-neg
Counts
3 → 52
Calls
3 calls:
Slowest
23.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
23.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
10.0ms
(- (exp x) (exp (- x)))

series332.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
151.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
102.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
79.0ms
(- (exp x) (exp (- x)))

simplify3.1s

Counts
33 → 61
Calls
33 calls:
Slowest
553.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
413.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))
396.0ms
(* (* (* (/ (+ (exp x) (exp (- x))) 2) (/ (+ (exp x) (exp (- x))) 2)) (/ (+ (exp x) (exp (- x))) 2)) (* (* (cos y) (cos y)) (cos y)))
395.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
259.0ms
(* 1/2 (* (+ (exp (* -1 x)) (exp x)) (cos y)))

prune1.4s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize83.0ms

Local error

Found 4 expressions with local error:

0.2b
(* 1/3 (pow x 3))
0.1b
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
0.1b
(* 1/60 (pow x 5))
0.0b
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))

rewrite46.0ms

Algorithm
rewrite-expression-head
Rules
11×associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-exp-log
add-cbrt-cube
pow1
associate-*l*
*-commutative
div-inv
flip-+
cbrt-unprod
prod-exp
associate-*l/
pow-prod-down
unpow3
flip3-+
sum-log
+-commutative
cube-mult
Counts
4 → 54
Calls
4 calls:
Slowest
31.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
8.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
3.0ms
(* 1/3 (pow x 3))
3.0ms
(* 1/60 (pow x 5))

series300.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
113.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
111.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
43.0ms
(* 1/60 (pow x 5))
33.0ms
(* 1/3 (pow x 3))

simplify1.3s

Counts
30 → 66
Calls
30 calls:
Slowest
212.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
190.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
138.0ms
(* (* (* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (* (* (sin y) (sin y)) (sin y)))
135.0ms
(+ (log (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (log (sin y)))
118.0ms
(+ (* 1/120 (* (pow x 5) (sin y))) (* 1/6 (* (pow x 3) (sin y))))

prune2.0s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.0b

localize52.0ms

Local error

Found 4 expressions with local error:

0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.5b
(* (cbrt (sin y)) (cbrt (sin y)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
add-cbrt-cube
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 61
Calls
4 calls:
Slowest
11.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series976.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
256.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
242.0ms
(cbrt (sin y))
241.0ms
(cbrt (sin y))
236.0ms
(cbrt (sin y))

simplify444.0ms

Counts
41 → 73
Calls
41 calls:
Slowest
100.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
96.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
94.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
67.0ms
(- (+ (pow y 2/3) (* 1/405 (pow (pow y 14) 1/3))) (* 1/9 (pow (pow y 8) 1/3)))
5.0ms
(pow (pow (sin y) 2) 1/3)

prune2.6s

Pruning

12 alts after pruning (11 fresh and 1 done)

Merged error: 0.0b

localize52.0ms

Local error

Found 4 expressions with local error:

0.7b
(cbrt (* (cbrt (sin y)) (cbrt (sin y))))
0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))
0.7b
(cbrt (sin y))

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
10×cbrt-prod
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-exp-log
pow1/3
add-cbrt-cube
pow1
Counts
4 → 42
Calls
4 calls:
Slowest
7.0ms
(cbrt (* (cbrt (sin y)) (cbrt (sin y))))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series981.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
264.0ms
(cbrt (* (cbrt (sin y)) (cbrt (sin y))))
239.0ms
(cbrt (sin y))
239.0ms
(cbrt (sin y))
238.0ms
(cbrt (sin y))

simplify435.0ms

Counts
22 → 54
Calls
22 calls:
Slowest
97.0ms
(- (pow y 2/9) (+ (* 2/3645 (pow (pow y 38) 1/9)) (* 1/27 (pow (pow y 20) 1/9))))
96.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
96.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
95.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
4.0ms
(pow (pow (sin y) 2) 1/9)

prune2.1s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

regimes423.0ms

Accuracy

0% (0.7b remaining)

Error of 0.8b against oracle of 0.1b and baseline of 0.8b

bsearch6.0ms

end0.0ms

sample14.6s

Algorithm
halfpoints
Results