Average Error: 0.2 → 0.2
Time: 56.4s
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 r1364204 = x;
        double r1364205 = 1.0;
        double r1364206 = B;
        double r1364207 = tan(r1364206);
        double r1364208 = r1364205 / r1364207;
        double r1364209 = r1364204 * r1364208;
        double r1364210 = -r1364209;
        double r1364211 = sin(r1364206);
        double r1364212 = r1364205 / r1364211;
        double r1364213 = r1364210 + r1364212;
        return r1364213;
}

double f(double B, double x) {
        double r1364214 = 1.0;
        double r1364215 = B;
        double r1364216 = sin(r1364215);
        double r1364217 = r1364214 / r1364216;
        double r1364218 = tan(r1364215);
        double r1364219 = r1364214 / r1364218;
        double r1364220 = x;
        double r1364221 = r1364219 * r1364220;
        double r1364222 = r1364217 - r1364221;
        return r1364222;
}

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))))