Average Error: 0.2 → 0.2
Time: 23.9s
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 r32554 = x;
        double r32555 = 1.0;
        double r32556 = B;
        double r32557 = tan(r32556);
        double r32558 = r32555 / r32557;
        double r32559 = r32554 * r32558;
        double r32560 = -r32559;
        double r32561 = sin(r32556);
        double r32562 = r32555 / r32561;
        double r32563 = r32560 + r32562;
        return r32563;
}

double f(double B, double x) {
        double r32564 = 1.0;
        double r32565 = B;
        double r32566 = sin(r32565);
        double r32567 = r32564 / r32566;
        double r32568 = 1.0;
        double r32569 = tan(r32565);
        double r32570 = r32568 / r32569;
        double r32571 = x;
        double r32572 = r32571 * r32564;
        double r32573 = r32568 / r32572;
        double r32574 = r32570 / r32573;
        double r32575 = r32567 - r32574;
        return r32575;
}

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