Average Error: 0.0 → 0.0
Time: 33.9s
Precision: 64
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\]
\[\left(0.5 \cdot \sin re\right) \cdot \mathsf{fma}\left(\sqrt{e^{0.0 - im}}, \sqrt{e^{0.0 - im}}, e^{im}\right)\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)
\left(0.5 \cdot \sin re\right) \cdot \mathsf{fma}\left(\sqrt{e^{0.0 - im}}, \sqrt{e^{0.0 - im}}, e^{im}\right)
double f(double re, double im) {
        double r33420 = 0.5;
        double r33421 = re;
        double r33422 = sin(r33421);
        double r33423 = r33420 * r33422;
        double r33424 = 0.0;
        double r33425 = im;
        double r33426 = r33424 - r33425;
        double r33427 = exp(r33426);
        double r33428 = exp(r33425);
        double r33429 = r33427 + r33428;
        double r33430 = r33423 * r33429;
        return r33430;
}

double f(double re, double im) {
        double r33431 = 0.5;
        double r33432 = re;
        double r33433 = sin(r33432);
        double r33434 = r33431 * r33433;
        double r33435 = 0.0;
        double r33436 = im;
        double r33437 = r33435 - r33436;
        double r33438 = exp(r33437);
        double r33439 = sqrt(r33438);
        double r33440 = exp(r33436);
        double r33441 = fma(r33439, r33439, r33440);
        double r33442 = r33434 * r33441;
        return r33442;
}

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.0 - im} + e^{im}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.0

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

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

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

Reproduce

herbie shell --seed 2020047 +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))))