\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- im)) (exp im))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(0.0 - im) + exp(im));
}
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) + exp(im));
}







Bits error versus re







Bits error versus im
Results
| Alternative 1 | |
|---|---|
| Error | 0.7 |
| Cost | 26440 |
| Alternative 2 | |
|---|---|
| Error | 0.9 |
| Cost | 6976 |
| Alternative 3 | |
|---|---|
| Error | 1.2 |
| Cost | 6464 |
| Alternative 4 | |
|---|---|
| Error | 59.2 |
| Cost | 64 |

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