Average Error: 14.4 → 0.7
Time: 18.4s
Precision: 64
\[\frac{\sin x \cdot \sinh y}{x}\]
\[\mathsf{fma}\left(\frac{y \cdot y}{\frac{x}{\sin x \cdot y}}, \frac{1}{6}, \mathsf{fma}\left(\frac{\sin x}{x}, y, \frac{\sin x \cdot \frac{1}{120}}{x} \cdot {y}^{5}\right)\right)\]
\frac{\sin x \cdot \sinh y}{x}
\mathsf{fma}\left(\frac{y \cdot y}{\frac{x}{\sin x \cdot y}}, \frac{1}{6}, \mathsf{fma}\left(\frac{\sin x}{x}, y, \frac{\sin x \cdot \frac{1}{120}}{x} \cdot {y}^{5}\right)\right)
double f(double x, double y) {
        double r19463306 = x;
        double r19463307 = sin(r19463306);
        double r19463308 = y;
        double r19463309 = sinh(r19463308);
        double r19463310 = r19463307 * r19463309;
        double r19463311 = r19463310 / r19463306;
        return r19463311;
}

double f(double x, double y) {
        double r19463312 = y;
        double r19463313 = r19463312 * r19463312;
        double r19463314 = x;
        double r19463315 = sin(r19463314);
        double r19463316 = r19463315 * r19463312;
        double r19463317 = r19463314 / r19463316;
        double r19463318 = r19463313 / r19463317;
        double r19463319 = 0.16666666666666666;
        double r19463320 = r19463315 / r19463314;
        double r19463321 = 0.008333333333333333;
        double r19463322 = r19463315 * r19463321;
        double r19463323 = r19463322 / r19463314;
        double r19463324 = 5.0;
        double r19463325 = pow(r19463312, r19463324);
        double r19463326 = r19463323 * r19463325;
        double r19463327 = fma(r19463320, r19463312, r19463326);
        double r19463328 = fma(r19463318, r19463319, r19463327);
        return r19463328;
}

Error

Bits error versus x

Bits error versus y

Target

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

Derivation

  1. Initial program 14.4

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

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

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

    \[\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{y \cdot y}{\frac{x}{y \cdot \sin x}}, \frac{1}{6}, \mathsf{fma}\left(\frac{\sin x}{x}, y, \frac{\frac{1}{120} \cdot \sin x}{x} \cdot {y}^{5}\right)\right)}\]
  10. Final simplification0.7

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

Reproduce

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