Average Error: 14.1 → 0.7
Time: 20.2s
Precision: 64
\[\frac{\sin x \cdot \sinh y}{x}\]
\[\mathsf{fma}\left(\frac{\sin x}{x} \cdot \frac{1}{120}, {y}^{5}, \mathsf{fma}\left(\frac{1}{6}, y \cdot \left(\frac{\sin x}{x} \cdot \left(y \cdot y\right)\right), \frac{\sin x}{x} \cdot y\right)\right)\]
\frac{\sin x \cdot \sinh y}{x}
\mathsf{fma}\left(\frac{\sin x}{x} \cdot \frac{1}{120}, {y}^{5}, \mathsf{fma}\left(\frac{1}{6}, y \cdot \left(\frac{\sin x}{x} \cdot \left(y \cdot y\right)\right), \frac{\sin x}{x} \cdot y\right)\right)
double f(double x, double y) {
        double r12848515 = x;
        double r12848516 = sin(r12848515);
        double r12848517 = y;
        double r12848518 = sinh(r12848517);
        double r12848519 = r12848516 * r12848518;
        double r12848520 = r12848519 / r12848515;
        return r12848520;
}

double f(double x, double y) {
        double r12848521 = x;
        double r12848522 = sin(r12848521);
        double r12848523 = r12848522 / r12848521;
        double r12848524 = 0.008333333333333333;
        double r12848525 = r12848523 * r12848524;
        double r12848526 = y;
        double r12848527 = 5.0;
        double r12848528 = pow(r12848526, r12848527);
        double r12848529 = 0.16666666666666666;
        double r12848530 = r12848526 * r12848526;
        double r12848531 = r12848523 * r12848530;
        double r12848532 = r12848526 * r12848531;
        double r12848533 = r12848523 * r12848526;
        double r12848534 = fma(r12848529, r12848532, r12848533);
        double r12848535 = fma(r12848525, r12848528, r12848534);
        return r12848535;
}

Error

Bits error versus x

Bits error versus y

Target

Original14.1
Target0.2
Herbie0.7
\[\sin x \cdot \frac{\sinh y}{x}\]

Derivation

  1. Initial program 14.1

    \[\frac{\sin x \cdot \sinh y}{x}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity14.1

    \[\leadsto \frac{\sin x \cdot \sinh y}{\color{blue}{1 \cdot x}}\]
  4. Applied times-frac0.2

    \[\leadsto \color{blue}{\frac{\sin x}{1} \cdot \frac{\sinh y}{x}}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{\sin x} \cdot \frac{\sinh y}{x}\]
  6. Taylor expanded around 0 0.7

    \[\leadsto \sin x \cdot \frac{\color{blue}{\frac{1}{6} \cdot {y}^{3} + \left(y + \frac{1}{120} \cdot {y}^{5}\right)}}{x}\]
  7. Simplified0.7

    \[\leadsto \sin x \cdot \frac{\color{blue}{\mathsf{fma}\left({y}^{5}, \frac{1}{120}, \mathsf{fma}\left(y \cdot y, y \cdot \frac{1}{6}, y\right)\right)}}{x}\]
  8. Taylor expanded around inf 14.7

    \[\leadsto \color{blue}{\frac{1}{120} \cdot \frac{\sin x \cdot {y}^{5}}{x} + \left(\frac{1}{6} \cdot \frac{\sin x \cdot {y}^{3}}{x} + \frac{\sin x \cdot y}{x}\right)}\]
  9. Simplified0.7

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{120} \cdot \frac{\sin x}{x}, {y}^{5}, \mathsf{fma}\left(\frac{1}{6}, \left(\frac{\sin x}{x} \cdot \left(y \cdot y\right)\right) \cdot y, \frac{\sin x}{x} \cdot y\right)\right)}\]
  10. Final simplification0.7

    \[\leadsto \mathsf{fma}\left(\frac{\sin x}{x} \cdot \frac{1}{120}, {y}^{5}, \mathsf{fma}\left(\frac{1}{6}, y \cdot \left(\frac{\sin x}{x} \cdot \left(y \cdot y\right)\right), \frac{\sin x}{x} \cdot y\right)\right)\]

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(FPCore (x y)
  :name "Linear.Quaternion:$ccosh from linear-1.19.1.3"

  :herbie-target
  (* (sin x) (/ (sinh y) x))

  (/ (* (sin x) (sinh y)) x))