Average Error: 0.2 → 0.2
Time: 23.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 r2040747 = x;
        double r2040748 = 1.0;
        double r2040749 = B;
        double r2040750 = tan(r2040749);
        double r2040751 = r2040748 / r2040750;
        double r2040752 = r2040747 * r2040751;
        double r2040753 = -r2040752;
        double r2040754 = sin(r2040749);
        double r2040755 = r2040748 / r2040754;
        double r2040756 = r2040753 + r2040755;
        return r2040756;
}

double f(double B, double x) {
        double r2040757 = 1.0;
        double r2040758 = B;
        double r2040759 = sin(r2040758);
        double r2040760 = r2040757 / r2040759;
        double r2040761 = x;
        double r2040762 = r2040761 / r2040759;
        double r2040763 = cos(r2040758);
        double r2040764 = r2040762 * r2040763;
        double r2040765 = r2040760 - r2040764;
        return r2040765;
}

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