Average Error: 0.2 → 0.2
Time: 5.1s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1 - 1 \cdot \left(x \cdot \cos B\right)}{\sin B}
double f(double B, double x) {
        double r11601 = x;
        double r11602 = 1.0;
        double r11603 = B;
        double r11604 = tan(r11603);
        double r11605 = r11602 / r11604;
        double r11606 = r11601 * r11605;
        double r11607 = -r11606;
        double r11608 = sin(r11603);
        double r11609 = r11602 / r11608;
        double r11610 = r11607 + r11609;
        return r11610;
}

double f(double B, double x) {
        double r11611 = 1.0;
        double r11612 = x;
        double r11613 = B;
        double r11614 = cos(r11613);
        double r11615 = r11612 * r11614;
        double r11616 = r11611 * r11615;
        double r11617 = r11611 - r11616;
        double r11618 = sin(r11613);
        double r11619 = r11617 / r11618;
        return r11619;
}

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

    \[\leadsto \frac{1}{\sin B} - \color{blue}{1 \cdot \frac{x \cdot \cos B}{\sin B}}\]
  4. Using strategy rm
  5. Applied associate-*r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1 \cdot \left(x \cdot \cos B\right)}{\sin B}}\]
  6. Applied sub-div0.2

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

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

Reproduce

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