Average Error: 0.1 → 0.1
Time: 4.2s
Precision: 64
\[x \cdot \frac{\sin y}{y}\]
\[x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right)\]
x \cdot \frac{\sin y}{y}
x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right)
double f(double x, double y) {
        double r167871 = x;
        double r167872 = y;
        double r167873 = sin(r167872);
        double r167874 = r167873 / r167872;
        double r167875 = r167871 * r167874;
        return r167875;
}

double f(double x, double y) {
        double r167876 = x;
        double r167877 = y;
        double r167878 = sin(r167877);
        double r167879 = r167878 / r167877;
        double r167880 = log1p(r167879);
        double r167881 = expm1(r167880);
        double r167882 = r167876 * r167881;
        return r167882;
}

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. Final simplification0.1

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

Reproduce

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