Average Error: 0.2 → 0.2
Time: 7.3m
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B
double f(double B, double x) {
        double r8905678 = x;
        double r8905679 = 1.0;
        double r8905680 = B;
        double r8905681 = tan(r8905680);
        double r8905682 = r8905679 / r8905681;
        double r8905683 = r8905678 * r8905682;
        double r8905684 = -r8905683;
        double r8905685 = sin(r8905680);
        double r8905686 = r8905679 / r8905685;
        double r8905687 = r8905684 + r8905686;
        return r8905687;
}

double f(double B, double x) {
        double r8905688 = 1.0;
        double r8905689 = B;
        double r8905690 = sin(r8905689);
        double r8905691 = r8905688 / r8905690;
        double r8905692 = x;
        double r8905693 = r8905692 / r8905690;
        double r8905694 = cos(r8905689);
        double r8905695 = r8905693 * r8905694;
        double r8905696 = r8905691 - r8905695;
        return r8905696;
}

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} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B}\]
  6. Final simplification0.2

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

Reproduce

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