Average Error: 0.2 → 0.2
Time: 17.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{-1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{-1}{\frac{\sin B}{x \cdot 1}} \cdot \cos B + \frac{1}{\sin B}
double f(double B, double x) {
        double r39291 = x;
        double r39292 = 1.0;
        double r39293 = B;
        double r39294 = tan(r39293);
        double r39295 = r39292 / r39294;
        double r39296 = r39291 * r39295;
        double r39297 = -r39296;
        double r39298 = sin(r39293);
        double r39299 = r39292 / r39298;
        double r39300 = r39297 + r39299;
        return r39300;
}

double f(double B, double x) {
        double r39301 = -1.0;
        double r39302 = B;
        double r39303 = sin(r39302);
        double r39304 = x;
        double r39305 = 1.0;
        double r39306 = r39304 * r39305;
        double r39307 = r39303 / r39306;
        double r39308 = r39301 / r39307;
        double r39309 = cos(r39302);
        double r39310 = r39308 * r39309;
        double r39311 = r39305 / r39303;
        double r39312 = r39310 + r39311;
        return r39312;
}

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. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied tan-quot0.2

    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{\sin B}\]
  6. Applied associate-/r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\sin B} \cdot \cos B}\right) + \frac{1}{\sin B}\]
  7. Using strategy rm
  8. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\sin B}{x \cdot 1}}} \cdot \cos B\right) + \frac{1}{\sin B}\]
  9. Final simplification0.2

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

Reproduce

herbie shell --seed 2019326 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  :precision binary64
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))