Average Error: 0.1 → 0.1
Time: 8.3s
Precision: binary64
Cost: 13504
\[0 \leq e \land e \leq 1\]
\[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
\[\frac{1}{1 + \cos v \cdot e} \cdot \left(e \cdot \sin v\right) \]
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))
(FPCore (e v)
 :precision binary64
 (* (/ 1.0 (+ 1.0 (* (cos v) e))) (* e (sin v))))
double code(double e, double v) {
	return (e * sin(v)) / (1.0 + (e * cos(v)));
}
double code(double e, double v) {
	return (1.0 / (1.0 + (cos(v) * e))) * (e * sin(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 = (1.0d0 / (1.0d0 + (cos(v) * e))) * (e * sin(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 (1.0 / (1.0 + (Math.cos(v) * e))) * (e * Math.sin(v));
}
def code(e, v):
	return (e * math.sin(v)) / (1.0 + (e * math.cos(v)))
def code(e, v):
	return (1.0 / (1.0 + (math.cos(v) * e))) * (e * math.sin(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(Float64(1.0 / Float64(1.0 + Float64(cos(v) * e))) * Float64(e * sin(v)))
end
function tmp = code(e, v)
	tmp = (e * sin(v)) / (1.0 + (e * cos(v)));
end
function tmp = code(e, v)
	tmp = (1.0 / (1.0 + (cos(v) * e))) * (e * sin(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[(N[(1.0 / N[(1.0 + N[(N[Cos[v], $MachinePrecision] * e), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(e * N[Sin[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
\frac{1}{1 + \cos v \cdot e} \cdot \left(e \cdot \sin v\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{e}{\frac{1 + e \cdot \cos v}{\sin v}}} \]
    Proof

    [Start]0.1

    \[ \frac{e \cdot \sin v}{1 + e \cdot \cos v} \]

    associate-/l* [=>]0.3

    \[ \color{blue}{\frac{e}{\frac{1 + e \cdot \cos v}{\sin v}}} \]
  3. Applied egg-rr0.1

    \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(e, \cos v, 1\right)} \cdot \left(e \cdot \sin v\right)} \]
  4. Taylor expanded in v around inf 0.1

    \[\leadsto \color{blue}{\frac{1}{1 + \cos v \cdot e}} \cdot \left(e \cdot \sin v\right) \]
  5. Final simplification0.1

    \[\leadsto \frac{1}{1 + \cos v \cdot e} \cdot \left(e \cdot \sin v\right) \]

Alternatives

Alternative 1
Error0.7
Cost13376
\[\sin v \cdot \left(e - e \cdot \left(\cos v \cdot e\right)\right) \]
Alternative 2
Error0.3
Cost13376
\[\frac{e}{\frac{1 + \cos v \cdot e}{\sin v}} \]
Alternative 3
Error0.1
Cost13376
\[\frac{e \cdot \sin v}{1 + \cos v \cdot e} \]
Alternative 4
Error1.4
Cost6592
\[e \cdot \sin v \]
Alternative 5
Error30.4
Cost1344
\[\frac{e}{v \cdot \left(e \cdot -0.5 + -0.16666666666666666 \cdot \left(-1 - e\right)\right) + \left(\frac{e}{v} + \frac{1}{v}\right)} \]
Alternative 6
Error31.4
Cost448
\[v \cdot \left(e - e \cdot e\right) \]
Alternative 7
Error31.1
Cost448
\[v \cdot \frac{e}{1 + e} \]
Alternative 8
Error31.1
Cost448
\[\frac{v \cdot e}{1 + e} \]
Alternative 9
Error31.8
Cost192
\[v \cdot e \]
Alternative 10
Error61.1
Cost64
\[v \]

Error

Reproduce

herbie shell --seed 2023002 
(FPCore (e v)
  :name "Trigonometry A"
  :precision binary64
  :pre (and (<= 0.0 e) (<= e 1.0))
  (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))