Average Error: 0.2 → 0.2
Time: 1.7m
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 r1691164 = x;
        double r1691165 = 1.0;
        double r1691166 = B;
        double r1691167 = tan(r1691166);
        double r1691168 = r1691165 / r1691167;
        double r1691169 = r1691164 * r1691168;
        double r1691170 = -r1691169;
        double r1691171 = sin(r1691166);
        double r1691172 = r1691165 / r1691171;
        double r1691173 = r1691170 + r1691172;
        return r1691173;
}

double f(double B, double x) {
        double r1691174 = 1.0;
        double r1691175 = B;
        double r1691176 = sin(r1691175);
        double r1691177 = r1691174 / r1691176;
        double r1691178 = x;
        double r1691179 = r1691178 / r1691176;
        double r1691180 = cos(r1691175);
        double r1691181 = r1691179 * r1691180;
        double r1691182 = r1691177 - r1691181;
        return r1691182;
}

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