Average Error: 0.2 → 0.2
Time: 25.9s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B
double f(double B, double x) {
        double r814410 = x;
        double r814411 = 1.0;
        double r814412 = B;
        double r814413 = tan(r814412);
        double r814414 = r814411 / r814413;
        double r814415 = r814410 * r814414;
        double r814416 = -r814415;
        double r814417 = sin(r814412);
        double r814418 = r814411 / r814417;
        double r814419 = r814416 + r814418;
        return r814419;
}

double f(double B, double x) {
        double r814420 = 1.0;
        double r814421 = B;
        double r814422 = sin(r814421);
        double r814423 = r814420 / r814422;
        double r814424 = x;
        double r814425 = r814424 / r814422;
        double r814426 = cos(r814421);
        double r814427 = r814425 * r814426;
        double r814428 = r814423 - r814427;
        return r814428;
}

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} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

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

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

Reproduce

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