Average Error: 0.2 → 0.2
Time: 46.2s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\tan B \cdot \frac{1}{x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\tan B \cdot \frac{1}{x}}
double f(double B, double x) {
        double r1944564 = x;
        double r1944565 = 1.0;
        double r1944566 = B;
        double r1944567 = tan(r1944566);
        double r1944568 = r1944565 / r1944567;
        double r1944569 = r1944564 * r1944568;
        double r1944570 = -r1944569;
        double r1944571 = sin(r1944566);
        double r1944572 = r1944565 / r1944571;
        double r1944573 = r1944570 + r1944572;
        return r1944573;
}

double f(double B, double x) {
        double r1944574 = 1.0;
        double r1944575 = B;
        double r1944576 = sin(r1944575);
        double r1944577 = r1944574 / r1944576;
        double r1944578 = tan(r1944575);
        double r1944579 = 1.0;
        double r1944580 = x;
        double r1944581 = r1944579 / r1944580;
        double r1944582 = r1944578 * r1944581;
        double r1944583 = r1944574 / r1944582;
        double r1944584 = r1944577 - r1944583;
        return r1944584;
}

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{1 \cdot x}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-/l*0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}}\]
  5. Using strategy rm
  6. Applied div-inv0.2

    \[\leadsto \frac{1}{\sin B} - \frac{1}{\color{blue}{\tan B \cdot \frac{1}{x}}}\]
  7. Final simplification0.2

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))