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 r1288347 = x;
        double r1288348 = 1.0;
        double r1288349 = B;
        double r1288350 = tan(r1288349);
        double r1288351 = r1288348 / r1288350;
        double r1288352 = r1288347 * r1288351;
        double r1288353 = -r1288352;
        double r1288354 = sin(r1288349);
        double r1288355 = r1288348 / r1288354;
        double r1288356 = r1288353 + r1288355;
        return r1288356;
}

double f(double B, double x) {
        double r1288357 = 1.0;
        double r1288358 = B;
        double r1288359 = sin(r1288358);
        double r1288360 = r1288357 / r1288359;
        double r1288361 = x;
        double r1288362 = r1288361 / r1288359;
        double r1288363 = cos(r1288358);
        double r1288364 = r1288362 * r1288363;
        double r1288365 = r1288360 - r1288364;
        return r1288365;
}

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))))