Average Error: 0.2 → 0.2
Time: 1.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 r3462971 = x;
        double r3462972 = 1.0;
        double r3462973 = B;
        double r3462974 = tan(r3462973);
        double r3462975 = r3462972 / r3462974;
        double r3462976 = r3462971 * r3462975;
        double r3462977 = -r3462976;
        double r3462978 = sin(r3462973);
        double r3462979 = r3462972 / r3462978;
        double r3462980 = r3462977 + r3462979;
        return r3462980;
}

double f(double B, double x) {
        double r3462981 = 1.0;
        double r3462982 = B;
        double r3462983 = sin(r3462982);
        double r3462984 = r3462981 / r3462983;
        double r3462985 = x;
        double r3462986 = r3462985 / r3462983;
        double r3462987 = cos(r3462982);
        double r3462988 = r3462986 * r3462987;
        double r3462989 = r3462984 - r3462988;
        return r3462989;
}

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