Average Error: 0.2 → 0.2
Time: 33.6s
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 r1409943 = x;
        double r1409944 = 1.0;
        double r1409945 = B;
        double r1409946 = tan(r1409945);
        double r1409947 = r1409944 / r1409946;
        double r1409948 = r1409943 * r1409947;
        double r1409949 = -r1409948;
        double r1409950 = sin(r1409945);
        double r1409951 = r1409944 / r1409950;
        double r1409952 = r1409949 + r1409951;
        return r1409952;
}

double f(double B, double x) {
        double r1409953 = 1.0;
        double r1409954 = B;
        double r1409955 = sin(r1409954);
        double r1409956 = r1409953 / r1409955;
        double r1409957 = x;
        double r1409958 = r1409957 / r1409955;
        double r1409959 = cos(r1409954);
        double r1409960 = r1409958 * r1409959;
        double r1409961 = r1409956 - r1409960;
        return r1409961;
}

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.1

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