Average Error: 0.0 → 0.0
Time: 15.4s
Precision: 64
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\]
\[\mathsf{fma}\left(\left(0.5 \cdot \sin re\right), \left(e^{im}\right), \left(\frac{0.5 \cdot \sin re}{e^{im}}\right)\right)\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\mathsf{fma}\left(\left(0.5 \cdot \sin re\right), \left(e^{im}\right), \left(\frac{0.5 \cdot \sin re}{e^{im}}\right)\right)
double f(double re, double im) {
        double r295500 = 0.5;
        double r295501 = re;
        double r295502 = sin(r295501);
        double r295503 = r295500 * r295502;
        double r295504 = 0.0;
        double r295505 = im;
        double r295506 = r295504 - r295505;
        double r295507 = exp(r295506);
        double r295508 = exp(r295505);
        double r295509 = r295507 + r295508;
        double r295510 = r295503 * r295509;
        return r295510;
}

double f(double re, double im) {
        double r295511 = 0.5;
        double r295512 = re;
        double r295513 = sin(r295512);
        double r295514 = r295511 * r295513;
        double r295515 = im;
        double r295516 = exp(r295515);
        double r295517 = r295514 / r295516;
        double r295518 = fma(r295514, r295516, r295517);
        return r295518;
}

Error

Bits error versus re

Bits error versus im

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\]
  2. Simplified0.0

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

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

Reproduce

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