Average Error: 0.1 → 0.0
Time: 6.7s
Precision: 64
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\]
\[\mathsf{fma}\left(\left(0.5 \cdot \sin re\right) \cdot 1, e^{0.0 - im}, \left(0.5 \cdot \sin re\right) \cdot e^{im}\right)\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)
\mathsf{fma}\left(\left(0.5 \cdot \sin re\right) \cdot 1, e^{0.0 - im}, \left(0.5 \cdot \sin re\right) \cdot e^{im}\right)
double code(double re, double im) {
	return ((double) (((double) (0.5 * ((double) sin(re)))) * ((double) (((double) exp(((double) (0.0 - im)))) + ((double) exp(im))))));
}
double code(double re, double im) {
	return ((double) fma(((double) (((double) (0.5 * ((double) sin(re)))) * 1.0)), ((double) exp(((double) (0.0 - im)))), ((double) (((double) (0.5 * ((double) sin(re)))) * ((double) 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.1

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.1

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

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(1 \cdot e^{0.0 - im}\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im}\]
  6. Applied associate-*r*0.1

    \[\leadsto \color{blue}{\left(\left(0.5 \cdot \sin re\right) \cdot 1\right) \cdot e^{0.0 - im}} + \left(0.5 \cdot \sin re\right) \cdot e^{im}\]
  7. Applied fma-def0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(0.5 \cdot \sin re\right) \cdot 1, e^{0.0 - im}, \left(0.5 \cdot \sin re\right) \cdot e^{im}\right)}\]
  8. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(\left(0.5 \cdot \sin re\right) \cdot 1, e^{0.0 - im}, \left(0.5 \cdot \sin re\right) \cdot e^{im}\right)\]

Reproduce

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