Average Error: 0.2 → 0.2
Time: 23.8s
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 r1777383 = x;
        double r1777384 = 1.0;
        double r1777385 = B;
        double r1777386 = tan(r1777385);
        double r1777387 = r1777384 / r1777386;
        double r1777388 = r1777383 * r1777387;
        double r1777389 = -r1777388;
        double r1777390 = sin(r1777385);
        double r1777391 = r1777384 / r1777390;
        double r1777392 = r1777389 + r1777391;
        return r1777392;
}

double f(double B, double x) {
        double r1777393 = 1.0;
        double r1777394 = B;
        double r1777395 = sin(r1777394);
        double r1777396 = r1777393 / r1777395;
        double r1777397 = x;
        double r1777398 = r1777397 / r1777395;
        double r1777399 = cos(r1777394);
        double r1777400 = r1777398 * r1777399;
        double r1777401 = r1777396 - r1777400;
        return r1777401;
}

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.1

    \[\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 2019158 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))