Average Error: 0.0 → 0.0
Time: 4.8s
Precision: 64
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\]
\[0.5 \cdot \left(\sin re \cdot e^{0.0 - im} + \sin re \cdot e^{im}\right)\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)
0.5 \cdot \left(\sin re \cdot e^{0.0 - im} + \sin re \cdot e^{im}\right)
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((0.0 - im))) + (sin(re) * exp(im))));
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\]
  2. Using strategy rm
  3. Applied associate-*l*0.0

    \[\leadsto \color{blue}{0.5 \cdot \left(\sin re \cdot \left(e^{0.0 - im} + e^{im}\right)\right)}\]
  4. Using strategy rm
  5. Applied distribute-lft-in0.0

    \[\leadsto 0.5 \cdot \color{blue}{\left(\sin re \cdot e^{0.0 - im} + \sin re \cdot e^{im}\right)}\]
  6. Final simplification0.0

    \[\leadsto 0.5 \cdot \left(\sin re \cdot e^{0.0 - im} + \sin re \cdot e^{im}\right)\]

Reproduce

herbie shell --seed 2020092 
(FPCore (re im)
  :name "math.sin on complex, real part"
  :precision binary64
  (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))