Average Error: 0.2 → 0.2
Time: 5.7s
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 r54044 = x;
        double r54045 = 1.0;
        double r54046 = B;
        double r54047 = tan(r54046);
        double r54048 = r54045 / r54047;
        double r54049 = r54044 * r54048;
        double r54050 = -r54049;
        double r54051 = sin(r54046);
        double r54052 = r54045 / r54051;
        double r54053 = r54050 + r54052;
        return r54053;
}

double f(double B, double x) {
        double r54054 = 1.0;
        double r54055 = 1.0;
        double r54056 = B;
        double r54057 = sin(r54056);
        double r54058 = r54055 / r54057;
        double r54059 = x;
        double r54060 = cos(r54056);
        double r54061 = r54059 * r54060;
        double r54062 = r54061 / r54057;
        double r54063 = r54058 - r54062;
        double r54064 = r54054 * r54063;
        return r54064;
}

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))))