Average Error: 0.2 → 0.1
Time: 5.4s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[0 - \left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
0 - \left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)
double f(double B, double x) {
        double r37969 = x;
        double r37970 = 1.0;
        double r37971 = B;
        double r37972 = tan(r37971);
        double r37973 = r37970 / r37972;
        double r37974 = r37969 * r37973;
        double r37975 = -r37974;
        double r37976 = sin(r37971);
        double r37977 = r37970 / r37976;
        double r37978 = r37975 + r37977;
        return r37978;
}

double f(double B, double x) {
        double r37979 = 0.0;
        double r37980 = x;
        double r37981 = 1.0;
        double r37982 = r37980 * r37981;
        double r37983 = B;
        double r37984 = tan(r37983);
        double r37985 = r37982 / r37984;
        double r37986 = sin(r37983);
        double r37987 = r37981 / r37986;
        double r37988 = r37985 - r37987;
        double r37989 = r37979 - r37988;
        return r37989;
}

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

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

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied neg-sub00.2

    \[\leadsto \color{blue}{\left(0 - \frac{1}{\frac{\tan B}{x \cdot 1}}\right)} + \frac{1}{\sin B}\]
  8. Applied associate-+l-0.2

    \[\leadsto \color{blue}{0 - \left(\frac{1}{\frac{\tan B}{x \cdot 1}} - \frac{1}{\sin B}\right)}\]
  9. Simplified0.1

    \[\leadsto 0 - \color{blue}{\left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)}\]
  10. Final simplification0.1

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

Reproduce

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