Average Error: 0.1 → 0.2
Time: 15.8s
Precision: 64
\[0.0 \le e \le 1\]
\[\frac{e \cdot \sin v}{1 + e \cdot \cos v}\]
\[e \cdot \mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}\right)\right)\right)\right)\]
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
e \cdot \mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}\right)\right)\right)\right)
double f(double e, double v) {
        double r1031161 = e;
        double r1031162 = v;
        double r1031163 = sin(r1031162);
        double r1031164 = r1031161 * r1031163;
        double r1031165 = 1.0;
        double r1031166 = cos(r1031162);
        double r1031167 = r1031161 * r1031166;
        double r1031168 = r1031165 + r1031167;
        double r1031169 = r1031164 / r1031168;
        return r1031169;
}

double f(double e, double v) {
        double r1031170 = e;
        double r1031171 = v;
        double r1031172 = sin(r1031171);
        double r1031173 = cos(r1031171);
        double r1031174 = 1.0;
        double r1031175 = fma(r1031173, r1031170, r1031174);
        double r1031176 = r1031172 / r1031175;
        double r1031177 = expm1(r1031176);
        double r1031178 = expm1(r1031177);
        double r1031179 = log1p(r1031178);
        double r1031180 = log1p(r1031179);
        double r1031181 = r1031170 * r1031180;
        return r1031181;
}

Error

Bits error versus e

Bits error versus v

Derivation

  1. Initial program 0.1

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{e \cdot \frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}}\]
  3. Using strategy rm
  4. Applied log1p-expm1-u0.2

    \[\leadsto e \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}\right)\right)}\]
  5. Using strategy rm
  6. Applied log1p-expm1-u0.2

    \[\leadsto e \cdot \mathsf{log1p}\left(\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}\right)\right)\right)}\right)\]
  7. Final simplification0.2

    \[\leadsto e \cdot \mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sin v}{\mathsf{fma}\left(\cos v, e, 1\right)}\right)\right)\right)\right)\]

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (e v)
  :name "Trigonometry A"
  :pre (<= 0.0 e 1.0)
  (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))