Average Error: 0.2 → 0.2
Time: 12.2s
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 r14146 = x;
        double r14147 = 1.0;
        double r14148 = B;
        double r14149 = tan(r14148);
        double r14150 = r14147 / r14149;
        double r14151 = r14146 * r14150;
        double r14152 = -r14151;
        double r14153 = sin(r14148);
        double r14154 = r14147 / r14153;
        double r14155 = r14152 + r14154;
        return r14155;
}

double f(double B, double x) {
        double r14156 = 1.0;
        double r14157 = x;
        double r14158 = B;
        double r14159 = cos(r14158);
        double r14160 = r14157 * r14159;
        double r14161 = sin(r14158);
        double r14162 = r14160 / r14161;
        double r14163 = r14156 * r14162;
        double r14164 = -r14163;
        double r14165 = r14156 / r14161;
        double r14166 = r14164 + r14165;
        return r14166;
}

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))))