Average Error: 0.2 → 0.2
Time: 1.8m
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 r545937 = x;
        double r545938 = 1.0;
        double r545939 = B;
        double r545940 = tan(r545939);
        double r545941 = r545938 / r545940;
        double r545942 = r545937 * r545941;
        double r545943 = -r545942;
        double r545944 = sin(r545939);
        double r545945 = r545938 / r545944;
        double r545946 = r545943 + r545945;
        return r545946;
}

double f(double B, double x) {
        double r545947 = 1.0;
        double r545948 = B;
        double r545949 = sin(r545948);
        double r545950 = r545947 / r545949;
        double r545951 = x;
        double r545952 = r545951 / r545949;
        double r545953 = cos(r545948);
        double r545954 = r545952 * r545953;
        double r545955 = r545950 - r545954;
        return r545955;
}

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