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









Bits error versus re









Bits error versus im
Results
| Alternative 1 | |
|---|---|
| Error | 0.6 |
| Cost | 13825 |
| Alternative 2 | |
|---|---|
| Error | 0.8 |
| Cost | 13441 |
| Alternative 3 | |
|---|---|
| Error | 1.1 |
| Cost | 13185 |
| Alternative 4 | |
|---|---|
| Error | 19.0 |
| Cost | 6464 |
| Alternative 5 | |
|---|---|
| Error | 19.7 |
| Cost | 385 |
| Alternative 6 | |
|---|---|
| Error | 40.8 |
| Cost | 64 |

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