Average Error: 0.1 → 0.2
Time: 3.4s
Precision: 64
\[x \cdot \frac{\sin y}{y}\]
\[x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\frac{y}{\sin y}}\right)\right)\]
x \cdot \frac{\sin y}{y}
x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\frac{y}{\sin y}}\right)\right)
double f(double x, double y) {
        double r187009 = x;
        double r187010 = y;
        double r187011 = sin(r187010);
        double r187012 = r187011 / r187010;
        double r187013 = r187009 * r187012;
        return r187013;
}

double f(double x, double y) {
        double r187014 = x;
        double r187015 = 1.0;
        double r187016 = y;
        double r187017 = sin(r187016);
        double r187018 = r187016 / r187017;
        double r187019 = r187015 / r187018;
        double r187020 = log1p(r187019);
        double r187021 = expm1(r187020);
        double r187022 = r187014 * r187021;
        return r187022;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[x \cdot \frac{\sin y}{y}\]
  2. Using strategy rm
  3. Applied expm1-log1p-u0.1

    \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right)}\]
  4. Using strategy rm
  5. Applied clear-num0.2

    \[\leadsto x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{y}{\sin y}}}\right)\right)\]
  6. Final simplification0.2

    \[\leadsto x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{\frac{y}{\sin y}}\right)\right)\]

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y)
  :name "Linear.Quaternion:$cexp from linear-1.19.1.3"
  :precision binary64
  (* x (/ (sin y) y)))