Average Error: 0.2 → 0.2
Time: 35.2s
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\]
double f(double B, double x) {
        double r1875437 = x;
        double r1875438 = 1.0;
        double r1875439 = B;
        double r1875440 = tan(r1875439);
        double r1875441 = r1875438 / r1875440;
        double r1875442 = r1875437 * r1875441;
        double r1875443 = -r1875442;
        double r1875444 = sin(r1875439);
        double r1875445 = r1875438 / r1875444;
        double r1875446 = r1875443 + r1875445;
        return r1875446;
}

double f(double B, double x) {
        double r1875447 = 1.0;
        double r1875448 = B;
        double r1875449 = sin(r1875448);
        double r1875450 = r1875447 / r1875449;
        double r1875451 = x;
        double r1875452 = r1875451 / r1875449;
        double r1875453 = cos(r1875448);
        double r1875454 = r1875452 * r1875453;
        double r1875455 = r1875450 - r1875454;
        return r1875455;
}

\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B

Error

Bits error versus B

Bits error versus x

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