Average Error: 0.0 → 0.0
Time: 23.9s
Precision: 64
Internal Precision: 128
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\]
\[\sin re \cdot (0.5 \cdot \left(e^{im}\right) + \left(\frac{0.5}{e^{im}}\right))_*\]

Error

Bits error versus re

Bits error versus im

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\]
  2. Taylor expanded around -inf 0.0

    \[\leadsto \color{blue}{0.5 \cdot \left(\sin re \cdot \left(e^{im} + e^{-1 \cdot im}\right)\right)}\]
  3. Simplified0.0

    \[\leadsto \color{blue}{(0.5 \cdot \left(e^{im}\right) + \left(\frac{0.5}{e^{im}}\right))_* \cdot \sin re}\]
  4. Final simplification0.0

    \[\leadsto \sin re \cdot (0.5 \cdot \left(e^{im}\right) + \left(\frac{0.5}{e^{im}}\right))_*\]

Reproduce

herbie shell --seed 2019016 +o rules:numerics
(FPCore (re im)
  :name "math.sin on complex, real part"
  (* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im))))

Details

Time bar (total: 23.4s)Debug log

sample256.0ms

Algorithm
intervals
Results
520×(pre true 80)
274×(body real 80)
108×(body real 1280)
69×(body real 640)
51×(body real 320)
18×(body real 160)

simplify444.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
444.0ms
(* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im)))

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 1 expressions with local error:

0.0b
(* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im)))

rewrite25.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
*-un-lft-identity
add-exp-log
add-cbrt-cube
pow1
add-cube-cbrt
associate-*r/
add-sqr-sqrt
add-log-exp
distribute-lft-out
log1p-expm1-u
flip-+
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
associate-*l*
flip3-+
distribute-lft-in
expm1-log1p-u
distribute-rgt-in
Counts
1 → 22
Calls
1 calls:
Slowest
25.0ms
(* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im)))

series82.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
82.0ms
(* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im)))

simplify2.4s

Counts
14 → 25
Calls
14 calls:
Slowest
501.0ms
(* 0.5 (* (sin re) (+ (exp im) (exp (* -1 im)))))
473.0ms
(* 0.5 (* (sin re) (+ (exp (- im)) (exp im))))
423.0ms
(* (* 0.5 (sin re)) (+ (exp (- 0 im)) (exp im)))
362.0ms
(+ (* (exp (- 0 im)) (exp (- 0 im))) (- (* (exp im) (exp im)) (* (exp (- 0 im)) (exp im))))
333.0ms
(- (+ (* 1.0 re) (* 0.5 (* re (pow im 2)))) (* 0.16666666666666666 (pow re 3)))

prune316.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize9.0ms

Local error

Found 2 expressions with local error:

0.0b
(* (fma 0.5 (exp im) (/ 0.5 (exp im))) (sin re))
0.0b
(/ 0.5 (exp im))

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-exp-log
add-cbrt-cube
pow1
associate-*l*
associate-*r*
associate-/r*
add-log-exp
log1p-expm1-u
expm1-log1p-u
div-inv
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
frac-2neg
clear-num
Counts
2 → 34
Calls
2 calls:
Slowest
4.0ms
(* (fma 0.5 (exp im) (/ 0.5 (exp im))) (sin re))
1.0ms
(/ 0.5 (exp im))

series84.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
74.0ms
(* (fma 0.5 (exp im) (/ 0.5 (exp im))) (sin re))
10.0ms
(/ 0.5 (exp im))

simplify1.1s

Counts
17 → 40
Calls
17 calls:
Slowest
274.0ms
(- (+ (* 1.0 re) (* 0.5 (* re (pow im 2)))) (* 0.16666666666666666 (pow re 3)))
241.0ms
(* (* (* (fma 0.5 (exp im) (/ 0.5 (exp im))) (fma 0.5 (exp im) (/ 0.5 (exp im)))) (fma 0.5 (exp im) (/ 0.5 (exp im)))) (* (* (sin re) (sin re)) (sin re)))
192.0ms
(* (sin re) (+ (* 0.5 (exp im)) (* 0.5 (/ 1 (exp im)))))
133.0ms
(* (sin re) (+ (* 0.5 (exp im)) (* 0.5 (/ 1 (exp im)))))
130.0ms
(- (+ (* 0.25 (pow im 2)) 0.5) (* 0.5 im))

prune417.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 2 expressions with local error:

0.0b
(* (* 0.5 (sin re)) (exp im))
0.0b
(* (* 0.5 (sin re)) (exp (- 0 im)))

rewrite25.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
add-cbrt-cube
pow1
add-cube-cbrt
add-exp-log
*-un-lft-identity
add-sqr-sqrt
sub0-neg
add-log-exp
log1p-expm1-u
cbrt-unprod
*-commutative
associate-*r/
prod-exp
pow-prod-down
exp-sum
associate-*l*
expm1-log1p-u
exp-neg
un-div-inv
exp-diff
sub-neg
Counts
2 → 39
Calls
2 calls:
Slowest
14.0ms
(* (* 0.5 (sin re)) (exp (- 0 im)))
10.0ms
(* (* 0.5 (sin re)) (exp im))

series114.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
64.0ms
(* (* 0.5 (sin re)) (exp (- 0 im)))
50.0ms
(* (* 0.5 (sin re)) (exp im))

simplify1.8s

Counts
23 → 45
Calls
23 calls:
Slowest
602.0ms
(- (+ (* 0.5 re) (* 0.5 (* re im))) (* 0.08333333333333333 (pow re 3)))
324.0ms
(* (* (* (* 0.5 (sin re)) (* 0.5 (sin re))) (* 0.5 (sin re))) (* (* (exp (- 0 im)) (exp (- 0 im))) (exp (- 0 im))))
234.0ms
(- (* 0.5 re) (+ (* 0.5 (* re im)) (* 0.08333333333333333 (pow re 3))))
209.0ms
(* (* (* (* 0.5 (sin re)) (* 0.5 (sin re))) (* 0.5 (sin re))) (* (* (exp im) (exp im)) (exp im)))
141.0ms
(+ (log (* 0.5 (sin re))) (- 0 im))

prune429.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize15.0ms

Local error

Found 4 expressions with local error:

0.0b
(* (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im))))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re)))
0.0b
(* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))))
0.0b
(/ 0.5 (exp im))
0.0b
(/ 0.5 (exp im))

rewrite27.0ms

Algorithm
rewrite-expression-head
Rules
21×pow1
18×add-exp-log
10×add-cube-cbrt
10×pow-prod-down
10×add-cbrt-cube
10×*-un-lft-identity
10×add-sqr-sqrt
cbrt-unprod
prod-exp
associate-*l*
associate-*r*
associate-/r*
cbrt-prod
add-log-exp
log1p-expm1-u
pow1/3
expm1-log1p-u
div-inv
pow-prod-up
*-commutative
frac-2neg
clear-num
pow-plus
pow2
Counts
4 → 84
Calls
4 calls:
Slowest
18.0ms
(* (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im))))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re)))
5.0ms
(* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))))
1.0ms
(/ 0.5 (exp im))
1.0ms
(/ 0.5 (exp im))

series405.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
254.0ms
(* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))))
116.0ms
(* (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im))))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re)))
17.0ms
(/ 0.5 (exp im))
17.0ms
(/ 0.5 (exp im))

simplify4.9s

Counts
52 → 96
Calls
52 calls:
Slowest
885.0ms
(pow (pow (+ (* 0.5 (exp im)) (* 0.5 (/ 1 (exp im)))) 2) 1/3)
710.0ms
(* (* (* (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im))))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))))) (* (fma 0.5 (exp im) (/ 0.5 (exp im))) (* (* (sin re) (sin re)) (sin re))))
460.0ms
(pow (pow (+ (* 0.5 (exp im)) (* 0.5 (/ 1 (exp im)))) 2) 1/3)
452.0ms
(* (* (fma 0.5 (exp im) (/ 0.5 (exp im))) (fma 0.5 (exp im) (/ 0.5 (exp im)))) (* (fma 0.5 (exp im) (/ 0.5 (exp im))) (* (* (sin re) (sin re)) (sin re))))
327.0ms
(* (* (fma 0.5 (exp im) (/ 0.5 (exp im))) (fma 0.5 (exp im) (/ 0.5 (exp im)))) (* (* (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re)) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re))) (* (cbrt (fma 0.5 (exp im) (/ 0.5 (exp im)))) (sin re))))

prune1.2s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes169.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch2.0ms

end0.0ms

sample9.1s

Algorithm
intervals
Results
15926×(pre true 80)
8577×(body real 80)
3045×(body real 1280)
2474×(body real 640)
1214×(body real 320)
616×(body real 160)