Average Error: 0.2 → 0.2
Time: 12.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\sin B}
double f(double B, double x) {
        double r14559 = x;
        double r14560 = 1.0;
        double r14561 = B;
        double r14562 = tan(r14561);
        double r14563 = r14560 / r14562;
        double r14564 = r14559 * r14563;
        double r14565 = -r14564;
        double r14566 = sin(r14561);
        double r14567 = r14560 / r14566;
        double r14568 = r14565 + r14567;
        return r14568;
}

double f(double B, double x) {
        double r14569 = 1.0;
        double r14570 = B;
        double r14571 = tan(r14570);
        double r14572 = x;
        double r14573 = 1.0;
        double r14574 = r14572 * r14573;
        double r14575 = r14571 / r14574;
        double r14576 = r14569 / r14575;
        double r14577 = -r14576;
        double r14578 = sin(r14570);
        double r14579 = r14573 / r14578;
        double r14580 = r14577 + r14579;
        return r14580;
}

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. Using strategy rm
  3. Applied associate-*r/0.2

    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{1}{\sin B}\]
  4. Using strategy rm
  5. Applied clear-num0.2

    \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x \cdot 1}}}\right) + \frac{1}{\sin B}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.2

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

    \[\leadsto \left(-\frac{1}{\frac{\tan B}{x \cdot 1}}\right) + \frac{1}{\sin B}\]

Reproduce

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