Average Error: 0.2 → 0.2
Time: 13.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\frac{\sin B}{1 - x \cdot \cos B}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\frac{\sin B}{1 - x \cdot \cos B}}
double f(double B, double x) {
        double r39917 = x;
        double r39918 = 1.0;
        double r39919 = B;
        double r39920 = tan(r39919);
        double r39921 = r39918 / r39920;
        double r39922 = r39917 * r39921;
        double r39923 = -r39922;
        double r39924 = sin(r39919);
        double r39925 = r39918 / r39924;
        double r39926 = r39923 + r39925;
        return r39926;
}

double f(double B, double x) {
        double r39927 = 1.0;
        double r39928 = B;
        double r39929 = sin(r39928);
        double r39930 = 1.0;
        double r39931 = x;
        double r39932 = cos(r39928);
        double r39933 = r39931 * r39932;
        double r39934 = r39930 - r39933;
        double r39935 = r39929 / r39934;
        double r39936 = r39927 / r39935;
        return r39936;
}

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. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied tan-quot0.2

    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{\sin B}\]
  6. Applied associate-/r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\sin B} \cdot \cos B}\right) + \frac{1}{\sin B}\]
  7. Final simplification0.2

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

Reproduce

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