Average Error: 0.2 → 0.2
Time: 13.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}
double f(double B, double x) {
        double r42523 = x;
        double r42524 = 1.0;
        double r42525 = B;
        double r42526 = tan(r42525);
        double r42527 = r42524 / r42526;
        double r42528 = r42523 * r42527;
        double r42529 = -r42528;
        double r42530 = sin(r42525);
        double r42531 = r42524 / r42530;
        double r42532 = r42529 + r42531;
        return r42532;
}

double f(double B, double x) {
        double r42533 = 1.0;
        double r42534 = B;
        double r42535 = sin(r42534);
        double r42536 = r42533 / r42535;
        double r42537 = 1.0;
        double r42538 = tan(r42534);
        double r42539 = x;
        double r42540 = r42539 * r42533;
        double r42541 = r42538 / r42540;
        double r42542 = r42537 / r42541;
        double r42543 = r42536 - r42542;
        return r42543;
}

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

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

Reproduce

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