Average Error: 0.2 → 0.2
Time: 20.8s
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 r49959 = x;
        double r49960 = 1.0;
        double r49961 = B;
        double r49962 = tan(r49961);
        double r49963 = r49960 / r49962;
        double r49964 = r49959 * r49963;
        double r49965 = -r49964;
        double r49966 = sin(r49961);
        double r49967 = r49960 / r49966;
        double r49968 = r49965 + r49967;
        return r49968;
}

double f(double B, double x) {
        double r49969 = 1.0;
        double r49970 = 1.0;
        double r49971 = B;
        double r49972 = sin(r49971);
        double r49973 = r49970 / r49972;
        double r49974 = x;
        double r49975 = cos(r49971);
        double r49976 = r49974 * r49975;
        double r49977 = r49976 / r49972;
        double r49978 = r49973 - r49977;
        double r49979 = r49969 * r49978;
        return r49979;
}

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