Average Error: 0.2 → 0.2
Time: 21.6s
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 r26044 = x;
        double r26045 = 1.0;
        double r26046 = B;
        double r26047 = tan(r26046);
        double r26048 = r26045 / r26047;
        double r26049 = r26044 * r26048;
        double r26050 = -r26049;
        double r26051 = sin(r26046);
        double r26052 = r26045 / r26051;
        double r26053 = r26050 + r26052;
        return r26053;
}

double f(double B, double x) {
        double r26054 = 1.0;
        double r26055 = 1.0;
        double r26056 = B;
        double r26057 = sin(r26056);
        double r26058 = r26055 / r26057;
        double r26059 = x;
        double r26060 = cos(r26056);
        double r26061 = r26059 * r26060;
        double r26062 = r26061 / r26057;
        double r26063 = r26058 - r26062;
        double r26064 = r26054 * r26063;
        return r26064;
}

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 2019323 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))