Average Error: 0.2 → 0.2
Time: 6.0s
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 r15880 = x;
        double r15881 = 1.0;
        double r15882 = B;
        double r15883 = tan(r15882);
        double r15884 = r15881 / r15883;
        double r15885 = r15880 * r15884;
        double r15886 = -r15885;
        double r15887 = sin(r15882);
        double r15888 = r15881 / r15887;
        double r15889 = r15886 + r15888;
        return r15889;
}

double f(double B, double x) {
        double r15890 = 1.0;
        double r15891 = x;
        double r15892 = B;
        double r15893 = cos(r15892);
        double r15894 = r15891 * r15893;
        double r15895 = r15890 * r15894;
        double r15896 = r15890 - r15895;
        double r15897 = sin(r15892);
        double r15898 = r15896 / r15897;
        return r15898;
}

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

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

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

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

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

Reproduce

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