Average Error: 0.0 → 0.0
Time: 2.5s
Precision: 64
Internal Precision: 128
\[x.re \cdot y.re - x.im \cdot y.im\]
\[(\left(-y.im\right) \cdot x.im + \left(y.im \cdot x.im\right))_* + (x.re \cdot y.re + \left(\left(-x.im\right) \cdot y.im\right))_*\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Initial program 0.0

    \[x.re \cdot y.re - x.im \cdot y.im\]
  2. Using strategy rm
  3. Applied prod-diff0.0

    \[\leadsto \color{blue}{(x.re \cdot y.re + \left(-y.im \cdot x.im\right))_* + (\left(-y.im\right) \cdot x.im + \left(y.im \cdot x.im\right))_*}\]
  4. Final simplification0.0

    \[\leadsto (\left(-y.im\right) \cdot x.im + \left(y.im \cdot x.im\right))_* + (x.re \cdot y.re + \left(\left(-x.im\right) \cdot y.im\right))_*\]

Reproduce

herbie shell --seed 2019016 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "_multiplyComplex, real part"
  (- (* x.re y.re) (* x.im y.im)))

Details

Time bar (total: 2.1s)Debug log

sample55.0ms

Algorithm
intervals
Results
324×(pre true 80)
324×(body real 80)

simplify12.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
12.0ms
(- (* x.re y.re) (* x.im y.im))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

0.0b
(- (* x.re y.re) (* x.im y.im))

rewrite3.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
flip--
log1p-expm1-u
add-cube-cbrt
add-exp-log
prod-diff
diff-log
fma-neg
add-cbrt-cube
flip3--
*-un-lft-identity
sub-neg
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 16
Calls
1 calls:
Slowest
2.0ms
(- (* x.re y.re) (* x.im y.im))

series35.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
35.0ms
(- (* x.re y.re) (* x.im y.im))

simplify66.0ms

Counts
6 → 19
Calls
6 calls:
Slowest
17.0ms
(/ (exp (* x.re y.re)) (exp (* x.im y.im)))
17.0ms
(fma x.re y.re (- (* y.im x.im)))
13.0ms
(- (* y.re x.re) (* y.im x.im))
9.0ms
(fma (- y.im) x.im (* y.im x.im))
8.0ms
(- (* y.re x.re) (* y.im x.im))

prune178.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize22.0ms

Local error

Found 2 expressions with local error:

53.4b
(fma (- y.im) x.im (* y.im x.im))
0.0b
(fma x.re y.re (- (* y.im x.im)))

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
2 → 20
Calls
2 calls:
Slowest
0.0ms
(fma (- y.im) x.im (* y.im x.im))
0.0ms
(fma x.re y.re (- (* y.im x.im)))

series64.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
48.0ms
(fma x.re y.re (- (* y.im x.im)))
16.0ms
(fma (- y.im) x.im (* y.im x.im))

simplify40.0ms

Counts
6 → 26
Calls
6 calls:
Slowest
19.0ms
(- (* y.re x.re) (* y.im x.im))
17.0ms
(- (* y.re x.re) (* y.im x.im))
1.0ms
0
1.0ms
0
1.0ms
0

prune383.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b

end0.0ms

sample1.3s

Algorithm
intervals
Results
10465×(pre true 80)
10465×(body real 80)