Average Error: 0.2 → 0.2
Time: 35.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B
double f(double B, double x) {
        double r686966 = x;
        double r686967 = 1.0;
        double r686968 = B;
        double r686969 = tan(r686968);
        double r686970 = r686967 / r686969;
        double r686971 = r686966 * r686970;
        double r686972 = -r686971;
        double r686973 = sin(r686968);
        double r686974 = r686967 / r686973;
        double r686975 = r686972 + r686974;
        return r686975;
}

double f(double B, double x) {
        double r686976 = 1.0;
        double r686977 = B;
        double r686978 = sin(r686977);
        double r686979 = r686976 / r686978;
        double r686980 = x;
        double r686981 = r686980 / r686978;
        double r686982 = cos(r686977);
        double r686983 = r686981 * r686982;
        double r686984 = r686979 - r686983;
        return r686984;
}

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.1

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B}\]
  6. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]

Reproduce

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