Average Error: 0.2 → 0.2
Time: 31.3s
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 r550944 = x;
        double r550945 = 1.0;
        double r550946 = B;
        double r550947 = tan(r550946);
        double r550948 = r550945 / r550947;
        double r550949 = r550944 * r550948;
        double r550950 = -r550949;
        double r550951 = sin(r550946);
        double r550952 = r550945 / r550951;
        double r550953 = r550950 + r550952;
        return r550953;
}

double f(double B, double x) {
        double r550954 = 1.0;
        double r550955 = B;
        double r550956 = sin(r550955);
        double r550957 = r550954 / r550956;
        double r550958 = x;
        double r550959 = r550958 / r550956;
        double r550960 = cos(r550955);
        double r550961 = r550959 * r550960;
        double r550962 = r550957 - r550961;
        return r550962;
}

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