Average Error: 0.2 → 0.2
Time: 22.0s
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 r39347 = x;
        double r39348 = 1.0;
        double r39349 = B;
        double r39350 = tan(r39349);
        double r39351 = r39348 / r39350;
        double r39352 = r39347 * r39351;
        double r39353 = -r39352;
        double r39354 = sin(r39349);
        double r39355 = r39348 / r39354;
        double r39356 = r39353 + r39355;
        return r39356;
}

double f(double B, double x) {
        double r39357 = 1.0;
        double r39358 = x;
        double r39359 = B;
        double r39360 = cos(r39359);
        double r39361 = r39358 * r39360;
        double r39362 = r39357 * r39361;
        double r39363 = r39357 - r39362;
        double r39364 = sin(r39359);
        double r39365 = r39363 / r39364;
        return r39365;
}

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

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

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

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

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

Reproduce

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