Average Error: 0.2 → 0.2
Time: 6.0s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[1 \cdot \left(\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
1 \cdot \left(\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\right)
double f(double B, double x) {
        double r14389 = x;
        double r14390 = 1.0;
        double r14391 = B;
        double r14392 = tan(r14391);
        double r14393 = r14390 / r14392;
        double r14394 = r14389 * r14393;
        double r14395 = -r14394;
        double r14396 = sin(r14391);
        double r14397 = r14390 / r14396;
        double r14398 = r14395 + r14397;
        return r14398;
}

double f(double B, double x) {
        double r14399 = 1.0;
        double r14400 = 1.0;
        double r14401 = B;
        double r14402 = sin(r14401);
        double r14403 = r14400 / r14402;
        double r14404 = x;
        double r14405 = cos(r14401);
        double r14406 = r14404 * r14405;
        double r14407 = r14406 / r14402;
        double r14408 = r14403 - r14407;
        double r14409 = r14399 * r14408;
        return r14409;
}

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. Taylor expanded around inf 0.2

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  3. Simplified0.2

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

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

Reproduce

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