Average Error: 0.2 → 0.2
Time: 24.3s
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 r1021744 = x;
        double r1021745 = 1.0;
        double r1021746 = B;
        double r1021747 = tan(r1021746);
        double r1021748 = r1021745 / r1021747;
        double r1021749 = r1021744 * r1021748;
        double r1021750 = -r1021749;
        double r1021751 = sin(r1021746);
        double r1021752 = r1021745 / r1021751;
        double r1021753 = r1021750 + r1021752;
        return r1021753;
}

double f(double B, double x) {
        double r1021754 = 1.0;
        double r1021755 = B;
        double r1021756 = sin(r1021755);
        double r1021757 = r1021754 / r1021756;
        double r1021758 = x;
        double r1021759 = r1021758 / r1021756;
        double r1021760 = cos(r1021755);
        double r1021761 = r1021759 * r1021760;
        double r1021762 = r1021757 - r1021761;
        return r1021762;
}

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