| Alternative 1 | |
|---|---|
| Error | 1.0 |
| Cost | 6464 |
\[\sin x
\]
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
(FPCore (x y) :precision binary64 (/ (sinh y) (/ y (sin x))))
double code(double x, double y) {
return sin(x) * (sinh(y) / y);
}
double code(double x, double y) {
return sinh(y) / (y / sin(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / y)
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sinh(y) / (y / sin(x))
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / y);
}
public static double code(double x, double y) {
return Math.sinh(y) / (y / Math.sin(x));
}
def code(x, y): return math.sin(x) * (math.sinh(y) / y)
def code(x, y): return math.sinh(y) / (y / math.sin(x))
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / y)) end
function code(x, y) return Float64(sinh(y) / Float64(y / sin(x))) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / y); end
function tmp = code(x, y) tmp = sinh(y) / (y / sin(x)); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Sinh[y], $MachinePrecision] / N[(y / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \frac{\sinh y}{y}
\frac{\sinh y}{\frac{y}{\sin x}}
Results
Initial program 0.0
Simplified0.2
Applied egg-rr0.2
Final simplification0.2
| Alternative 1 | |
|---|---|
| Error | 1.0 |
| Cost | 6464 |
| Alternative 2 | |
|---|---|
| Error | 31.6 |
| Cost | 576 |
| Alternative 3 | |
|---|---|
| Error | 31.9 |
| Cost | 64 |

herbie shell --seed 2022228
(FPCore (x y)
:name "Linear.Quaternion:$ccos from linear-1.19.1.3"
:precision binary64
(* (sin x) (/ (sinh y) y)))