Average Error: 0.2 → 0.2
Time: 57.0s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x
double f(double B, double x) {
        double r562051 = x;
        double r562052 = 1.0;
        double r562053 = B;
        double r562054 = tan(r562053);
        double r562055 = r562052 / r562054;
        double r562056 = r562051 * r562055;
        double r562057 = -r562056;
        double r562058 = sin(r562053);
        double r562059 = r562052 / r562058;
        double r562060 = r562057 + r562059;
        return r562060;
}

double f(double B, double x) {
        double r562061 = 1.0;
        double r562062 = B;
        double r562063 = sin(r562062);
        double r562064 = r562061 / r562063;
        double r562065 = tan(r562062);
        double r562066 = r562061 / r562065;
        double r562067 = x;
        double r562068 = r562066 * r562067;
        double r562069 = r562064 - r562068;
        return r562069;
}

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 div-inv0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}}\]
  5. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\]

Reproduce

herbie shell --seed 2019152 +o rules:numerics
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))