Average Error: 0.2 → 0.2
Time: 14.6s
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 r18452 = x;
        double r18453 = 1.0;
        double r18454 = B;
        double r18455 = tan(r18454);
        double r18456 = r18453 / r18455;
        double r18457 = r18452 * r18456;
        double r18458 = -r18457;
        double r18459 = sin(r18454);
        double r18460 = r18453 / r18459;
        double r18461 = r18458 + r18460;
        return r18461;
}

double f(double B, double x) {
        double r18462 = 1.0;
        double r18463 = B;
        double r18464 = sin(r18463);
        double r18465 = r18462 / r18464;
        double r18466 = -1.0;
        double r18467 = tan(r18463);
        double r18468 = x;
        double r18469 = r18468 * r18462;
        double r18470 = r18467 / r18469;
        double r18471 = r18466 / r18470;
        double r18472 = r18465 + r18471;
        return r18472;
}

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

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. 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))))