Average Error: 0.2 → 0.2
Time: 12.3s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{1}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right) + \frac{1}{\sin B}
double f(double B, double x) {
        double r55666 = x;
        double r55667 = 1.0;
        double r55668 = B;
        double r55669 = tan(r55668);
        double r55670 = r55667 / r55669;
        double r55671 = r55666 * r55670;
        double r55672 = -r55671;
        double r55673 = sin(r55668);
        double r55674 = r55667 / r55673;
        double r55675 = r55672 + r55674;
        return r55675;
}

double f(double B, double x) {
        double r55676 = 1.0;
        double r55677 = x;
        double r55678 = B;
        double r55679 = cos(r55678);
        double r55680 = r55677 * r55679;
        double r55681 = sin(r55678);
        double r55682 = r55680 / r55681;
        double r55683 = r55676 * r55682;
        double r55684 = -r55683;
        double r55685 = r55676 / r55681;
        double r55686 = r55684 + r55685;
        return r55686;
}

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. Taylor expanded around inf 0.2

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

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

Reproduce

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