e^{re} \cdot \cos im\cos im \cdot e^{re}(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
(FPCore (re im) :precision binary64 (* (cos im) (exp re)))
double code(double re, double im) {
return exp(re) * cos(im);
}
double code(double re, double im) {
return cos(im) * exp(re);
}
















Bits error versus re
















Bits error versus im
Results
| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 58304 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 45248 |
| Alternative 3 | |
|---|---|
| Error | 0.1 |
| Cost | 38784 |
| Alternative 4 | |
|---|---|
| Error | 0.0 |
| Cost | 32384 |
| Alternative 5 | |
|---|---|
| Error | 0.0 |
| Cost | 26048 |
| Alternative 6 | |
|---|---|
| Error | 21.7 |
| Cost | 7360 |
| Alternative 7 | |
|---|---|
| Error | 21.7 |
| Cost | 7104 |
| Alternative 8 | |
|---|---|
| Error | 21.6 |
| Cost | 6720 |
| Alternative 9 | |
|---|---|
| Error | 21.9 |
| Cost | 6464 |
| Alternative 10 | |
|---|---|
| Error | 19.3 |
| Cost | 6464 |
| Alternative 11 | |
|---|---|
| Error | 40.7 |
| Cost | 64 |
| Alternative 12 | |
|---|---|
| Error | 41.4 |
| Cost | 64 |
| Alternative 13 | |
|---|---|
| Error | 60.5 |
| Cost | 64 |

Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021042
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))