Average Error: 0.2 → 0.2
Time: 16.5s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{\frac{1}{\tan B}}{\frac{1}{x \cdot 1}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{\frac{1}{\tan B}}{\frac{1}{x \cdot 1}}
double f(double B, double x) {
        double r46926 = x;
        double r46927 = 1.0;
        double r46928 = B;
        double r46929 = tan(r46928);
        double r46930 = r46927 / r46929;
        double r46931 = r46926 * r46930;
        double r46932 = -r46931;
        double r46933 = sin(r46928);
        double r46934 = r46927 / r46933;
        double r46935 = r46932 + r46934;
        return r46935;
}

double f(double B, double x) {
        double r46936 = 1.0;
        double r46937 = B;
        double r46938 = sin(r46937);
        double r46939 = r46936 / r46938;
        double r46940 = 1.0;
        double r46941 = tan(r46937);
        double r46942 = r46940 / r46941;
        double r46943 = x;
        double r46944 = r46943 * r46936;
        double r46945 = r46940 / r46944;
        double r46946 = r46942 / r46945;
        double r46947 = r46939 - r46946;
        return r46947;
}

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.2

    \[\leadsto \color{blue}{\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
  5. Using strategy rm
  6. Applied clear-num0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\]
  7. Using strategy rm
  8. Applied div-inv0.3

    \[\leadsto \frac{1}{\sin B} - \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x \cdot 1}}}\]
  9. Applied associate-/r*0.2

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

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

Reproduce

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