Average Error: 43.6 → 0.7
Time: 27.3s
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.6

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

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

    \[\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 2019016 
(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: 24.3s)Debug log

sample482.0ms

Algorithm
halfpoints
Results

simplify101.0ms

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

prune11.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 42.7b

localize74.0ms

Local error

Found 3 expressions with local error:

57.0b
(- (exp x) (exp (- x)))
0.4b
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
0.0b
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))

rewrite23.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
9.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
9.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
4.0ms
(- (exp x) (exp (- x)))

series229.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
106.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
69.0ms
(* (/ (+ (exp x) (exp (- x))) 2) (cos y))
54.0ms
(- (exp x) (exp (- x)))

simplify1.8s

Counts
33 → 61
Calls
33 calls:
Slowest
306.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
285.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
262.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))
192.0ms
(* (* (* (/ (+ (exp x) (exp (- x))) 2) (/ (+ (exp x) (exp (- x))) 2)) (/ (+ (exp x) (exp (- x))) 2)) (* (* (cos y) (cos y)) (cos y)))
147.0ms
(* 1/2 (* (+ (exp x) (exp (- x))) (cos y)))

prune828.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.4b

localize32.0ms

Local error

Found 4 expressions with local error:

0.1b
(* 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)))

rewrite17.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
11.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
3.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
1.0ms
(* 1/3 (pow x 3))
1.0ms
(* 1/60 (pow x 5))

series193.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
84.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
74.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
19.0ms
(* 1/60 (pow x 5))
15.0ms
(* 1/3 (pow x 3))

simplify825.0ms

Counts
30 → 66
Calls
30 calls:
Slowest
158.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
115.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
113.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)))
66.0ms
(+ (log (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (log (sin y)))
63.0ms
(sqrt (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2))

prune1.2s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.3b

localize21.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.4b
(* (cbrt (sin y)) (cbrt (sin y)))

rewrite14.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
10.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series669.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
192.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
182.0ms
(cbrt (sin y))
149.0ms
(cbrt (sin y))
144.0ms
(cbrt (sin y))

simplify395.0ms

Counts
41 → 73
Calls
41 calls:
Slowest
85.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
84.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
83.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
61.0ms
(- (+ (pow y 2/3) (* 1/405 (pow (pow y 14) 1/3))) (* 1/9 (pow (pow y 8) 1/3)))
4.0ms
(pow (pow (sin y) 2) 1/3)

prune1.7s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.3b

localize9.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.6b
(cbrt (sin y))
0.4b
(* (cbrt (sin y)) (cbrt (sin y)))

rewrite13.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
9.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series576.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
149.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
148.0ms
(cbrt (sin y))
147.0ms
(cbrt (sin y))
131.0ms
(cbrt (sin y))

simplify304.0ms

Counts
41 → 73
Calls
41 calls:
Slowest
85.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
84.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
45.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
38.0ms
(- (+ (pow y 2/3) (* 1/405 (pow (pow y 14) 1/3))) (* 1/9 (pow (pow y 8) 1/3)))
4.0ms
(pow (pow (sin y) 2) 1/3)

prune1.7s

Pruning

12 alts after pruning (9 fresh and 3 done)

Merged error: 0.3b

regimes443.0ms

Accuracy

0% (0.7b remaining)

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

bsearch3.0ms

end0.0ms

sample12.8s

Algorithm
halfpoints
Results