Average Error: 0.2 → 0.2
Time: 22.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}
double f(double B, double x) {
        double r2076385 = x;
        double r2076386 = 1.0;
        double r2076387 = B;
        double r2076388 = tan(r2076387);
        double r2076389 = r2076386 / r2076388;
        double r2076390 = r2076385 * r2076389;
        double r2076391 = -r2076390;
        double r2076392 = sin(r2076387);
        double r2076393 = r2076386 / r2076392;
        double r2076394 = r2076391 + r2076393;
        return r2076394;
}

double f(double B, double x) {
        double r2076395 = 1.0;
        double r2076396 = B;
        double r2076397 = sin(r2076396);
        double r2076398 = r2076395 / r2076397;
        double r2076399 = 1.0;
        double r2076400 = tan(r2076396);
        double r2076401 = x;
        double r2076402 = r2076395 * r2076401;
        double r2076403 = r2076400 / r2076402;
        double r2076404 = r2076399 / r2076403;
        double r2076405 = r2076398 - r2076404;
        return r2076405;
}

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 \cdot 1}{\tan B}}\]
  3. Using strategy rm
  4. Applied clear-num0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\]
  5. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]

Reproduce

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