?

Average Error: 99.7% → 99.8%
Time: 19.2s
Precision: binary64
Cost: 13248.00

?

\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
\[\frac{1}{\sin B} - \frac{x}{\tan B} \]
(FPCore (B x)
 :precision binary64
 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
(FPCore (B x) :precision binary64 (- (/ 1.0 (sin B)) (/ x (tan B))))
double code(double B, double x) {
	return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
double code(double B, double x) {
	return (1.0 / sin(B)) - (x / tan(B));
}
real(8) function code(b, x)
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
end function
real(8) function code(b, x)
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (1.0d0 / sin(b)) - (x / tan(b))
end function
public static double code(double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
public static double code(double B, double x) {
	return (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
def code(B, x):
	return -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
def code(B, x):
	return (1.0 / math.sin(B)) - (x / math.tan(B))
function code(B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B)))
end
function code(B, x)
	return Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B)))
end
function tmp = code(B, x)
	tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B));
end
function tmp = code(B, x)
	tmp = (1.0 / sin(B)) - (x / tan(B));
end
code[B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[B_, x_] := N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\tan B}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.7

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]
  2. Simplified99.8

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}} \]
    Proof

    [Start]99.7

    \[ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B} \]

    +-commutative [=>]99.7

    \[ \color{blue}{\frac{1}{\sin B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]

    unsub-neg [=>]99.7

    \[ \color{blue}{\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}} \]

    associate-*r/ [=>]99.8

    \[ \frac{1}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}} \]

    *-rgt-identity [=>]99.8

    \[ \frac{1}{\sin B} - \frac{\color{blue}{x}}{\tan B} \]
  3. Final simplification99.8

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\tan B} \]

Alternatives

Alternative 1
Error98.2%
Cost13449.00
\[\begin{array}{l} \mathbf{if}\;x \leq -36000000000 \lor \neg \left(x \leq 145000000\right):\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + x \cdot \frac{-1}{B}\\ \end{array} \]
Alternative 2
Error98.2%
Cost13448.00
\[\begin{array}{l} \mathbf{if}\;x \leq -36000000000:\\ \;\;\;\;\frac{\frac{1}{x} + -1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;x \leq 5800000:\\ \;\;\;\;\frac{1}{\sin B} + x \cdot \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \end{array} \]
Alternative 3
Error98.1%
Cost13448.00
\[\begin{array}{l} \mathbf{if}\;x \leq -36000000000:\\ \;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\ \mathbf{elif}\;x \leq 19000000:\\ \;\;\;\;\frac{1}{\sin B} + x \cdot \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \end{array} \]
Alternative 4
Error98.3%
Cost7241.00
\[\begin{array}{l} \mathbf{if}\;x \leq -36000000000 \lor \neg \left(x \leq 1.15\right):\\ \;\;\;\;\frac{\frac{1}{x} + -1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
Alternative 5
Error98.3%
Cost7241.00
\[\begin{array}{l} \mathbf{if}\;x \leq -36000000000 \lor \neg \left(x \leq 1.2\right):\\ \;\;\;\;\frac{\frac{1}{x} + -1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + x \cdot \frac{-1}{B}\\ \end{array} \]
Alternative 6
Error72.3%
Cost6985.00
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1.5\right):\\ \;\;\;\;\frac{-1}{\frac{\sin B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
Alternative 7
Error71.1%
Cost6857.00
\[\begin{array}{l} \mathbf{if}\;B \leq -0.0135 \lor \neg \left(B \leq 0.000215\right):\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \]
Alternative 8
Error71.4%
Cost6848.00
\[\frac{1}{\sin B} - \frac{x}{B} \]
Alternative 9
Error44.6%
Cost576.00
\[\frac{1 - x}{B} + B \cdot 0.16666666666666666 \]
Alternative 10
Error43.1%
Cost521.00
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
Alternative 11
Error44.3%
Cost320.00
\[\frac{1 - x}{B} \]
Alternative 12
Error30.0%
Cost192.00
\[\frac{1}{B} \]

Error

Reproduce?

herbie shell --seed 2023093 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))