Average Error: 0.2 → 0.2
Time: 28.2s
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 r2468059 = x;
        double r2468060 = 1.0;
        double r2468061 = B;
        double r2468062 = tan(r2468061);
        double r2468063 = r2468060 / r2468062;
        double r2468064 = r2468059 * r2468063;
        double r2468065 = -r2468064;
        double r2468066 = sin(r2468061);
        double r2468067 = r2468060 / r2468066;
        double r2468068 = r2468065 + r2468067;
        return r2468068;
}

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

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