Average Error: 0.2 → 0.3
Time: 17.4s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\frac{\sin B}{1 - x \cdot \cos B}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\frac{\sin B}{1 - x \cdot \cos B}}
double f(double B, double x) {
        double r25688 = x;
        double r25689 = 1.0;
        double r25690 = B;
        double r25691 = tan(r25690);
        double r25692 = r25689 / r25691;
        double r25693 = r25688 * r25692;
        double r25694 = -r25693;
        double r25695 = sin(r25690);
        double r25696 = r25689 / r25695;
        double r25697 = r25694 + r25696;
        return r25697;
}

double f(double B, double x) {
        double r25698 = 1.0;
        double r25699 = B;
        double r25700 = sin(r25699);
        double r25701 = 1.0;
        double r25702 = x;
        double r25703 = cos(r25699);
        double r25704 = r25702 * r25703;
        double r25705 = r25701 - r25704;
        double r25706 = r25700 / r25705;
        double r25707 = r25698 / r25706;
        return r25707;
}

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 tan-quot0.2

    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\frac{\sin B}{\cos B}}}\right) + \frac{1}{\sin B}\]
  6. Applied associate-/r/0.2

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

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

Reproduce

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