?

Average Error: 15.2 → 15.2
Time: 18.7s
Precision: binary64
Cost: 13248

?

\[r \cdot \frac{\sin b}{\cos \left(a + b\right)} \]
\[\frac{\sin b \cdot r}{\cos \left(b + a\right)} \]
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos (+ a b)))))
(FPCore (r a b) :precision binary64 (/ (* (sin b) r) (cos (+ b a))))
double code(double r, double a, double b) {
	return r * (sin(b) / cos((a + b)));
}
double code(double r, double a, double b) {
	return (sin(b) * r) / cos((b + a));
}
real(8) function code(r, a, b)
    real(8), intent (in) :: r
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = r * (sin(b) / cos((a + b)))
end function
real(8) function code(r, a, b)
    real(8), intent (in) :: r
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (sin(b) * r) / cos((b + a))
end function
public static double code(double r, double a, double b) {
	return r * (Math.sin(b) / Math.cos((a + b)));
}
public static double code(double r, double a, double b) {
	return (Math.sin(b) * r) / Math.cos((b + a));
}
def code(r, a, b):
	return r * (math.sin(b) / math.cos((a + b)))
def code(r, a, b):
	return (math.sin(b) * r) / math.cos((b + a))
function code(r, a, b)
	return Float64(r * Float64(sin(b) / cos(Float64(a + b))))
end
function code(r, a, b)
	return Float64(Float64(sin(b) * r) / cos(Float64(b + a)))
end
function tmp = code(r, a, b)
	tmp = r * (sin(b) / cos((a + b)));
end
function tmp = code(r, a, b)
	tmp = (sin(b) * r) / cos((b + a));
end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
\frac{\sin b \cdot r}{\cos \left(b + a\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 15.2

    \[r \cdot \frac{\sin b}{\cos \left(a + b\right)} \]
  2. Simplified15.2

    \[\leadsto \color{blue}{\frac{\sin b \cdot r}{\cos \left(b + a\right)}} \]
    Proof

    [Start]15.2

    \[ r \cdot \frac{\sin b}{\cos \left(a + b\right)} \]

    rational.json-simplify-48 [=>]15.2

    \[ \color{blue}{\frac{\sin b \cdot r}{\cos \left(a + b\right)}} \]

    rational.json-simplify-1 [=>]15.2

    \[ \frac{\sin b \cdot r}{\cos \color{blue}{\left(b + a\right)}} \]
  3. Final simplification15.2

    \[\leadsto \frac{\sin b \cdot r}{\cos \left(b + a\right)} \]

Alternatives

Alternative 1
Error15.4
Cost13384
\[\begin{array}{l} t_0 := r \cdot \frac{\sin b}{\cos a}\\ \mathbf{if}\;a \leq -10:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1700:\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error15.4
Cost13384
\[\begin{array}{l} t_0 := \frac{r}{\cos a} \cdot \sin b\\ \mathbf{if}\;a \leq -10:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1700:\\ \;\;\;\;r \cdot \frac{\sin b}{\cos b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error15.4
Cost13384
\[\begin{array}{l} t_0 := \frac{r}{\cos a} \cdot \sin b\\ \mathbf{if}\;a \leq -10:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1700:\\ \;\;\;\;\frac{r}{\cos b} \cdot \sin b\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error15.4
Cost13384
\[\begin{array}{l} t_0 := \frac{r}{\cos a} \cdot \sin b\\ \mathbf{if}\;a \leq -10:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1700:\\ \;\;\;\;\frac{\sin b \cdot r}{\cos b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error15.2
Cost13248
\[r \cdot \frac{\sin b}{\cos \left(a + b\right)} \]
Alternative 6
Error15.2
Cost13248
\[\frac{r}{\cos \left(b + a\right)} \cdot \sin b \]
Alternative 7
Error28.2
Cost13120
\[r \cdot \frac{\sin b}{\cos a} \]
Alternative 8
Error28.1
Cost6984
\[\begin{array}{l} t_0 := \sin b \cdot r\\ \mathbf{if}\;b \leq -1550:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 0.94:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error38.8
Cost6592
\[\sin b \cdot r \]
Alternative 10
Error41.6
Cost192
\[b \cdot r \]

Error

Reproduce?

herbie shell --seed 2023073 
(FPCore (r a b)
  :name "rsin B (should all be same)"
  :precision binary64
  (* r (/ (sin b) (cos (+ a b)))))