Average Error: 0.2 → 0.2
Time: 44.4s
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 r1302676 = x;
        double r1302677 = 1.0;
        double r1302678 = B;
        double r1302679 = tan(r1302678);
        double r1302680 = r1302677 / r1302679;
        double r1302681 = r1302676 * r1302680;
        double r1302682 = -r1302681;
        double r1302683 = sin(r1302678);
        double r1302684 = r1302677 / r1302683;
        double r1302685 = r1302682 + r1302684;
        return r1302685;
}

double f(double B, double x) {
        double r1302686 = 1.0;
        double r1302687 = B;
        double r1302688 = sin(r1302687);
        double r1302689 = r1302686 / r1302688;
        double r1302690 = x;
        double r1302691 = r1302690 / r1302688;
        double r1302692 = cos(r1302687);
        double r1302693 = r1302691 * r1302692;
        double r1302694 = r1302689 - r1302693;
        return r1302694;
}

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