Average Error: 0.1 → 0.1
Time: 6.4s
Precision: binary64
\[\cosh x \cdot \frac{\sin y}{y} \]
\[\cosh x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right) \]
\cosh x \cdot \frac{\sin y}{y}
\cosh x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right)
(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
(FPCore (x y) :precision binary64 (* (cosh x) (expm1 (log1p (/ (sin y) y)))))
double code(double x, double y) {
	return cosh(x) * (sin(y) / y);
}
double code(double x, double y) {
	return cosh(x) * expm1(log1p(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.1
\[\frac{\cosh x \cdot \sin y}{y} \]

Derivation

  1. Initial program 0.1

    \[\cosh x \cdot \frac{\sin y}{y} \]
  2. Applied expm1-log1p-u_binary640.1

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

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

Reproduce

herbie shell --seed 2022081 
(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)))