Average Error: 0.2 → 0.2
Time: 5.3s
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 r52309 = x;
        double r52310 = 1.0;
        double r52311 = B;
        double r52312 = tan(r52311);
        double r52313 = r52310 / r52312;
        double r52314 = r52309 * r52313;
        double r52315 = -r52314;
        double r52316 = sin(r52311);
        double r52317 = r52310 / r52316;
        double r52318 = r52315 + r52317;
        return r52318;
}

double f(double B, double x) {
        double r52319 = 1.0;
        double r52320 = B;
        double r52321 = sin(r52320);
        double r52322 = r52319 / r52321;
        double r52323 = 1.0;
        double r52324 = tan(r52320);
        double r52325 = x;
        double r52326 = r52325 * r52319;
        double r52327 = r52324 / r52326;
        double r52328 = r52323 / r52327;
        double r52329 = r52322 - r52328;
        return r52329;
}

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