Average Error: 0.2 → 0.2
Time: 25.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 r1787133 = x;
        double r1787134 = 1.0;
        double r1787135 = B;
        double r1787136 = tan(r1787135);
        double r1787137 = r1787134 / r1787136;
        double r1787138 = r1787133 * r1787137;
        double r1787139 = -r1787138;
        double r1787140 = sin(r1787135);
        double r1787141 = r1787134 / r1787140;
        double r1787142 = r1787139 + r1787141;
        return r1787142;
}

double f(double B, double x) {
        double r1787143 = 1.0;
        double r1787144 = B;
        double r1787145 = sin(r1787144);
        double r1787146 = r1787143 / r1787145;
        double r1787147 = x;
        double r1787148 = r1787147 / r1787145;
        double r1787149 = cos(r1787144);
        double r1787150 = r1787148 * r1787149;
        double r1787151 = r1787146 - r1787150;
        return r1787151;
}

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