Average Error: 0.1 → 0.1
Time: 12.0s
Precision: 64
\[x \cdot \frac{\sin y}{y}\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right) \cdot x\]
x \cdot \frac{\sin y}{y}
\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right) \cdot x
double f(double x, double y) {
        double r4951658 = x;
        double r4951659 = y;
        double r4951660 = sin(r4951659);
        double r4951661 = r4951660 / r4951659;
        double r4951662 = r4951658 * r4951661;
        return r4951662;
}

double f(double x, double y) {
        double r4951663 = y;
        double r4951664 = sin(r4951663);
        double r4951665 = r4951664 / r4951663;
        double r4951666 = log1p(r4951665);
        double r4951667 = expm1(r4951666);
        double r4951668 = x;
        double r4951669 = r4951667 * r4951668;
        return r4951669;
}

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 \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right) \cdot x\]

Reproduce

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