| Alternative 1 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 13120 |
\[\frac{\sin y \cdot \cosh x}{y}
\]

(FPCore (x y) :precision binary64 (* (cosh x) (/ (sin y) y)))
(FPCore (x y) :precision binary64 (/ (* (sin y) (cosh x)) y))
double code(double x, double y) {
return cosh(x) * (sin(y) / y);
}
double code(double x, double y) {
return (sin(y) * cosh(x)) / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cosh(x) * (sin(y) / y)
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(y) * cosh(x)) / y
end function
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.sin(y) * Math.cosh(x)) / y;
}
def code(x, y): return math.cosh(x) * (math.sin(y) / y)
def code(x, y): return (math.sin(y) * math.cosh(x)) / y
function code(x, y) return Float64(cosh(x) * Float64(sin(y) / y)) end
function code(x, y) return Float64(Float64(sin(y) * cosh(x)) / y) end
function tmp = code(x, y) tmp = cosh(x) * (sin(y) / y); end
function tmp = code(x, y) tmp = (sin(y) * cosh(x)) / y; end
code[x_, y_] := N[(N[Cosh[x], $MachinePrecision] * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(N[Sin[y], $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\cosh x \cdot \frac{\sin y}{y}
\frac{\sin y \cdot \cosh x}{y}
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
| Original | 99.9% |
|---|---|
| Target | 99.9% |
| Herbie | 99.9% |
Initial program 99.9%
Applied egg-rr99.9%
[Start]99.9% | \[ \cosh x \cdot \frac{\sin y}{y}
\] |
|---|---|
*-commutative [=>]99.9% | \[ \color{blue}{\frac{\sin y}{y} \cdot \cosh x}
\] |
associate-*l/ [=>]99.9% | \[ \color{blue}{\frac{\sin y \cdot \cosh x}{y}}
\] |
Final simplification99.9%
| Alternative 1 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Accuracy | 86.8% |
| Cost | 13124 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 13120 |
| Alternative 4 | |
|---|---|
| Accuracy | 93.2% |
| Cost | 7761 |
| Alternative 5 | |
|---|---|
| Accuracy | 62.4% |
| Cost | 6596 |
| Alternative 6 | |
|---|---|
| Accuracy | 32.4% |
| Cost | 448 |
| Alternative 7 | |
|---|---|
| Accuracy | 32.3% |
| Cost | 448 |
| Alternative 8 | |
|---|---|
| Accuracy | 26.7% |
| Cost | 64 |
herbie shell --seed 2023165
(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)))