Average Error: 0.2 → 0.2
Time: 5.8s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[1 \cdot \left(\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\right)\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
1 \cdot \left(\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\right)
double f(double B, double x) {
        double r12719 = x;
        double r12720 = 1.0;
        double r12721 = B;
        double r12722 = tan(r12721);
        double r12723 = r12720 / r12722;
        double r12724 = r12719 * r12723;
        double r12725 = -r12724;
        double r12726 = sin(r12721);
        double r12727 = r12720 / r12726;
        double r12728 = r12725 + r12727;
        return r12728;
}

double f(double B, double x) {
        double r12729 = 1.0;
        double r12730 = 1.0;
        double r12731 = B;
        double r12732 = sin(r12731);
        double r12733 = r12730 / r12732;
        double r12734 = x;
        double r12735 = cos(r12731);
        double r12736 = r12734 * r12735;
        double r12737 = r12736 / r12732;
        double r12738 = r12733 - r12737;
        double r12739 = r12729 * r12738;
        return r12739;
}

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

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B} - 1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  3. Simplified0.2

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

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

Reproduce

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