Average Error: 0.2 → 0.2
Time: 28.4s
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 r844863 = x;
        double r844864 = 1.0;
        double r844865 = B;
        double r844866 = tan(r844865);
        double r844867 = r844864 / r844866;
        double r844868 = r844863 * r844867;
        double r844869 = -r844868;
        double r844870 = sin(r844865);
        double r844871 = r844864 / r844870;
        double r844872 = r844869 + r844871;
        return r844872;
}

double f(double B, double x) {
        double r844873 = 1.0;
        double r844874 = B;
        double r844875 = sin(r844874);
        double r844876 = r844873 / r844875;
        double r844877 = x;
        double r844878 = r844877 / r844875;
        double r844879 = cos(r844874);
        double r844880 = r844878 * r844879;
        double r844881 = r844876 - r844880;
        return r844881;
}

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 2019164 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))