Average Error: 0.2 → 0.2
Time: 6.4s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[1 \cdot \left(\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
1 \cdot \left(\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\right)
double f(double B, double x) {
        double r20453 = x;
        double r20454 = 1.0;
        double r20455 = B;
        double r20456 = tan(r20455);
        double r20457 = r20454 / r20456;
        double r20458 = r20453 * r20457;
        double r20459 = -r20458;
        double r20460 = sin(r20455);
        double r20461 = r20454 / r20460;
        double r20462 = r20459 + r20461;
        return r20462;
}

double f(double B, double x) {
        double r20463 = 1.0;
        double r20464 = 1.0;
        double r20465 = B;
        double r20466 = sin(r20465);
        double r20467 = r20464 / r20466;
        double r20468 = x;
        double r20469 = cos(r20465);
        double r20470 = r20466 / r20469;
        double r20471 = r20468 / r20470;
        double r20472 = r20467 - r20471;
        double r20473 = r20463 * r20472;
        return r20473;
}

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

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  3. Simplified0.2

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

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

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

Reproduce

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