Average Error: 0.2 → 0.2
Time: 12.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}
double f(double B, double x) {
        double r47852 = x;
        double r47853 = 1.0;
        double r47854 = B;
        double r47855 = tan(r47854);
        double r47856 = r47853 / r47855;
        double r47857 = r47852 * r47856;
        double r47858 = -r47857;
        double r47859 = sin(r47854);
        double r47860 = r47853 / r47859;
        double r47861 = r47858 + r47860;
        return r47861;
}

double f(double B, double x) {
        double r47862 = 1.0;
        double r47863 = x;
        double r47864 = B;
        double r47865 = cos(r47864);
        double r47866 = r47863 * r47865;
        double r47867 = r47862 * r47866;
        double r47868 = r47862 - r47867;
        double r47869 = sin(r47864);
        double r47870 = r47868 / r47869;
        return r47870;
}

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} - x \cdot \frac{1}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot 1}{\tan B}}\]
  5. Taylor expanded around inf 0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  6. Using strategy rm
  7. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1 \cdot \left(x \cdot \cos B\right)}{\sin B}}\]
  8. Applied sub-div0.2

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

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

Reproduce

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