Average Error: 0.2 → 0.2
Time: 7.7m
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 r7476052 = x;
        double r7476053 = 1.0;
        double r7476054 = B;
        double r7476055 = tan(r7476054);
        double r7476056 = r7476053 / r7476055;
        double r7476057 = r7476052 * r7476056;
        double r7476058 = -r7476057;
        double r7476059 = sin(r7476054);
        double r7476060 = r7476053 / r7476059;
        double r7476061 = r7476058 + r7476060;
        return r7476061;
}

double f(double B, double x) {
        double r7476062 = 1.0;
        double r7476063 = B;
        double r7476064 = sin(r7476063);
        double r7476065 = r7476062 / r7476064;
        double r7476066 = x;
        double r7476067 = r7476066 / r7476064;
        double r7476068 = cos(r7476063);
        double r7476069 = r7476067 * r7476068;
        double r7476070 = r7476065 - r7476069;
        return r7476070;
}

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