Average Error: 0.2 → 0.2
Time: 11.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}
double f(double B, double x) {
        double r59039 = x;
        double r59040 = 1.0;
        double r59041 = B;
        double r59042 = tan(r59041);
        double r59043 = r59040 / r59042;
        double r59044 = r59039 * r59043;
        double r59045 = -r59044;
        double r59046 = sin(r59041);
        double r59047 = r59040 / r59046;
        double r59048 = r59045 + r59047;
        return r59048;
}

double f(double B, double x) {
        double r59049 = 1.0;
        double r59050 = x;
        double r59051 = B;
        double r59052 = cos(r59051);
        double r59053 = r59050 * r59052;
        double r59054 = r59049 * r59053;
        double r59055 = r59049 - r59054;
        double r59056 = sin(r59051);
        double r59057 = r59055 / r59056;
        return r59057;
}

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. Taylor expanded around inf 0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  8. Using strategy rm
  9. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1 \cdot \left(x \cdot \cos B\right)}{\sin B}}\]
  10. Applied sub-div0.2

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

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

Reproduce

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