| Alternative 1 | |
|---|---|
| Error | 0.7 |
| Cost | 6848 |
\[e \cdot \frac{\sin v}{1 + e}
\]
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))
(FPCore (e v) :precision binary64 (* e (/ (sin v) (+ 1.0 (* e (cos v))))))
double code(double e, double v) {
return (e * sin(v)) / (1.0 + (e * cos(v)));
}
double code(double e, double v) {
return e * (sin(v) / (1.0 + (e * cos(v))));
}
real(8) function code(e, v)
real(8), intent (in) :: e
real(8), intent (in) :: v
code = (e * sin(v)) / (1.0d0 + (e * cos(v)))
end function
real(8) function code(e, v)
real(8), intent (in) :: e
real(8), intent (in) :: v
code = e * (sin(v) / (1.0d0 + (e * cos(v))))
end function
public static double code(double e, double v) {
return (e * Math.sin(v)) / (1.0 + (e * Math.cos(v)));
}
public static double code(double e, double v) {
return e * (Math.sin(v) / (1.0 + (e * Math.cos(v))));
}
def code(e, v): return (e * math.sin(v)) / (1.0 + (e * math.cos(v)))
def code(e, v): return e * (math.sin(v) / (1.0 + (e * math.cos(v))))
function code(e, v) return Float64(Float64(e * sin(v)) / Float64(1.0 + Float64(e * cos(v)))) end
function code(e, v) return Float64(e * Float64(sin(v) / Float64(1.0 + Float64(e * cos(v))))) end
function tmp = code(e, v) tmp = (e * sin(v)) / (1.0 + (e * cos(v))); end
function tmp = code(e, v) tmp = e * (sin(v) / (1.0 + (e * cos(v)))); end
code[e_, v_] := N[(N[(e * N[Sin[v], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(e * N[Cos[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[e_, v_] := N[(e * N[(N[Sin[v], $MachinePrecision] / N[(1.0 + N[(e * N[Cos[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
e \cdot \frac{\sin v}{1 + e \cdot \cos v}
Results
Initial program 0.1
Simplified0.1
[Start]0.1 | \[ \frac{e \cdot \sin v}{1 + e \cdot \cos v}
\] |
|---|---|
rational.json-simplify-2 [=>]0.1 | \[ \frac{\color{blue}{\sin v \cdot e}}{1 + e \cdot \cos v}
\] |
rational.json-simplify-49 [=>]0.1 | \[ \color{blue}{e \cdot \frac{\sin v}{1 + e \cdot \cos v}}
\] |
Final simplification0.1
| Alternative 1 | |
|---|---|
| Error | 0.7 |
| Cost | 6848 |
| Alternative 2 | |
|---|---|
| Error | 1.4 |
| Cost | 6592 |
| Alternative 3 | |
|---|---|
| Error | 30.5 |
| Cost | 1344 |
| Alternative 4 | |
|---|---|
| Error | 30.8 |
| Cost | 1216 |
| Alternative 5 | |
|---|---|
| Error | 31.2 |
| Cost | 448 |
| Alternative 6 | |
|---|---|
| Error | 31.9 |
| Cost | 192 |
| Alternative 7 | |
|---|---|
| Error | 61.1 |
| Cost | 64 |
herbie shell --seed 2023067
(FPCore (e v)
:name "Trigonometry A"
:precision binary64
:pre (and (<= 0.0 e) (<= e 1.0))
(/ (* e (sin v)) (+ 1.0 (* e (cos v)))))