Average Error: 0.1 → 0.1
Time: 4.4s
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 r142254 = x;
        double r142255 = y;
        double r142256 = sin(r142255);
        double r142257 = r142256 / r142255;
        double r142258 = r142254 * r142257;
        return r142258;
}

double f(double x, double y) {
        double r142259 = x;
        double r142260 = y;
        double r142261 = sin(r142260);
        double r142262 = r142261 / r142260;
        double r142263 = log1p(r142262);
        double r142264 = expm1(r142263);
        double r142265 = r142259 * r142264;
        return r142265;
}

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 2019347 +o rules:numerics
(FPCore (x y)
  :name "Linear.Quaternion:$cexp from linear-1.19.1.3"
  :precision binary64
  (* x (/ (sin y) y)))