Average Error: 0.2 → 0.2
Time: 35.1s
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\]
double f(double B, double x) {
        double r647949 = x;
        double r647950 = 1.0;
        double r647951 = B;
        double r647952 = tan(r647951);
        double r647953 = r647950 / r647952;
        double r647954 = r647949 * r647953;
        double r647955 = -r647954;
        double r647956 = sin(r647951);
        double r647957 = r647950 / r647956;
        double r647958 = r647955 + r647957;
        return r647958;
}

double f(double B, double x) {
        double r647959 = 1.0;
        double r647960 = B;
        double r647961 = sin(r647960);
        double r647962 = r647959 / r647961;
        double r647963 = x;
        double r647964 = r647963 / r647961;
        double r647965 = cos(r647960);
        double r647966 = r647964 * r647965;
        double r647967 = r647962 - r647966;
        return r647967;
}

\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B

Error

Bits error versus B

Bits error versus x

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