Average Error: 0.2 → 0.2
Time: 5.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\left(-\frac{1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B\right) + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\left(-\frac{1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B\right) + \frac{1}{\sin B}
double f(double B, double x) {
        double r13616 = x;
        double r13617 = 1.0;
        double r13618 = B;
        double r13619 = tan(r13618);
        double r13620 = r13617 / r13619;
        double r13621 = r13616 * r13620;
        double r13622 = -r13621;
        double r13623 = sin(r13618);
        double r13624 = r13617 / r13623;
        double r13625 = r13622 + r13624;
        return r13625;
}

double f(double B, double x) {
        double r13626 = 1.0;
        double r13627 = B;
        double r13628 = sin(r13627);
        double r13629 = x;
        double r13630 = 1.0;
        double r13631 = r13629 * r13630;
        double r13632 = r13628 / r13631;
        double r13633 = r13626 / r13632;
        double r13634 = cos(r13627);
        double r13635 = r13633 * r13634;
        double r13636 = -r13635;
        double r13637 = r13630 / r13628;
        double r13638 = r13636 + r13637;
        return r13638;
}

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. Using strategy rm
  3. Applied tan-quot0.2

    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{\sin B}\]
  4. Applied associate-/r/0.3

    \[\leadsto \left(-x \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \cos B\right)}\right) + \frac{1}{\sin B}\]
  5. Applied associate-*r*0.2

    \[\leadsto \left(-\color{blue}{\left(x \cdot \frac{1}{\sin B}\right) \cdot \cos B}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\sin B}} \cdot \cos B\right) + \frac{1}{\sin B}\]
  8. Using strategy rm
  9. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\sin B}{x \cdot 1}}} \cdot \cos B\right) + \frac{1}{\sin B}\]
  10. Final simplification0.2

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

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))