Average Error: 0.2 → 0.2
Time: 28.9s
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{1 \cdot x}}
double f(double B, double x) {
        double r2468061 = x;
        double r2468062 = 1.0;
        double r2468063 = B;
        double r2468064 = tan(r2468063);
        double r2468065 = r2468062 / r2468064;
        double r2468066 = r2468061 * r2468065;
        double r2468067 = -r2468066;
        double r2468068 = sin(r2468063);
        double r2468069 = r2468062 / r2468068;
        double r2468070 = r2468067 + r2468069;
        return r2468070;
}

double f(double B, double x) {
        double r2468071 = 1.0;
        double r2468072 = B;
        double r2468073 = sin(r2468072);
        double r2468074 = r2468071 / r2468073;
        double r2468075 = 1.0;
        double r2468076 = tan(r2468072);
        double r2468077 = x;
        double r2468078 = r2468071 * r2468077;
        double r2468079 = r2468076 / r2468078;
        double r2468080 = r2468075 / r2468079;
        double r2468081 = r2468074 - r2468080;
        return r2468081;
}

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 \cdot 1}{\tan B}}\]
  3. Using strategy rm
  4. Applied clear-num0.2

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

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

Reproduce

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