Average Error: 0.2 → 0.2
Time: 4.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}
double f(double B, double x) {
        double r13272 = x;
        double r13273 = 1.0;
        double r13274 = B;
        double r13275 = tan(r13274);
        double r13276 = r13273 / r13275;
        double r13277 = r13272 * r13276;
        double r13278 = -r13277;
        double r13279 = sin(r13274);
        double r13280 = r13273 / r13279;
        double r13281 = r13278 + r13280;
        return r13281;
}

double f(double B, double x) {
        double r13282 = 1.0;
        double r13283 = B;
        double r13284 = sin(r13283);
        double r13285 = r13282 / r13284;
        double r13286 = x;
        double r13287 = r13286 * r13282;
        double r13288 = tan(r13283);
        double r13289 = r13287 / r13288;
        double r13290 = r13285 - r13289;
        return r13290;
}

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. Using strategy rm
  8. Applied *-un-lft-identity0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{1}{\frac{\tan B}{x \cdot 1}}}\]
  9. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B}} - 1 \cdot \frac{1}{\frac{\tan B}{x \cdot 1}}\]
  10. Applied distribute-lft-out--0.2

    \[\leadsto \color{blue}{1 \cdot \left(\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}\right)}\]
  11. Simplified0.2

    \[\leadsto 1 \cdot \color{blue}{\left(\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\right)}\]
  12. Final simplification0.2

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

Reproduce

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