Average Error: 0.2 → 0.2
Time: 5.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[0 - \left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
0 - \left(\frac{x \cdot 1}{\tan B} - \frac{1}{\sin B}\right)
double f(double B, double x) {
        double r13541 = x;
        double r13542 = 1.0;
        double r13543 = B;
        double r13544 = tan(r13543);
        double r13545 = r13542 / r13544;
        double r13546 = r13541 * r13545;
        double r13547 = -r13546;
        double r13548 = sin(r13543);
        double r13549 = r13542 / r13548;
        double r13550 = r13547 + r13549;
        return r13550;
}

double f(double B, double x) {
        double r13551 = 0.0;
        double r13552 = x;
        double r13553 = 1.0;
        double r13554 = r13552 * r13553;
        double r13555 = B;
        double r13556 = tan(r13555);
        double r13557 = r13554 / r13556;
        double r13558 = sin(r13555);
        double r13559 = r13553 / r13558;
        double r13560 = r13557 - r13559;
        double r13561 = r13551 - r13560;
        return r13561;
}

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 associate-*r/0.2

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

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied neg-sub00.2

    \[\leadsto \color{blue}{\left(0 - \frac{1}{\frac{\tan B}{x \cdot 1}}\right)} + \frac{1}{\sin B}\]
  8. Applied associate-+l-0.2

    \[\leadsto \color{blue}{0 - \left(\frac{1}{\frac{\tan B}{x \cdot 1}} - \frac{1}{\sin B}\right)}\]
  9. Simplified0.2

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

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

Reproduce

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