Average Error: 0.2 → 0.2
Time: 25.5s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B
double f(double B, double x) {
        double r801739 = x;
        double r801740 = 1.0;
        double r801741 = B;
        double r801742 = tan(r801741);
        double r801743 = r801740 / r801742;
        double r801744 = r801739 * r801743;
        double r801745 = -r801744;
        double r801746 = sin(r801741);
        double r801747 = r801740 / r801746;
        double r801748 = r801745 + r801747;
        return r801748;
}

double f(double B, double x) {
        double r801749 = 1.0;
        double r801750 = B;
        double r801751 = sin(r801750);
        double r801752 = r801749 / r801751;
        double r801753 = x;
        double r801754 = r801753 / r801751;
        double r801755 = cos(r801750);
        double r801756 = r801754 * r801755;
        double r801757 = r801752 - r801756;
        return r801757;
}

Error

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

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

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B}\]
  6. Final simplification0.2

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

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))