Average Error: 0.2 → 0.2
Time: 45.7s
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 r513525 = x;
        double r513526 = 1.0;
        double r513527 = B;
        double r513528 = tan(r513527);
        double r513529 = r513526 / r513528;
        double r513530 = r513525 * r513529;
        double r513531 = -r513530;
        double r513532 = sin(r513527);
        double r513533 = r513526 / r513532;
        double r513534 = r513531 + r513533;
        return r513534;
}

double f(double B, double x) {
        double r513535 = 1.0;
        double r513536 = B;
        double r513537 = sin(r513536);
        double r513538 = r513535 / r513537;
        double r513539 = x;
        double r513540 = r513539 / r513537;
        double r513541 = cos(r513536);
        double r513542 = r513540 * r513541;
        double r513543 = r513538 - r513542;
        return r513543;
}

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