| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 13120 |
\[\cos x \cdot \frac{\sinh y}{y}
\]
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y)))
(FPCore (x y) :precision binary64 (/ (cos x) (/ y (expm1 (log1p (sinh y))))))
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
double code(double x, double y) {
return cos(x) / (y / expm1(log1p(sinh(y))));
}
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
public static double code(double x, double y) {
return Math.cos(x) / (y / Math.expm1(Math.log1p(Math.sinh(y))));
}
def code(x, y): return math.cos(x) * (math.sinh(y) / y)
def code(x, y): return math.cos(x) / (y / math.expm1(math.log1p(math.sinh(y))))
function code(x, y) return Float64(cos(x) * Float64(sinh(y) / y)) end
function code(x, y) return Float64(cos(x) / Float64(y / expm1(log1p(sinh(y))))) end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] / N[(y / N[(Exp[N[Log[1 + N[Sinh[y], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\cos x \cdot \frac{\sinh y}{y}
\frac{\cos x}{\frac{y}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sinh y\right)\right)}}
Results
Initial program 0.0
Simplified0.0
Applied egg-rr0.3
Final simplification0.3
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 13120 |
| Alternative 3 | |
|---|---|
| Error | 0.7 |
| Cost | 6976 |
| Alternative 4 | |
|---|---|
| Error | 1.1 |
| Cost | 6464 |
| Alternative 5 | |
|---|---|
| Error | 29.6 |
| Cost | 1344 |
| Alternative 6 | |
|---|---|
| Error | 29.6 |
| Cost | 448 |
| Alternative 7 | |
|---|---|
| Error | 29.8 |
| Cost | 64 |
herbie shell --seed 2022338
(FPCore (x y)
:name "Linear.Quaternion:$csin from linear-1.19.1.3"
:precision binary64
(* (cos x) (/ (sinh y) y)))