Average Error: 0.2 → 0.2
Time: 26.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\]
\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 r333638 = x;
        double r333639 = 1.0;
        double r333640 = B;
        double r333641 = tan(r333640);
        double r333642 = r333639 / r333641;
        double r333643 = r333638 * r333642;
        double r333644 = -r333643;
        double r333645 = sin(r333640);
        double r333646 = r333639 / r333645;
        double r333647 = r333644 + r333646;
        return r333647;
}

double f(double B, double x) {
        double r333648 = 1.0;
        double r333649 = B;
        double r333650 = sin(r333649);
        double r333651 = r333648 / r333650;
        double r333652 = x;
        double r333653 = r333652 / r333650;
        double r333654 = cos(r333649);
        double r333655 = r333653 * r333654;
        double r333656 = r333651 - r333655;
        return r333656;
}

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))))