Average Error: 0.1 → 0.2
Time: 5.7s
Precision: 64
\[\cosh x \cdot \frac{\sin y}{y}\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{\sin y}{y}\right)\right)\]
\cosh x \cdot \frac{\sin y}{y}
\mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{\sin y}{y}\right)\right)
double code(double x, double y) {
	return (cosh(x) * (sin(y) / y));
}
double code(double x, double y) {
	return expm1(log1p((cosh(x) * (sin(y) / y))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.2
\[\frac{\cosh x \cdot \sin y}{y}\]

Derivation

  1. Initial program 0.1

    \[\cosh x \cdot \frac{\sin y}{y}\]
  2. Using strategy rm
  3. Applied expm1-log1p-u0.2

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{\sin y}{y}\right)\right)}\]
  4. Final simplification0.2

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{\sin y}{y}\right)\right)\]

Reproduce

herbie shell --seed 2020057 +o rules:numerics
(FPCore (x y)
  :name "Linear.Quaternion:$csinh from linear-1.19.1.3"
  :precision binary64

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

  (* (cosh x) (/ (sin y) y)))