Average Error: 0.2 → 0.2
Time: 11.6s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}
double f(double B, double x) {
        double r41311 = x;
        double r41312 = 1.0;
        double r41313 = B;
        double r41314 = tan(r41313);
        double r41315 = r41312 / r41314;
        double r41316 = r41311 * r41315;
        double r41317 = -r41316;
        double r41318 = sin(r41313);
        double r41319 = r41312 / r41318;
        double r41320 = r41317 + r41319;
        return r41320;
}

double f(double B, double x) {
        double r41321 = 1.0;
        double r41322 = B;
        double r41323 = sin(r41322);
        double r41324 = r41321 / r41323;
        double r41325 = 1.0;
        double r41326 = tan(r41322);
        double r41327 = x;
        double r41328 = r41327 * r41321;
        double r41329 = r41326 / r41328;
        double r41330 = r41325 / r41329;
        double r41331 = r41324 - r41330;
        return r41331;
}

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

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

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

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

Reproduce

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