Average Error: 0.2 → 0.2
Time: 33.8s
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 r1737528 = x;
        double r1737529 = 1.0;
        double r1737530 = B;
        double r1737531 = tan(r1737530);
        double r1737532 = r1737529 / r1737531;
        double r1737533 = r1737528 * r1737532;
        double r1737534 = -r1737533;
        double r1737535 = sin(r1737530);
        double r1737536 = r1737529 / r1737535;
        double r1737537 = r1737534 + r1737536;
        return r1737537;
}

double f(double B, double x) {
        double r1737538 = 1.0;
        double r1737539 = B;
        double r1737540 = sin(r1737539);
        double r1737541 = r1737538 / r1737540;
        double r1737542 = x;
        double r1737543 = r1737542 / r1737540;
        double r1737544 = cos(r1737539);
        double r1737545 = r1737543 * r1737544;
        double r1737546 = r1737541 - r1737545;
        return r1737546;
}

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