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

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

Derivation

  1. Initial program 13.6

    \[\frac{\sin x \cdot \sinh y}{x} \]
  2. Simplified0.2

    \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{x}} \]
  3. Applied egg-rr0.8

    \[\leadsto \color{blue}{\frac{\sin x}{\frac{x}{\sinh y}}} \]
  4. Applied egg-rr0.1

    \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{x}} \]
  5. Applied egg-rr0.4

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

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

Reproduce

herbie shell --seed 2022151 
(FPCore (x y)
  :name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
  :precision binary64

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

  (/ (* (sin x) (sinh y)) x))