Average Error: 0.2 → 0.2
Time: 1.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 r1164045 = x;
        double r1164046 = 1.0;
        double r1164047 = B;
        double r1164048 = tan(r1164047);
        double r1164049 = r1164046 / r1164048;
        double r1164050 = r1164045 * r1164049;
        double r1164051 = -r1164050;
        double r1164052 = sin(r1164047);
        double r1164053 = r1164046 / r1164052;
        double r1164054 = r1164051 + r1164053;
        return r1164054;
}

double f(double B, double x) {
        double r1164055 = 1.0;
        double r1164056 = B;
        double r1164057 = sin(r1164056);
        double r1164058 = r1164055 / r1164057;
        double r1164059 = x;
        double r1164060 = r1164059 / r1164057;
        double r1164061 = cos(r1164056);
        double r1164062 = r1164060 * r1164061;
        double r1164063 = r1164058 - r1164062;
        return r1164063;
}

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 2019128 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))