Average Error: 0.2 → 0.1
Time: 5.7s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}
double f(double B, double x) {
        double r13234 = x;
        double r13235 = 1.0;
        double r13236 = B;
        double r13237 = tan(r13236);
        double r13238 = r13235 / r13237;
        double r13239 = r13234 * r13238;
        double r13240 = -r13239;
        double r13241 = sin(r13236);
        double r13242 = r13235 / r13241;
        double r13243 = r13240 + r13242;
        return r13243;
}

double f(double B, double x) {
        double r13244 = 1.0;
        double r13245 = B;
        double r13246 = sin(r13245);
        double r13247 = r13244 / r13246;
        double r13248 = x;
        double r13249 = r13248 * r13244;
        double r13250 = tan(r13245);
        double r13251 = r13249 / r13250;
        double r13252 = r13247 - r13251;
        return r13252;
}

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.1

    \[\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. Using strategy rm
  8. Applied *-un-lft-identity0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{1}{\frac{\tan B}{x \cdot 1}}}\]
  9. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{1 \cdot \frac{1}{\sin B}} - 1 \cdot \frac{1}{\frac{\tan B}{x \cdot 1}}\]
  10. Applied distribute-lft-out--0.2

    \[\leadsto \color{blue}{1 \cdot \left(\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x \cdot 1}}\right)}\]
  11. Simplified0.1

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

    \[\leadsto \frac{1}{\sin B} - \frac{x \cdot 1}{\tan B}\]

Reproduce

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