(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)




Bits error versus x




Bits error versus y
Results
| Original | 13.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.4 |
Initial program 13.6
Simplified0.2
Applied egg-rr0.8
Applied egg-rr0.1
Applied egg-rr0.4
Final simplification0.4
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))