Average Error: 0.0 → 0.0
Time: 2.2s
Precision: 64
Internal Precision: 128
\[x.re \cdot y.re - x.im \cdot y.im\]
\[(x.re \cdot y.re + \left(y.im \cdot \left(-x.im\right)\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 fma-neg0.0

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

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

Reproduce

herbie shell --seed 2019022 +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: 1.8s)Debug log

sample28.0ms

Algorithm
intervals
Results
16.0ms336×body80valid

simplify16.0ms

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

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

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

series31.0ms

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

simplify77.0ms

Counts
6 → 19
Calls
6 calls:
Slowest
32.0ms
(/ (exp (* x.re y.re)) (exp (* x.im y.im)))
16.0ms
(fma x.re y.re (- (* y.im x.im)))
11.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))

prune167.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite0.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
1 → 10
Calls
1 calls:
Slowest
0.0ms
(fma x.re y.re (- (* x.im y.im)))

series36.0ms

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

simplify18.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
9.0ms
(- (* y.re x.re) (* y.im x.im))
8.0ms
(- (* y.re x.re) (* y.im x.im))
0.0ms
0

prune119.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes254.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample998.0ms

Algorithm
intervals
Results
763.0ms10471×body80valid