Average Error: 14.0 → 0.7
Time: 22.0s
Precision: 64
\[\frac{\sin x \cdot \sinh y}{x}\]
\[\mathsf{fma}\left(\frac{\sin x}{x}, y, \mathsf{fma}\left(\frac{1}{6}, \frac{\sin x \cdot {y}^{3}}{x}, \frac{1}{120} \cdot \frac{\sin x \cdot {y}^{5}}{x}\right)\right)\]
\frac{\sin x \cdot \sinh y}{x}
\mathsf{fma}\left(\frac{\sin x}{x}, y, \mathsf{fma}\left(\frac{1}{6}, \frac{\sin x \cdot {y}^{3}}{x}, \frac{1}{120} \cdot \frac{\sin x \cdot {y}^{5}}{x}\right)\right)
double f(double x, double y) {
        double r410163 = x;
        double r410164 = sin(r410163);
        double r410165 = y;
        double r410166 = sinh(r410165);
        double r410167 = r410164 * r410166;
        double r410168 = r410167 / r410163;
        return r410168;
}

double f(double x, double y) {
        double r410169 = x;
        double r410170 = sin(r410169);
        double r410171 = r410170 / r410169;
        double r410172 = y;
        double r410173 = 0.16666666666666666;
        double r410174 = 3.0;
        double r410175 = pow(r410172, r410174);
        double r410176 = r410170 * r410175;
        double r410177 = r410176 / r410169;
        double r410178 = 0.008333333333333333;
        double r410179 = 5.0;
        double r410180 = pow(r410172, r410179);
        double r410181 = r410170 * r410180;
        double r410182 = r410181 / r410169;
        double r410183 = r410178 * r410182;
        double r410184 = fma(r410173, r410177, r410183);
        double r410185 = fma(r410171, r410172, r410184);
        return r410185;
}

Error

Bits error versus x

Bits error versus y

Target

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

Derivation

  1. Initial program 14.0

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

    \[\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(\frac{1}{120} \cdot {y}^{5} + y\right)}}{x}\]
  7. Simplified0.7

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

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

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

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

Reproduce

herbie shell --seed 2019199 +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))