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{1}{\frac{\tan B}{x}}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\frac{1}{\sin B} - \frac{1}{\frac{\tan B}{x}}
double f(double B, double x) {
        double r1425013 = x;
        double r1425014 = 1.0;
        double r1425015 = B;
        double r1425016 = tan(r1425015);
        double r1425017 = r1425014 / r1425016;
        double r1425018 = r1425013 * r1425017;
        double r1425019 = -r1425018;
        double r1425020 = sin(r1425015);
        double r1425021 = r1425014 / r1425020;
        double r1425022 = r1425019 + r1425021;
        return r1425022;
}

double f(double B, double x) {
        double r1425023 = 1.0;
        double r1425024 = B;
        double r1425025 = sin(r1425024);
        double r1425026 = r1425023 / r1425025;
        double r1425027 = tan(r1425024);
        double r1425028 = x;
        double r1425029 = r1425027 / r1425028;
        double r1425030 = r1425023 / r1425029;
        double r1425031 = r1425026 - r1425030;
        return r1425031;
}

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.1

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied clear-num0.2

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

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

Reproduce

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