Average Error: 0.1 → 0.1
Time: 5.1s
Precision: binary64
\[\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)));
}
public static double code(double x, double y) {
	return Math.cosh(x) * (Math.sin(y) / y);
}
public static double code(double x, double y) {
	return Math.cosh(x) * Math.expm1(Math.log1p((Math.sin(y) / y)));
}
def code(x, y):
	return math.cosh(x) * (math.sin(y) / y)
def code(x, y):
	return math.cosh(x) * math.expm1(math.log1p((math.sin(y) / y)))
function code(x, y)
	return Float64(cosh(x) * Float64(sin(y) / y))
end
function code(x, y)
	return Float64(cosh(x) * expm1(log1p(Float64(sin(y) / y))))
end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(Exp[N[Log[1 + N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]
\cosh x \cdot \frac{\sin y}{y}
\cosh x \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sin y}{y}\right)\right)

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 egg-rr0.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 2022150 
(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)))