Average Error: 44.0 → 0.7
Time: 26.1s
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 44.0

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

sample553.0ms

Algorithm
halfpoints

simplify83.0ms

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

prune15.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 44.7b

localize70.0ms

Local error

Found 2 expressions with local error:

58.8b
(- (exp x) (exp (- x)))
0.1b
(* (/ (- (exp x) (exp (- x))) 2) (sin y))

rewrite18.0ms

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

series155.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
89.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))
66.0ms
(- (exp x) (exp (- x)))

simplify1.3s

Counts
20 → 39
Calls
20 calls:
Slowest
355.0ms
(* (* (* (/ (- (exp x) (exp (- x))) 2) (/ (- (exp x) (exp (- x))) 2)) (/ (- (exp x) (exp (- x))) 2)) (* (* (sin y) (sin y)) (sin y)))
319.0ms
(* 1/2 (* (- (exp x) (exp (- x))) (sin y)))
298.0ms
(* 1/2 (* (- (exp x) (exp (* -1 x))) (sin y)))
84.0ms
(* (- (exp x) (exp (- x))) (sin y))
58.0ms
(* (/ (- (exp x) (exp (- x))) 2) (sin y))

prune506.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.1b

localize30.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)))

rewrite18.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))
4.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))

series198.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
88.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
61.0ms
(+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))
28.0ms
(* 1/3 (pow x 3))
21.0ms
(* 1/60 (pow x 5))

simplify870.0ms

Counts
30 → 66
Calls
30 calls:
Slowest
155.0ms
(* (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2) (sin y))
111.0ms
(+ (log (/ (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) 2)) (log (sin y)))
109.0ms
(* (+ (* 2 x) (+ (* 1/3 (pow x 3)) (* 1/60 (pow x 5)))) (sin y))
105.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)))
67.0ms
(+ (* 1/120 (* (pow x 5) (sin y))) (* 1/6 (* (pow x 3) (sin y))))

prune1.3s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize28.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.5b
(* (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))

series628.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
199.0ms
(cbrt (sin y))
156.0ms
(* (cbrt (sin y)) (cbrt (sin y)))
137.0ms
(cbrt (sin y))
135.0ms
(cbrt (sin y))

simplify250.0ms

Counts
41 → 73
Calls
41 calls:
Slowest
55.0ms
(- (+ (pow y 2/3) (* 1/405 (pow (pow y 14) 1/3))) (* 1/9 (pow (pow y 8) 1/3)))
49.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
48.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))))
3.0ms
(pow (sin y) 1/3)

prune1.6s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize42.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.6b
(cbrt (sin y))

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
12×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 → 44
Calls
4 calls:
Slowest
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))
1.0ms
(cbrt (sin y))

series665.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
195.0ms
(cbrt (sin y))
171.0ms
(cbrt (sin y))
162.0ms
(cbrt (sin y))
136.0ms
(cbrt (sin y))

simplify298.0ms

Counts
24 → 56
Calls
24 calls:
Slowest
87.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
74.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
57.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
46.0ms
(- (pow y 1/3) (+ (* 1/18 (pow (pow y 7) 1/3)) (* 1/3240 (pow (pow y 13) 1/3))))
3.0ms
(pow (sin y) 1/3)

prune1.5s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.0b

regimes258.0ms

Accuracy

0% (0.7b remaining)

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

bsearch6.0ms

end0.0ms

sample12.6s

Algorithm
halfpoints